From 98785eae72ef5cb1c00c4e2bf67e8a6bd3ca023c Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Sun, 29 Oct 2023 20:40:22 +0000 Subject: [PATCH] add description to flow --- src/containers/Flow/Flow.tsx | 23 ++++++++++++++++++++++- src/graphql/mutations/Flow.ts | 3 +++ src/graphql/queries/Flow.ts | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/containers/Flow/Flow.tsx b/src/containers/Flow/Flow.tsx index 29324542d..118c99b68 100644 --- a/src/containers/Flow/Flow.tsx +++ b/src/containers/Flow/Flow.tsx @@ -34,6 +34,7 @@ export const Flow = () => { const [name, setName] = useState(''); const [isPinnedDisable, setIsPinnedDisable] = useState(false); const [keywords, setKeywords] = useState(''); + const [description, setDescription] = useState(''); const [tagId, setTagId] = useState({ id: '', label: '' }); const [isActive, setIsActive] = useState(true); const [isPinned, setIsPinned] = useState(false); @@ -66,11 +67,22 @@ export const Flow = () => { if (loading) return ; - const states = { isActive, isPinned, isBackground, name, keywords, tagId, ignoreKeywords, roles }; + const states = { + isActive, + isPinned, + isBackground, + name, + keywords, + description, + tagId, + ignoreKeywords, + roles, + }; const setStates = ({ name: nameValue, keywords: keywordsValue, + description: descriptionValue, tag: tagValue, isActive: isActiveValue, isPinned: isPinnedValue, @@ -101,6 +113,7 @@ export const Flow = () => { setIsPinned(isPinnedValue); setIsBackground(isBackgroundValue); setRoles(rolesValue); + setDescription(descriptionValue); // we are receiving keywords as an array object if (fieldKeywords.length > 0) { @@ -140,6 +153,14 @@ export const Flow = () => { placeholder: t('Keywords'), helperText: t('Enter comma separated keywords that trigger this flow'), }, + { + component: Input, + name: 'description', + type: 'text', + textArea: true, + rows: 2, + placeholder: t('Description'), + }, { component: AutoComplete, name: 'tagId', diff --git a/src/graphql/mutations/Flow.ts b/src/graphql/mutations/Flow.ts index 6f8f93892..b7de918c7 100644 --- a/src/graphql/mutations/Flow.ts +++ b/src/graphql/mutations/Flow.ts @@ -18,6 +18,7 @@ export const CREATE_FLOW = gql` id name isActive + description uuid roles { id @@ -39,6 +40,7 @@ export const UPDATE_FLOW = gql` id name isActive + description uuid roles { id @@ -91,6 +93,7 @@ export const CREATE_FLOW_COPY = gql` id name keywords + description uuid } errors { diff --git a/src/graphql/queries/Flow.ts b/src/graphql/queries/Flow.ts index f84455a72..a494090b4 100644 --- a/src/graphql/queries/Flow.ts +++ b/src/graphql/queries/Flow.ts @@ -19,6 +19,7 @@ export const GET_FLOW = gql` uuid isActive isPinned + description roles { id label @@ -48,6 +49,7 @@ export const FILTER_FLOW = gql` name uuid keywords + description lastChangedAt isBackground lastPublishedAt