Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
[NC]: adds url on create recording and edit and play button validation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaschapur committed Jun 13, 2024
1 parent cc16cf6 commit 559baf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/mocksi-lite/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Recording {
dom_before: string;
tab_id: string;
uuid: string;
url: string;
}

interface ChromeMessage {
Expand Down Expand Up @@ -138,6 +139,7 @@ function createDemo(body: Record<string, unknown>) {
...body,
...defaultBody,
tab_id: result.id?.toString() ?? "",
url: result.url
}).then(() => getRecordings());
});
}
Expand Down
4 changes: 3 additions & 1 deletion apps/mocksi-lite/content/Popup/CreateDemo/DemoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const DemoItem = ({
customer_name,
setState,
alterations,
url
}: DemoItemProps) => {
const handleEdit = () => {
setEditorMode(true, uuid);
Expand All @@ -30,12 +31,13 @@ const DemoItem = ({
<TextField>{customer_name}</TextField>
</div>
<div className={"flex gap-3"}>
<Button variant={Variant.icon} onClick={handleEdit}>
<Button variant={Variant.icon} onClick={handleEdit} disabled={!url.includes(window.location.hostname)}>
<img src={editIcon} alt={"editIcon"} />
</Button>
<Button
variant={Variant.icon}
onClick={() => loadAlterations(alterations)}
disabled={!url.includes(window.location.hostname)}
>
<img src={exportIcon} alt={"exportIcon"} />
</Button>
Expand Down
2 changes: 1 addition & 1 deletion apps/mocksi-lite/content/Popup/CreateDemo/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Form = ({ onCancel }: FormProps) => {
/>
</div>
<div className={"mt-[42px] flex justify-end gap-4"}>
<Button onClick={onCancel} variant={Variant.secondary}>
<Button onClick={() => onCancel()} variant={Variant.secondary}>
Cancel
</Button>
<Button disabled={!name.length} onClick={handleSubmit}>
Expand Down

0 comments on commit 559baf9

Please sign in to comment.