-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3941 from signalco-io/next
Next
- Loading branch information
Showing
20 changed files
with
240 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
web/apps/doprocess/components/processes/documents/DocumentDuplicateModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import { useRouter } from 'next/navigation'; | ||
import { Typography } from '@signalco/ui-primitives/Typography'; | ||
import { Stack } from '@signalco/ui-primitives/Stack'; | ||
import { Row } from '@signalco/ui-primitives/Row'; | ||
import { Modal } from '@signalco/ui-primitives/Modal'; | ||
import { Input } from '@signalco/ui-primitives/Input'; | ||
import { Button } from '@signalco/ui-primitives/Button'; | ||
import { Duplicate } from '@signalco/ui-icons'; | ||
import { KnownPages } from '../../../src/knownPages'; | ||
import { useDocumentCreate } from '../../../src/hooks/useDocumentCreate'; | ||
import { DocumentDto } from '../../../app/api/dtos/dtos'; | ||
|
||
type DocumentDuplicateModalProps = { | ||
open: boolean; | ||
onOpenChange: (open: boolean) => void; | ||
document: DocumentDto; | ||
}; | ||
|
||
export function DocumentDuplicateModal({ | ||
open, onOpenChange, document | ||
}: DocumentDuplicateModalProps) { | ||
const router = useRouter(); | ||
const [name, setName] = useState(document.name + ' (copy)'); | ||
const documentCreate = useDocumentCreate(); | ||
|
||
const handleDuplicate = async () => { | ||
const response = await documentCreate.mutateAsync({ | ||
name, | ||
basedOn: document.id | ||
}); | ||
if (response?.id) { | ||
onOpenChange(false); | ||
router.push(KnownPages.Document(response.id)); | ||
} | ||
}; | ||
|
||
return ( | ||
<Modal open={open} onOpenChange={onOpenChange}> | ||
<Stack spacing={2}> | ||
<Row spacing={2}> | ||
<Duplicate /> | ||
<Typography level="h5">Duplicate document</Typography> | ||
</Row> | ||
<Typography level="body2"> | ||
This will create a new document with the same name and content. | ||
</Typography> | ||
<Typography level="body2"> | ||
You can edit the new document after it is created. | ||
</Typography> | ||
<Input | ||
value={name} | ||
onChange={(e) => setName(e.target.value)} | ||
label="Name" | ||
placeholder="example: Onboarding manual" /> | ||
<Row justifyContent="end" spacing={1}> | ||
<Button variant="plain" onClick={() => onOpenChange(false)}>Cancel</Button> | ||
<Button variant="solid" onClick={handleDuplicate}>Duplicate</Button> | ||
</Row> | ||
</Stack> | ||
</Modal> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
web/apps/doprocess/components/processes/processes/ProcessDuplicateModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import { useRouter } from 'next/navigation'; | ||
import { Typography } from '@signalco/ui-primitives/Typography'; | ||
import { Stack } from '@signalco/ui-primitives/Stack'; | ||
import { Row } from '@signalco/ui-primitives/Row'; | ||
import { Modal } from '@signalco/ui-primitives/Modal'; | ||
import { Input } from '@signalco/ui-primitives/Input'; | ||
import { Button } from '@signalco/ui-primitives/Button'; | ||
import { Duplicate } from '@signalco/ui-icons'; | ||
import { KnownPages } from '../../../src/knownPages'; | ||
import { useProcessCreate } from '../../../src/hooks/useProcessCreate'; | ||
import { ProcessDto } from '../../../app/api/dtos/dtos'; | ||
|
||
type ProcessDuplicateModalProps = { | ||
open: boolean; | ||
onOpenChange: (open: boolean) => void; | ||
process: ProcessDto; | ||
}; | ||
|
||
export function ProcessDuplicateModal({ | ||
open, onOpenChange, process | ||
}: ProcessDuplicateModalProps) { | ||
const router = useRouter(); | ||
const [name, setName] = useState(process.name + ' (copy)'); | ||
const processCreate = useProcessCreate(); | ||
|
||
const handleDuplicate = async () => { | ||
const response = await processCreate.mutateAsync({ | ||
name, | ||
basedOn: process.id | ||
}); | ||
if (response?.id) { | ||
onOpenChange(false); | ||
router.push(KnownPages.Process(response.id)); | ||
} | ||
}; | ||
|
||
return ( | ||
<Modal open={open} onOpenChange={onOpenChange}> | ||
<Stack spacing={2}> | ||
<Row spacing={2}> | ||
<Duplicate /> | ||
<Typography level="h5">Duplicate process</Typography> | ||
</Row> | ||
<Typography level="body2"> | ||
This will create a new process with the same name and tasks. | ||
</Typography> | ||
<Typography level="body2"> | ||
You can edit the new process after it is created. | ||
</Typography> | ||
<Input | ||
value={name} | ||
onChange={(e) => setName(e.target.value)} | ||
label="Name" | ||
placeholder="example: Onboarding process" /> | ||
<Row justifyContent="end" spacing={1}> | ||
<Button variant="plain" onClick={() => onOpenChange(false)}>Cancel</Button> | ||
<Button variant="solid" onClick={handleDuplicate}>Duplicate</Button> | ||
</Row> | ||
</Stack> | ||
</Modal> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-doprocess – ./web/apps/doprocess
signalco-doprocess.vercel.app
signalco-doprocess-signalco.vercel.app
signalco-doprocess-git-main-signalco.vercel.app
doprocess.app
doprocess.signalco.dev
doprocess.signalco.io
www.doprocess.app
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-blog – ./web/apps/blog
signalco-blog.vercel.app
blog.signalco.io
signalco-blog-signalco.vercel.app
signalco-blog-git-main-signalco.vercel.app
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-ui-docs – ./web/apps/ui-docs
signalco-ui-docs.vercel.app
signalco-ui-docs-signalco.vercel.app
ui.signalco.io
signalco-ui-docs-git-main-signalco.vercel.app
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-app – ./web/apps/app
signalco-app-git-main-signalco.vercel.app
signalco-app.vercel.app
app.signalco.io
signalco-app-signalco.vercel.app
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-brandgrab – ./web/apps/brandgrab
signalco-brandgrab.vercel.app
signalco-brandgrab-signalco.vercel.app
signalco-brandgrab-git-main-signalco.vercel.app
brandgrab.signalco.io
brandgrab.io
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-web – ./web/apps/web
signalco.vercel.app
signalco-web-git-main-signalco.vercel.app
signalco-web-signalco.vercel.app
signalco.dev
www.signalco.io
signalco.io
1742520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
signalco-slco – ./web/apps/slco
signalco-slco.vercel.app
slco.signalco.io
signalco-slco-git-main-signalco.vercel.app
slco.io
signalco-slco-signalco.vercel.app