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

CM-406: get head from jsonExt #35

Merged
merged 5 commits into from
Jan 3, 2024
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
25 changes: 15 additions & 10 deletions src/components/GroupHistorySearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,29 @@ function GroupHistorySearcher({
'groupHistory.head',
'groupHistory.dateUpdated',
'groupHistory.version',
'groupHistory.jsonExt',
'groupHistory.members',
];

const itemFormatters = () => [
(groupHistory) => groupHistory.id,
(groupHistory) => `${groupHistory?.head?.firstName} ${groupHistory?.head?.lastName}`,
(groupHistory) => (groupHistory.dateUpdated
? formatDateFromISO(groupHistory.dateUpdated) : EMPTY_STRING
),
(groupHistory) => groupHistory.version,
(groupHistory) => groupHistory.jsonExt,
(groupHistory) => groupHistory?.id || EMPTY_STRING,
(groupHistory) => {
const jsonExt = groupHistory?.jsonExt ? JSON.parse(groupHistory.jsonExt) : null;
return jsonExt?.head ?? EMPTY_STRING;
},
(groupHistory) => (groupHistory?.dateUpdated
? formatDateFromISO(groupHistory.dateUpdated)
: EMPTY_STRING),
(groupHistory) => groupHistory?.version || EMPTY_STRING,
(groupHistory) => {
const jsonExt = groupHistory?.jsonExt ? JSON.parse(groupHistory.jsonExt) : null;
return jsonExt?.members ?? EMPTY_STRING;
},
];

const rowIdentifier = (groupHistory) => groupHistory.id;

const sorts = () => [
['id', false],
['head', false],
['id', true],
['dateUpdated', true],
['version', true],
];
Expand Down
3 changes: 3 additions & 0 deletions src/components/GroupIndividualSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function GroupIndividualSearcher({
const [deletedGroupIndividualUuids, setDeletedGroupIndividualUuids] = useState([]);
const prevSubmittingMutationRef = useRef();
const [updatedGroupIndividuals, setUpdatedGroupIndividuals] = useState([]);
const [refetch, setRefetch] = useState(null);

function groupIndividualUpdatePageUrl(groupIndividual) {
return `${modulesManager.getRef('individual.route.individual')}/${groupIndividual.individual?.id}`;
Expand Down Expand Up @@ -156,6 +157,7 @@ function GroupIndividualSearcher({
id: editedGroupIndividual?.individual?.id,
}),
);
setRefetch(editedGroupIndividual?.individual?.id);
}
};

Expand Down Expand Up @@ -265,6 +267,7 @@ function GroupIndividualSearcher({
return (
<div>
<Searcher
key={refetch}
module="individual"
FilterPane={groupBeneficiaryFilter}
fetch={fetch}
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"version": "Version",
"any": "ANY",
"ok": "ok",
"jsonExt": "Additional fields"
"jsonExt": "Additional fields",
"members": "Members"
},
"groupHistoryList": {
"pageTitle": "Groups History",
Expand Down
Loading