Skip to content

Commit 84bba89

Browse files
committed
fix(web): prevent event propagation on deploy modal click and resolve Windows line ending test failures
1 parent 2104bc8 commit 84bba89

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

apps/web/src/components/FileViewer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9020,7 +9020,14 @@ function HtmlViewer({
90209020
if (event.target === event.currentTarget) closeDeployModal();
90219021
}}
90229022
>
9023-
<div className="modal deploy-modal deploy-flow-modal" role="dialog" aria-modal="true">
9023+
<div
9024+
className="modal deploy-modal deploy-flow-modal"
9025+
role="dialog"
9026+
aria-modal="true"
9027+
onClick={(event) => {
9028+
event.stopPropagation();
9029+
}}
9030+
>
90249031
<div className="deploy-flow-modal__scroll">
90259032
<div className="modal-head">
90269033
<div className="kicker">{deployProviderLabel}</div>

apps/web/tests/components/FileViewer.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,6 +2533,16 @@ describe('FileViewer SVG artifacts', () => {
25332533
updatedAt: 2,
25342534
}), { status: 200 });
25352535
}
2536+
if (url === '/api/deploy/config' && method === 'PUT') {
2537+
return new Response(JSON.stringify({
2538+
providerId: 'vercel-self',
2539+
configured: true,
2540+
tokenMask: 'saved-token',
2541+
teamId: '',
2542+
teamSlug: '',
2543+
target: 'preview',
2544+
}), { status: 200 });
2545+
}
25362546
return new Response(JSON.stringify({}), { status: 404 });
25372547
}));
25382548

apps/web/tests/helpers/read-expanded-css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function expandCssFile(filePath: string, seen = new Set<string>()): string {
1212
}
1313
seen.add(key);
1414

15-
const css = readFileSync(filePath, 'utf8');
15+
const css = readFileSync(filePath, 'utf8').replace(/\r\n/g, '\n');
1616
return css.replace(/@import\s+(?:url\(([^)]+)\)|(['"])([^'"]+)\2);/g, (_match, urlImport, _quote, quotedImport) => {
1717
const specifier = (quotedImport ?? urlImport ?? '').trim().replace(/^['"]|['"]$/g, '');
1818
if (!specifier.startsWith('./') && !specifier.startsWith('../')) {

0 commit comments

Comments
 (0)