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

feat: [DHIS2-12615][DHIS2-12616][DHIS2-15906] Add new Relationship (Feature-parity) #3401

Merged
merged 133 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
ac4b6fe
feat: [DHIS2-12362] add widget relationship component
jasminenguyennn Jan 21, 2022
7d9f3de
feat: first draft to New TEI relationship
eirikhaugstulen Jan 21, 2022
07b42fa
feat: [DHIS2-12362] add relationship widget
jasminenguyennn Jan 25, 2022
c85b9d0
feat: [DHIS2-12362] compute tei data
jasminenguyennn Jan 26, 2022
11a2bf7
feat: [DHIS2-12362] add relationship in redux
jasminenguyennn Jan 27, 2022
9362c1a
feat: [DHIS2-12362] minor change
jasminenguyennn Jan 27, 2022
f15bf33
Merge remote-tracking branch 'origin/master' into eh/feat/new-tei-rel…
eirikhaugstulen Jan 30, 2022
addbe06
feat: first draft to new TEI relationshiphandler
eirikhaugstulen Jan 31, 2022
98445b7
fix: add constraint to state
eirikhaugstulen Feb 3, 2022
e944f77
Merge branch 'master' into DHIS2-12362
jasminenguyennn Feb 4, 2022
748fecc
fix: [DHIS2-12362] minor update
jasminenguyennn Feb 4, 2022
56c568b
fix: [DHIS2-12362] minor update
jasminenguyennn Feb 4, 2022
6b6d0dd
fix: [DHIS2-12362] add event relationshio
jasminenguyennn Feb 4, 2022
2fb5620
fix: [DHIS2-12362] update tet
jasminenguyennn Feb 7, 2022
279f639
chore: [DHIS2-12362] cleanup fromconstraint
jasminenguyennn Feb 8, 2022
d8a1e89
fix: [DHIS2-12362] fix flow
jasminenguyennn Feb 8, 2022
6ff4edb
fix: [DHIS2-12362] fix flow
jasminenguyennn Feb 8, 2022
fd5c535
fix: [DHIS2-12362] fix flow
jasminenguyennn Feb 8, 2022
5faa3e1
fix: [DHIS2-12362] fix flow
jasminenguyennn Feb 8, 2022
65b9ecc
fix: [DHIS2-12362] minor fix
jasminenguyennn Feb 8, 2022
a9492bd
fix: [DHIS2-12362] minor fix
jasminenguyennn Feb 8, 2022
6650036
fix: [DHIS2-12362] minor fix
jasminenguyennn Feb 8, 2022
8f3a652
Merge branch 'master' into DHIS2-12362
jasminenguyennn Feb 14, 2022
02a2802
chore: [DHIS2-12362] update relationships
jasminenguyennn Feb 14, 2022
e9b4a70
chore: [DHIS2-12362] update relationships
jasminenguyennn Feb 14, 2022
eb7239d
fix: [DHIS2-12362] fix flow
jasminenguyennn Feb 14, 2022
ffb7b2f
feat: [DHIS2-12362] add relationship to view enrollment event
jasminenguyennn Feb 15, 2022
4abf6ef
Merge remote-tracking branch 'origin/master' into eh/feat/new-tei-rel…
eirikhaugstulen Feb 17, 2022
d0b115d
fix: changed object for displaying relationships & breadcrumbs
eirikhaugstulen Feb 18, 2022
d88383a
feat: initial layout for linking relationship to existing TEI
eirikhaugstulen Feb 25, 2022
f9dd6e1
fix: close modal on link complete
eirikhaugstulen Feb 25, 2022
7d8b4b7
fix: LGTM
eirikhaugstulen Feb 25, 2022
7c76be0
Merge branch 'master' into DHIS2-12362
jasminenguyennn Mar 2, 2022
88cf85a
Merge branch 'master' into DHIS2-12362
jasminenguyennn Mar 9, 2022
09fa106
Merge branch 'master' into DHIS2-12362
jasminenguyennn Mar 14, 2022
5c66bcd
Merge branch 'master' into DHIS2-12362
jasminenguyennn Mar 20, 2022
363d214
chore: [DHIS2-12362] refactor
jasminenguyennn Mar 23, 2022
6ebc99d
chore: [DHIS2-12362] rename funcs
jasminenguyennn Mar 24, 2022
bdb5562
chore: [DHIS2-12362] use new API
jasminenguyennn Mar 24, 2022
7dd0f93
chore: [DHI2-12362] change type
jasminenguyennn Mar 24, 2022
038ce39
chore: [DHI2-12362] change type
jasminenguyennn Mar 24, 2022
0e43a26
chore: [DHIS2-12362] fix edit event
jasminenguyennn Mar 25, 2022
3b2f70a
Merge branch 'master' into DHIS2-12362
jasminenguyennn Mar 25, 2022
42e6032
Merge branch 'master' into DHIS2-12362
jasminenguyennn Apr 6, 2022
72b7df5
chore: [DHIS2-12362] minor change
jasminenguyennn Apr 6, 2022
7f97c0f
fix: [DHIS2-12362] fix combinations
jasminenguyennn Apr 8, 2022
a788cd1
Merge branch 'master' into DHIS2-12362
jasminenguyennn Apr 21, 2022
f309105
chore: [DHIS2-12362] restructure the components
jasminenguyennn Apr 30, 2022
5183509
Merge branch 'master' into DHIS2-12362
jasminenguyennn May 1, 2022
9682ffe
chore: [DHIS2-12362] change await/async loop
jasminenguyennn May 2, 2022
4e55df3
feat: [DHIS2-12377] Event relationship (#2726)
jasminenguyennn May 2, 2022
ab89592
chore: [DHIS2-12362] address review comments
jasminenguyennn May 4, 2022
dbfe1fb
chore: [DHIS2-12362] rename files
jasminenguyennn May 4, 2022
5a7eec4
chore: [DHIS2-12362] minor change
jasminenguyennn May 5, 2022
e92c9b2
feat: [DHIS2-12362] add display fields
jasminenguyennn May 5, 2022
594ca2a
feat: [DHIS2-12362] add display fields
jasminenguyennn May 5, 2022
81672fc
feat: [DHIS2-12362] add display fields
jasminenguyennn May 5, 2022
015c4b3
chore: [DHIS2-12362] minor change
jasminenguyennn May 5, 2022
2d1af84
chore:[DHIS2-12362] update user storage
jasminenguyennn May 10, 2022
6f09736
chore: [DHIS2-12362] minor change
jasminenguyennn May 10, 2022
7efe0ef
chore: [DHIS2-12362] add creation date
jasminenguyennn May 19, 2022
4e21fc4
chore: [DHIS2-12362] update event
jasminenguyennn May 23, 2022
9ae1f0e
Merge branch 'master' into DHIS2-12362
jasminenguyennn May 23, 2022
ef24bc2
chore: [DHIS2-12362] move type def
jasminenguyennn May 23, 2022
3bce665
chore: [DHIS2-12362] move type def
jasminenguyennn May 23, 2022
59e1026
chore: [DHIS2-12362] minor fix
jasminenguyennn May 23, 2022
f3d5d2d
chore: [DHIS2-12362] return all types
jasminenguyennn May 24, 2022
587180c
Merge branch 'master' into DHIS2-12362
jasminenguyennn May 24, 2022
0607b79
chore: [DHIS2-12362] add created relationship date
jasminenguyennn Jun 4, 2022
c68a666
chore: [DHIS2-12362] use display name
jasminenguyennn Jun 9, 2022
a638306
Merge branch 'master' into DHIS2-12362
jasminenguyennn Jun 27, 2022
419ae84
fix: [DHIS2-13202] fix occurred at label in stages
jasminenguyennn Jul 15, 2022
9202d4d
Merge branch 'master' into DHIS2-12362
jasminenguyennn Jul 20, 2022
8c1fd1e
fix: [DHIS2-12362] cypress
jasminenguyennn Jul 20, 2022
6d2e029
Merge branch 'master' into DHIS2-12362
jasminenguyennn Jul 22, 2022
17836e2
Merge branch 'master' into DHIS2-12362
jasminenguyennn Jul 26, 2022
9886119
Merge branch 'master' into DHIS2-12362
jasminenguyennn Jul 28, 2022
5fd15f8
fix: [DHIS2-12362] convert date
jasminenguyennn Aug 2, 2022
c689e4d
chore: [DHIS2-12362] UI improvements
jasminenguyennn Aug 29, 2022
63bc722
chore: [DHIS2-12362] minor
jasminenguyennn Aug 29, 2022
83cbc52
fix: [DHIS2-12362] fix flow
jasminenguyennn Aug 29, 2022
8d099c0
Merge branch 'master' into DHIS2-12362
jasminenguyennn Aug 29, 2022
d184468
chore: [DHIS2-12362] sort most recent event
jasminenguyennn Aug 30, 2022
bd912e1
Merge branch 'master' into DHIS2-12362
jasminenguyennn Aug 30, 2022
320259c
feat: [DHIS2-12372] view linked record (#2780)
jasminenguyennn Aug 30, 2022
067e1a5
Merge branch 'master' into DHIS2-12362
jasminenguyennn Sep 2, 2022
b60af3f
Merge branch 'DHIS2-12362' of work:dhis2/capture-app into DHIS2-12362
jasminenguyennn Sep 2, 2022
ee5b02f
Merge branch 'master' into DHIS2-12362
jasminenguyennn Sep 12, 2022
2c91cc6
chore: useMetadataQuery utility method
JoakimSM Dec 8, 2022
a87bb76
chore: useIndexedDB utility method
JoakimSM Dec 8, 2022
0f8ece0
feat: changed a hook to implement the custom hooks
eirikhaugstulen Dec 13, 2022
7fa38a2
fix: added error handling to the useIndexedDBQuery
eirikhaugstulen Dec 21, 2022
25cec6e
feat: init relationships
JoakimSM Jun 16, 2022
a36e9f7
Merge remote-tracking branch 'origin/eh/TECH/TECH-1486_UtilityHookFor…
JoakimSM Jan 5, 2023
67b827a
feat: continue relationships
JoakimSM Jan 5, 2023
bc15dc4
Merge branch 'master' into DHIS2-12615
JoakimSM Apr 18, 2023
1e76f2f
fix: postmerge
JoakimSM Apr 18, 2023
7a5cf96
Merge remote-tracking branch 'origin/DHIS2-12362' into DHIS2-12615
eirikhaugstulen Apr 24, 2023
dc5b88d
chore: temp
eirikhaugstulen Apr 27, 2023
43a9c57
feat: first iteration of Relationships Widget
eirikhaugstulen May 2, 2023
7685ec3
fix: code cleanup
eirikhaugstulen May 3, 2023
c3331c8
chore: review comments
eirikhaugstulen May 23, 2023
518456a
chore: review comments
eirikhaugstulen May 26, 2023
4ad1bea
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12362…
eirikhaugstulen May 26, 2023
5c49e06
feat: [DHIS2-12362] display relationships
JoakimSM Jun 5, 2023
7ebdb59
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12615…
eirikhaugstulen Jul 21, 2023
c14d0eb
feat: add search functionality
eirikhaugstulen Jul 22, 2023
cb5aa6c
Merge remote-tracking branch 'origin/eh/epics/DHIS2-12361_TeiRelation…
eirikhaugstulen Jul 28, 2023
350d2ac
chore: flow
eirikhaugstulen Jul 28, 2023
438d2cd
feat: [DHIS2-12362][DHIS2-12455] View and filter relationships (#3241)
eirikhaugstulen Jul 28, 2023
4b88893
Merge remote-tracking branch 'origin/eh/epics/DHIS2-12361_TeiRelation…
eirikhaugstulen Jul 28, 2023
30c77c4
chore: flow
eirikhaugstulen Jul 28, 2023
14a2530
chore: temp
eirikhaugstulen Aug 4, 2023
72ac535
feat: create new tei from relationship
eirikhaugstulen Aug 14, 2023
261d312
fix: change program in search
eirikhaugstulen Aug 14, 2023
cb84cf4
chore: upgrade cacheVersion
eirikhaugstulen Aug 15, 2023
c7eafe7
fix: chore remove success snackbar
eirikhaugstulen Aug 24, 2023
abdf53c
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12616…
eirikhaugstulen Sep 11, 2023
f943323
fix: pr-review
eirikhaugstulen Sep 11, 2023
04e93ed
fix: pr-review
eirikhaugstulen Sep 12, 2023
ebe355d
Merge remote-tracking branch 'origin/master' into eh/epics/DHIS2-1236…
eirikhaugstulen Sep 12, 2023
bc933b6
Merge remote-tracking branch 'origin/eh/epics/DHIS2-12361_TeiRelation…
eirikhaugstulen Sep 12, 2023
07766e1
chore: typo
eirikhaugstulen Sep 12, 2023
d978ed8
chore: loading spinner
eirikhaugstulen Sep 12, 2023
f880324
chore: pr-reviews
eirikhaugstulen Sep 28, 2023
a93bef9
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12616…
eirikhaugstulen Oct 3, 2023
6016b85
feat: [DHIS2-15906] Add form features for relationship
eirikhaugstulen Oct 17, 2023
afb28dc
docs: [DHIS2-12361] Relationships widget (#3430)
eirikhaugstulen Oct 20, 2023
3ab905d
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12616…
eirikhaugstulen Oct 20, 2023
c9f297b
chore: bump cache version
eirikhaugstulen Oct 22, 2023
d677101
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12616…
eirikhaugstulen Oct 23, 2023
b0b54e5
Merge remote-tracking branch 'origin/master' into eh/feat/DHIS2-12616…
eirikhaugstulen Oct 24, 2023
7bb1032
chore: change tests
eirikhaugstulen Oct 24, 2023
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
61 changes: 50 additions & 11 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2023-09-04T07:07:59.195Z\n"
"PO-Revision-Date: 2023-09-04T07:07:59.195Z\n"
"POT-Creation-Date: 2023-09-12T06:24:49.265Z\n"
"PO-Revision-Date: 2023-09-12T06:24:49.265Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -935,6 +935,18 @@ msgstr "Event could not be loaded"
msgid "Organisation unit could not be loaded"
msgstr "Organisation unit could not be loaded"

msgid "Selected program"
msgstr "Selected program"

msgid "Search {{uniqueAttrName}}"
msgstr "Search {{uniqueAttrName}}"

msgid "Search by attributes"
msgstr "Search by attributes"

msgid "Could not retrieve metadata. Please try again later."
msgstr "Could not retrieve metadata. Please try again later."

msgid "Possible duplicates found"
msgstr "Possible duplicates found"

Expand Down Expand Up @@ -998,9 +1010,6 @@ msgstr "Search {{name}}"
msgid "Search by {{name}}"
msgstr "Search by {{name}}"

msgid "Search by attributes"
msgstr "Search by attributes"

msgid "all programs"
msgstr "all programs"

Expand Down Expand Up @@ -1058,12 +1067,6 @@ msgstr "Missing search criteria"
msgid "Results found"
msgstr "Results found"

msgid "Selected program"
msgstr "Selected program"

msgid "Search {{uniqueAttrName}}"
msgstr "Search {{uniqueAttrName}}"

msgid "Saved lists in this program"
msgstr "Saved lists in this program"

Expand Down Expand Up @@ -1347,6 +1350,42 @@ msgstr "{{ scheduledEvents }} scheduled"
msgid "Stages and Events"
msgstr "Stages and Events"

msgid "New TEI Relationship"
msgstr "New TEI Relationship"

msgid "Missing implementation step"
msgstr "Missing implementation step"

msgid "Go back without saving relationship"
msgstr "Go back without saving relationship"

msgid "New Relationship"
msgstr "New Relationship"

msgid "Link to an existing {{tetName}}"
msgstr "Link to an existing {{tetName}}"

msgid "An error occurred while adding the relationship"
msgstr "An error occurred while adding the relationship"

msgid "Something went wrong while loading relationships. Please try again later."
msgstr "Something went wrong while loading relationships. Please try again later."

msgid "{{trackedEntityTypeName}} relationships"
msgstr "{{trackedEntityTypeName}} relationships"

msgid "To open this relationship, please wait until saving is complete"
msgstr "To open this relationship, please wait until saving is complete"

msgid "Type"
msgstr "Type"

msgid "Created date"
msgstr "Created date"

msgid "Program stage name"
msgstr "Program stage name"

msgid "Working list could not be loaded"
msgstr "Working list could not be loaded"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "capture-app",
"homepage": ".",
"version": "100.39.0",
"cacheVersion": "5",
"cacheVersion": "6",
"serverVersion": "38",
"license": "BSD-3-Clause",
"private": true,
Expand Down
26 changes: 15 additions & 11 deletions src/components/App/AppPages.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ import { EnrollmentPage } from 'capture-core/components/Pages/Enrollment';
import { StageEventListPage } from 'capture-core/components/Pages/StageEvent';
import { EnrollmentEditEventPage } from 'capture-core/components/Pages/EnrollmentEditEvent';
import { EnrollmentAddEventPage } from 'capture-core/components/Pages/EnrollmentAddEvent';
import { ReactQueryDevtools } from 'react-query/devtools';

export const AppPages = () => (
<Switch>
<Route path="/viewEvent" component={ViewEventPage} />
<Route path="/search" component={SearchPage} />
<Route path="/new" component={NewPage} />
<Route path="/enrollment/stageEvents" component={StageEventListPage} />
<Route path="/enrollmentEventEdit" component={EnrollmentEditEventPage} />
<Route path="/enrollmentEventNew" component={EnrollmentAddEventPage} />
<Route path="/enrollment" component={EnrollmentPage} />
<Route path="/:keys" component={MainPage} />
<Route path="/" component={MainPage} />
</Switch>
<>
<ReactQueryDevtools />
<Switch>
<Route path="/viewEvent" component={ViewEventPage} />
<Route path="/search" component={SearchPage} />
<Route path="/new" component={NewPage} />
<Route path="/enrollment/stageEvents" component={StageEventListPage} />
<Route path="/enrollmentEventEdit" component={EnrollmentEditEventPage} />
<Route path="/enrollmentEventNew" component={EnrollmentAddEventPage} />
<Route path="/enrollment" component={EnrollmentPage} />
<Route path="/:keys" component={MainPage} />
<Route path="/" component={MainPage} />
</Switch>
</>
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useSelector } from 'react-redux';
import { EnrollmentRegistrationEntryComponent } from './EnrollmentRegistrationEntry.component';
import type { OwnProps } from './EnrollmentRegistrationEntry.types';
import { useLifecycle } from './hooks';
import { useCurrentOrgUnitInfo } from '../../../hooks/useCurrentOrgUnitInfo';
import { useRulesEngineOrgUnit } from '../../../hooks';
import { dataEntryHasChanges } from '../../DataEntry/common/dataEntryHasChanges';
import { useMetadataForRegistrationForm } from '../common/TEIAndEnrollment/useMetadataForRegistrationForm';
Expand All @@ -15,11 +14,12 @@ export const EnrollmentRegistrationEntry: ComponentType<OwnProps> = ({
id,
saveButtonText,
trackedEntityInstanceAttributes,
orgUnitId,
teiId,
...passOnProps
}) => {
const orgUnitId = useCurrentOrgUnitInfo().id;
const { orgUnit, error } = useRulesEngineOrgUnit(orgUnitId);
const { teiId, ready, skipDuplicateCheck } = useLifecycle(selectedScopeId, id, trackedEntityInstanceAttributes, orgUnit);
const { ready, skipDuplicateCheck } = useLifecycle(selectedScopeId, id, trackedEntityInstanceAttributes, orgUnit, teiId);
const {
formId,
registrationMetaData: enrollmentMetadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { RenderFoundation } from '../../../metaData';

export type OwnProps = $ReadOnly<{|
id: string,
orgUnitId: string,
selectedScopeId: string,
fieldOptions?: Object,
onSave: SaveForDuplicateCheck,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export const useLifecycle = (
dataEntryId: string,
trackedEntityInstanceAttributes?: Array<InputAttribute>,
orgUnit: ?OrgUnit,
teiId: ?string,
) => {
const { teiId, programId } = useLocationQuery();
const { programId } = useLocationQuery();
const dataEntryReadyRef = useRef(false);
const dispatch = useDispatch();
const program = programId && getProgramThrowIfNotFound(programId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useDispatch, useSelector } from 'react-redux';
import React, { useEffect, useMemo } from 'react';
import type { ComponentType } from 'react';
import { useScopeInfo } from '../../../hooks/useScopeInfo';
import { useCurrentOrgUnitInfo } from '../../../hooks/useCurrentOrgUnitInfo';
import { Enrollment, scopeTypes } from '../../../metaData';
import { startNewTeiDataEntryInitialisation } from './TeiRegistrationEntry.actions';
import type { OwnProps } from './TeiRegistrationEntry.types';
Expand All @@ -12,10 +11,9 @@ import { useFormValuesFromSearchTerms } from './hooks/useFormValuesFromSearchTer
import { dataEntryHasChanges } from '../../DataEntry/common/dataEntryHasChanges';
import { useMetadataForRegistrationForm } from '../common/TEIAndEnrollment/useMetadataForRegistrationForm';

const useInitialiseTeiRegistration = (selectedScopeId, dataEntryId) => {
const useInitialiseTeiRegistration = (selectedScopeId, dataEntryId, orgUnitId) => {
const dispatch = useDispatch();
const { scopeType, trackedEntityName } = useScopeInfo(selectedScopeId);
const { id: selectedOrgUnitId } = useCurrentOrgUnitInfo();
const { formId, formFoundation } = useMetadataForRegistrationForm({ selectedScopeId });
const formValues = useFormValuesFromSearchTerms();
const registrationFormReady = !!formId;
Expand All @@ -24,18 +22,18 @@ const useInitialiseTeiRegistration = (selectedScopeId, dataEntryId) => {
if (registrationFormReady && scopeType === scopeTypes.TRACKED_ENTITY_TYPE) {
dispatch(
startNewTeiDataEntryInitialisation(
{ selectedOrgUnitId, selectedScopeId, dataEntryId, formFoundation, formValues },
{ selectedOrgUnitId: orgUnitId, selectedScopeId, dataEntryId, formFoundation, formValues },
));
}
}, [
scopeType,
dataEntryId,
selectedScopeId,
selectedOrgUnitId,
registrationFormReady,
formFoundation,
formValues,
dispatch,
orgUnitId,
]);

return {
Expand All @@ -44,8 +42,8 @@ const useInitialiseTeiRegistration = (selectedScopeId, dataEntryId) => {
};


export const TeiRegistrationEntry: ComponentType<OwnProps> = ({ selectedScopeId, id, ...rest }) => {
const { trackedEntityName } = useInitialiseTeiRegistration(selectedScopeId, id);
export const TeiRegistrationEntry: ComponentType<OwnProps> = ({ selectedScopeId, id, orgUnitId, ...rest }) => {
const { trackedEntityName } = useInitialiseTeiRegistration(selectedScopeId, id, orgUnitId);
const ready = useSelector(({ dataEntries }) => (!!dataEntries[id]));
const dataEntry = useSelector(({ dataEntries }) => (dataEntries[id]));
const {
Expand All @@ -71,6 +69,7 @@ export const TeiRegistrationEntry: ComponentType<OwnProps> = ({ selectedScopeId,
return (
<TeiRegistrationEntryComponent
id={id}
orgUnitId={orgUnitId}
teiRegistrationMetadata={teiRegistrationMetadata}
selectedScopeId={teiRegistrationMetadata.form?.id}
ready={ready && !!teiRegistrationMetadata}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { ExistingUniqueValueDialogActionsComponent } from '../withErrorMess

export type OwnProps = $ReadOnly<{|
id: string,
orgUnitId: string,
selectedScopeId: string,
saveButtonText: string,
fieldOptions?: Object,
Expand All @@ -19,6 +20,7 @@ export type OwnProps = $ReadOnly<{|
|}>;

type ContainerProps = {|
orgUnitId: string,
teiRegistrationMetadata: RegistrationFormMetadata,
ready: boolean,
trackedEntityName: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const useEnrollmentFormFoundation = ({
locale,
}: Props) => {
const { data: enrollment, isLoading, error } = useIndexedDBQuery(
// $FlowFixMe - QueryKey can be undefined
['enrollmentForm', program?.id],
() => buildEnrollmentForm({
// $FlowFixMe - Flow does not understand that the values are not null here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const useTrackedEntityTypeCollection = ({
locale,
}: Props): ReturnValues => {
const { data: trackedEntityAttributes } = useIndexedDBQuery(
// $FlowFixMe - QueryKey can be undefined
['trackedEntityAttributes', trackedEntityType?.id],
() => getTrackedEntityAttributes(
trackedEntityType
Expand All @@ -40,6 +41,7 @@ export const useTrackedEntityTypeCollection = ({
);

const { data: trackedEntityTypeCollection } = useIndexedDBQuery(
// $FlowFixMe - QueryKey can be undefined
['trackedEntityTypeCollection', trackedEntityType?.id],
() => buildTrackedEntityTypeCollection({
// $FlowFixMe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,4 @@ export const openEnrollmentPageEpic = (action$: InputObservable, store: ReduxSto
},
),
);

Loading
Loading