Skip to content

Commit

Permalink
Merge pull request #2602 from glific/flow-description
Browse files Browse the repository at this point in the history
add description to flow
  • Loading branch information
mdshamoon authored Oct 30, 2023
2 parents 126cf4d + 129503c commit 98b7a1f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/containers/Flow/Flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -66,11 +67,22 @@ export const Flow = () => {

if (loading) return <Loading />;

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,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions src/graphql/mutations/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const CREATE_FLOW = gql`
id
name
isActive
description
uuid
roles {
id
Expand All @@ -39,6 +40,7 @@ export const UPDATE_FLOW = gql`
id
name
isActive
description
uuid
roles {
id
Expand Down Expand Up @@ -91,6 +93,7 @@ export const CREATE_FLOW_COPY = gql`
id
name
keywords
description
uuid
}
errors {
Expand Down
2 changes: 2 additions & 0 deletions src/graphql/queries/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const GET_FLOW = gql`
uuid
isActive
isPinned
description
roles {
id
label
Expand Down Expand Up @@ -48,6 +49,7 @@ export const FILTER_FLOW = gql`
name
uuid
keywords
description
lastChangedAt
isBackground
lastPublishedAt
Expand Down

0 comments on commit 98b7a1f

Please sign in to comment.