diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal-option-public-link.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal-option-public-link.tsx index 9d37f3740..8f8e90303 100644 --- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal-option-public-link.tsx +++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal-option-public-link.tsx @@ -1,5 +1,5 @@ 'use client'; -import { App, Button, Checkbox, Col, Flex, Input, QRCode, Row } from 'antd'; +import { App, Button, Checkbox, Col, Flex, Input, QRCode, Row, Select, Space } from 'antd'; import { DownloadOutlined, CopyOutlined } from '@ant-design/icons'; import { useEffect, useRef, useState } from 'react'; import { useParams, useSearchParams } from 'next/navigation'; @@ -10,21 +10,24 @@ import { import { useEnvironment } from '@/components/auth-can'; import styles from './modeler-share-modal-option-public-link.module.scss'; +import { Process } from '@/lib/data/process-schema'; type ModelerShareModalOptionPublicLinkProps = { sharedAs: 'public' | 'protected'; shareTimestamp: number; refresh: () => void; + processVersions: Process['versions']; }; const ModelerShareModalOptionPublicLink = ({ sharedAs, shareTimestamp, refresh, + processVersions, }: ModelerShareModalOptionPublicLinkProps) => { const { processId } = useParams(); const query = useSearchParams(); - const selectedVersionId = query.get('version'); + const [selectedVersionId, setSelectedVersionId] = useState(query.get('version')); const environment = useEnvironment(); const [shareLink, setShareLink] = useState(''); @@ -185,95 +188,104 @@ const ModelerShareModalOptionPublicLink = ({ }; return ( - <> -
+ + + + + - - - - {isShareLinkChecked && ( -
- -
- )} -
- - - - - - - - - - -
- + Visible only for registered user + + + + + + + + + {isShareLinkChecked && ( +
+ +
+ )} +
+ + + + + + + + + + + ); }; diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal.tsx index daafe5c69..26d405cc9 100644 --- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal.tsx +++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-share-modal.tsx @@ -32,10 +32,15 @@ import { set } from 'zod'; type ShareModalProps = { onExport: () => void; onExportMobile: (type: ProcessExportOptions['type']) => void; + versions: Process['versions']; }; type SharedAsType = 'public' | 'protected'; -const ModelerShareModalButton: FC = ({ onExport, onExportMobile }) => { +const ModelerShareModalButton: FC = ({ + onExport, + onExportMobile, + versions: processVersions, +}) => { const { processId } = useParams(); const environment = useEnvironment(); const [isOpen, setIsOpen] = useState(false); @@ -276,6 +281,7 @@ const ModelerShareModalButton: FC = ({ onExport, onExportMobile sharedAs={sharedAs as SharedAsType} shareTimestamp={shareTimestamp} refresh={checkIfProcessShared} + processVersions={processVersions} /> ), }, diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-toolbar.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-toolbar.tsx index 890de3423..74f66e565 100644 --- a/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-toolbar.tsx +++ b/src/management-system-v2/app/(dashboard)/[environmentId]/processes/[processId]/modeler-toolbar.tsx @@ -317,6 +317,7 @@ const ModelerToolbar = ({