Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add description to flow #2602

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading