Skip to content

Commit

Permalink
Merge pull request #707 from glific/update-flow-api
Browse files Browse the repository at this point in the history
Updated flow status from done to published
  • Loading branch information
kurund authored Nov 12, 2020
2 parents f9702a3 + 576e0f6 commit c98d685
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const SIDE_DRAWER_WIDTH = 233;
export const DATE_FORMAT = 'DD/MM/YY';
export const TIME_FORMAT = 'HH:mm';
export const SIMULATOR_CONTACT = '9876543210';
export const AUTOMATION_STATUS_PUBLISHED = 'published';

// const enums
// provider status against the contact
Expand Down
9 changes: 7 additions & 2 deletions src/containers/Chat/ChatMessages/ContactBar/ContactBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ import { ADD_AUTOMATION_TO_CONTACT } from '../../../../graphql/mutations/Automat
import { UPDATE_CONTACT } from '../../../../graphql/mutations/Contact';
import { SEARCH_QUERY } from '../../../../graphql/queries/Search';
import { setNotification } from '../../../../common/notification';
import { SEARCH_QUERY_VARIABLES, setVariables } from '../../../../common/constants';
import {
AUTOMATION_STATUS_PUBLISHED,
SEARCH_QUERY_VARIABLES,
setVariables,
} from '../../../../common/constants';
import { Timer } from '../../../../components/UI/Timer/Timer';
import { DropdownDialog } from '../../../../components/UI/DropdownDialog/DropdownDialog';
import { DialogBox } from '../../../../components/UI/DialogBox/DialogBox';
Expand Down Expand Up @@ -61,8 +65,9 @@ export const ContactBar: React.SFC<ContactBarProps> = (props) => {
// get the published automation list
const [getAutomations, { data: automationsData }] = useLazyQuery(GET_AUTOMATIONS, {
variables: setVariables({
status: 'done',
status: AUTOMATION_STATUS_PUBLISHED,
}),
fetchPolicy: 'network-only', // set for now, need to check cache issue
});

// get contact groups
Expand Down
5 changes: 3 additions & 2 deletions src/containers/Group/GroupList/GroupList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { displayUserGroups } from '../../../context/role';
import { ReactComponent as AddContactIcon } from '../../../assets/images/icons/Contact/Add.svg';
import { SearchDialogBox } from '../../../components/UI/SearchDialogBox/SearchDialogBox';
import { CONTACT_SEARCH_QUERY, GET_GROUP_CONTACTS } from '../../../graphql/queries/Contact';
import { setVariables } from '../../../common/constants';
import { AUTOMATION_STATUS_PUBLISHED, setVariables } from '../../../common/constants';
import { IconButton } from '@material-ui/core';
import Menu from '../../../components/UI/Menu/Menu';
import { CREATE_AND_SEND_MESSAGE_TO_GROUP_MUTATION } from '../../../graphql/mutations/Chat';
Expand Down Expand Up @@ -61,8 +61,9 @@ export const GroupList: React.SFC<GroupListProps> = (props) => {
// get the published automation list
const [getAutomations, { data: automationData }] = useLazyQuery(GET_AUTOMATIONS, {
variables: setVariables({
status: 'done',
status: AUTOMATION_STATUS_PUBLISHED,
}),
fetchPolicy: 'network-only', // set for now, need to check cache issue
});

const [getContacts, { data: contactsData }] = useLazyQuery(CONTACT_SEARCH_QUERY, {
Expand Down
5 changes: 3 additions & 2 deletions src/containers/SettingList/Organisation/Organisation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../../../graphql/mutations/Organization';
import { GET_LANGUAGES } from '../../../graphql/queries/List';
import { ReactComponent as Settingicon } from '../../../assets/images/icons/Settings/Settings.svg';
import { setVariables } from '../../../common/constants';
import { AUTOMATION_STATUS_PUBLISHED, setVariables } from '../../../common/constants';

const validation = {
name: Yup.string().required('Organisation name is required.'),
Expand Down Expand Up @@ -94,8 +94,9 @@ export const Organisation: React.SFC = () => {
// get the published automation list
const { data } = useQuery(GET_AUTOMATIONS, {
variables: setVariables({
status: 'done',
status: AUTOMATION_STATUS_PUBLISHED,
}),
fetchPolicy: 'network-only', // set for now, need to check cache issue
});

const { data: languages } = useQuery(GET_LANGUAGES, {
Expand Down
4 changes: 2 additions & 2 deletions src/containers/SettingList/SettingList.test.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getProvidersQuery,
getCredential,
} from '../../mocks/Organization';
import { setVariables } from '../../common/constants';
import { AUTOMATION_STATUS_PUBLISHED, setVariables } from '../../common/constants';

export const LIST_ITEM_MOCKS = [
{
Expand Down Expand Up @@ -52,7 +52,7 @@ export const LIST_ITEM_MOCKS = [
{
request: {
query: GET_AUTOMATIONS,
variables: setVariables({ status: 'done' }),
variables: setVariables({ status: AUTOMATION_STATUS_PUBLISHED }),
},
result: {
data: {
Expand Down

0 comments on commit c98d685

Please sign in to comment.