Skip to content

Commit

Permalink
Merge pull request #2589 from glific/feature/update-list-on-save
Browse files Browse the repository at this point in the history
Update list on saving a popup for add contact to collection
  • Loading branch information
mdshamoon authored Oct 11, 2023
2 parents 5e3d067 + 824bf32 commit ec48281
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/containers/Collection/CollectionList/CollectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const columnAttributes = {
};

export const CollectionList = () => {
const [updateCollection, setUpdateCollection] = useState(false);
const [addContactsDialogShow, setAddContactsDialogShow] = useState(false);

const [contactSearchTerm, setContactSearchTerm] = useState('');
Expand Down Expand Up @@ -95,6 +96,7 @@ export const CollectionList = () => {
} else {
setNotification(`${numberAdded} contact${numberAdded === 1 ? '' : 's were'} added`);
}
setUpdateCollection((updateCollection) => !updateCollection);
setAddContactsDialogShow(false);
},
refetchQueries: [{ query: GET_COLLECTION_CONTACTS, variables: { id: collectionId } }],
Expand Down Expand Up @@ -218,6 +220,7 @@ export const CollectionList = () => {
</Modal>
)}
<List
refreshList={updateCollection}
restrictedAction={getRestrictedAction}
title={t('Collections')}
listItem="groups"
Expand Down
1 change: 0 additions & 1 deletion src/containers/Flow/FlowList/FlowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ export const FlowList = () => {
secondaryButton={importButton}
filters={filters}
filterList={activeFilter}
filtersTag={selectedtag && selectedtag.id}
filterDropdowm={tagFilter}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions src/containers/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export interface ListProps {
};
searchParameter?: Array<any>;
filters?: Object | null;
filtersTag?: any;
filterList?: any;
filterDropdowm?: any;
displayListType?: string;
Expand Down Expand Up @@ -82,6 +81,7 @@ export interface ListProps {
defaultSortBy?: string | null;
noItemText?: string | null;
customStyles?: any;
refreshList?: boolean;
}

interface TableVals {
Expand Down Expand Up @@ -116,7 +116,7 @@ export const List = ({
editSupport = true,
searchParameter = ['label'],
filters = null,
filtersTag = null,
refreshList = false,
displayListType = 'list',
cardLink = null,
additionalAction = () => [],
Expand Down Expand Up @@ -268,7 +268,7 @@ export const List = ({
useEffect(() => {
refetchValues();
refetchCount();
}, [searchVal, filters]);
}, [searchVal, filters, refreshList]);

useEffect(() => {
if (userRole.length === 0) {
Expand Down

0 comments on commit ec48281

Please sign in to comment.