diff --git a/src/containers/Flow/Flow.tsx b/src/containers/Flow/Flow.tsx index 41bfcf4a4..952f379c0 100644 --- a/src/containers/Flow/Flow.tsx +++ b/src/containers/Flow/Flow.tsx @@ -43,6 +43,8 @@ export const Flow = () => { const [roles, setRoles] = useState>([]); const [isBackground, setIsBackground] = useState(false); const [ignoreKeywords, setIgnoreKeywords] = useState(false); + const [copyFlowTitle, setCopyFlowTitle] = useState(''); + const { t } = useTranslation(); let isTemplate = false; @@ -104,11 +106,13 @@ export const Flow = () => { if (location.state === 'copy') { fieldName = `Copy of ${nameValue}`; fieldKeywords = ''; + setCopyFlowTitle(nameValue); } else if (location.state === 'copyTemplate') { fieldName = ''; description = ''; tags = null; fieldKeywords = ''; + setCopyFlowTitle(nameValue); } const { organization: { @@ -277,12 +281,12 @@ export const Flow = () => { if (location.state === 'copy') { queries.updateItemQuery = CREATE_FLOW_COPY; - title = t('Copy flow'); + title = t('Copy of'); type = 'copy'; copyNotification = t('Copy of the flow has been created!'); } else if (location.state === 'copyTemplate') { queries.updateItemQuery = CREATE_FLOW_COPY; - title = t('Template flow copy'); + title = t('Copy of'); type = 'copy'; copyNotification = t('Flow created successfully from template!'); } else if (location.state === 'template') { @@ -291,6 +295,10 @@ export const Flow = () => { queries.updateItemQuery = UPDATE_FLOW; } + if (copyFlowTitle) { + title = `${title} ${copyFlowTitle}`; + } + const customHandler = (data: any) => { let dataCopy = data; if (data[0].key === 'keywords') { diff --git a/src/i18n/en/en.json b/src/i18n/en/en.json index a05addfc7..3507332f5 100644 --- a/src/i18n/en/en.json +++ b/src/i18n/en/en.json @@ -182,7 +182,7 @@ "If activated, users will not be able to change this flow by entering keyword for any other flow.": "If activated, users will not be able to change this flow by entering keyword for any other flow.", "Is pinned?": "Is pinned?", "Run this flow in the background": "Run this flow in the background", - "Copy flow": "Copy flow", + "Copy of": "Copy of", "Sorry! An error occurred!": "Sorry! An error occurred!", "Copy of the flow has been created!": "Copy of the flow has been created!", "Import flow": "Import flow", @@ -511,7 +511,6 @@ "Import the csv with translations for interactive message.": "Import the csv with translations for interactive message.", "Template Flows": "Template Flows", "Template Flow": "Template Flow", - "Template flow copy": "Template flow copy", "Flow created successfully from template!": "Flow created successfully from template!", "Select/Create an assistant": "Select/Create an assistant", "Create Assistant": "Create Assistant",