Skip to content

Commit

Permalink
fix: merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Feb 9, 2024
2 parents dabb120 + f8d52c2 commit 9f4bc87
Show file tree
Hide file tree
Showing 64 changed files with 1,303 additions and 622 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [100.55.0](https://github.com/dhis2/capture-app/compare/v100.54.0...v100.55.0) (2024-02-05)


### Features

* [DHIS2-16305] Enrollment Overview Plugins ([#3515](https://github.com/dhis2/capture-app/issues/3515)) ([8e06dbc](https://github.com/dhis2/capture-app/commit/8e06dbcb54bdb9b308b9f01427b4139a9a00c977))

# [100.54.0](https://github.com/dhis2/capture-app/compare/v100.53.1...v100.54.0) (2024-02-04)


### Features

* [DHIS2-16262] Support Custom Layout for Enrollment Pages ([#3481](https://github.com/dhis2/capture-app/issues/3481)) ([9cc3d70](https://github.com/dhis2/capture-app/commit/9cc3d707f855bba0971a144f1371765afedda55f))

## [100.53.1](https://github.com/dhis2/capture-app/compare/v100.53.0...v100.53.1) (2024-02-01)


Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ScopeSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ And('you see the enrollment event Edit page but there is no org unit id in the u

And('you see the enrollment event New page but there is no org unit id in the url', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollmentEventNew?enrollmentId=gPDueU02tn8&programId=IpHINAT79UW&stageId=A03MvHHogjR&teiId=fhFQhO0xILJ`);
cy.contains('Enrollment: New Event');
cy.contains('Choose a registering unit to start reporting');
});

And('you see the enrollment event New page but there is no stage id in the url', () => {
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/SearchPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ Given('you are in the search page with the TB program being preselected from the

When('you fill in the zip code range numbers', () => {
cy.get('[data-test="form-attributes"]')
.find('[data-test="capture-ui-input"]')
.eq(5)
.find('input[description="Zip code"]')
.eq(0)
.type('7130')
.blur();
cy.get('[data-test="form-attributes"]')
.find('[data-test="capture-ui-input"]')
.eq(6)
.find('input[description="Zip code"]')
.eq(1)
.type('7135')
.blur();
});
Expand Down
9 changes: 4 additions & 5 deletions cypress/e2e/SearchThroughAddRelationship/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@ And('you fill in the the form with values that will return exactly 5 results', (

When('you fill in the zip code range numbers', () => {
cy.get('[data-test="d2-form-area"]')
.find('[data-test="capture-ui-input"]')
.eq(5)
.find('input[description="Zip code"]')
.eq(0)
.type('7130')
.blur();

cy.get('[data-test="d2-form-area"]')
.find('[data-test="capture-ui-input"]')
.eq(6)
.find('input[description="Zip code"]')
.eq(1)
.type('7135')
.blur();
});
Expand Down
56 changes: 22 additions & 34 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: 2024-01-27T19:47:16.278Z\n"
"PO-Revision-Date: 2024-01-27T19:47:16.278Z\n"
"POT-Creation-Date: 2024-02-07T10:43:51.606Z\n"
"PO-Revision-Date: 2024-02-07T10:43:51.606Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -668,15 +668,6 @@ msgstr "There is an error while opening this enrollment. Please enter a valid ur
msgid "An error occurred while fetching enrollments. Please enter a valid url."
msgstr "An error occurred while fetching enrollments. Please enter a valid url."

msgid "Enrollment Dashboard"
msgstr "Enrollment Dashboard"

msgid "No indicator output for this enrollment yet"
msgstr "No indicator output for this enrollment yet"

msgid "No feedback for this enrollment yet"
msgstr "No feedback for this enrollment yet"

msgid "Quick actions"
msgstr "Quick actions"

Expand Down Expand Up @@ -757,21 +748,12 @@ msgstr "Org unit is not valid with current program"
msgid "There was an error opening the Page"
msgstr "There was an error opening the Page"

msgid "Enrollment{{escape}} New Event"
msgstr "Enrollment{{escape}} New Event"

msgid "There was an error loading the page"
msgstr "There was an error loading the page"

msgid "Choose a registering unit to start reporting"
msgstr "Choose a registering unit to start reporting"

msgid "There is no feedback for this event"
msgstr "There is no feedback for this event"

msgid "There are no indicators for this event"
msgstr "There are no indicators for this event"

msgid "Program stage is invalid"
msgstr "Program stage is invalid"

Expand Down Expand Up @@ -799,18 +781,6 @@ msgstr "Program Stages could not be loaded"
msgid "Stage"
msgstr "Stage"

msgid "The enrollment event data could not be found"
msgstr "The enrollment event data could not be found"

msgid "There are no feedback for this event"
msgstr "There are no feedback for this event"

msgid "Enrollment{{escape}} View Event"
msgstr "Enrollment{{escape}} View Event"

msgid "Enrollment{{escape}} Edit Event"
msgstr "Enrollment{{escape}} Edit Event"

msgid "Registered events"
msgstr "Registered events"

Expand Down Expand Up @@ -935,6 +905,21 @@ msgstr "Event could not be loaded"
msgid "Organisation unit could not be loaded"
msgstr "Organisation unit could not be loaded"

msgid "Dashboard"
msgstr "Dashboard"

msgid "Edit Event"
msgstr "Edit Event"

msgid "View Event"
msgstr "View Event"

msgid "No feedback for this enrollment yet"
msgstr "No feedback for this enrollment yet"

msgid "No indicator output for this enrollment yet"
msgstr "No indicator output for this enrollment yet"

msgid "Selected program"
msgstr "Selected program"

Expand All @@ -947,6 +932,9 @@ msgstr "Search by attributes"
msgid "Could not retrieve metadata. Please try again later."
msgstr "Could not retrieve metadata. Please try again later."

msgid "The enrollment event data could not be found"
msgstr "The enrollment event data could not be found"

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

Expand Down Expand Up @@ -1386,8 +1374,8 @@ msgstr "{{ scheduledEvents }} scheduled"
msgid "Stages and Events"
msgstr "Stages and Events"

msgid "New TEI Relationship"
msgstr "New TEI Relationship"
msgid "New {{trackedEntityTypeName}} relationship"
msgstr "New {{trackedEntityTypeName}} relationship"

msgid "Missing implementation step"
msgstr "Missing implementation step"
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "capture-app",
"homepage": ".",
"version": "100.53.1",
"version": "100.55.0",
"cacheVersion": "7",
"serverVersion": "38",
"license": "BSD-3-Clause",
Expand All @@ -10,7 +10,7 @@
"packages/rules-engine"
],
"dependencies": {
"@dhis2/rules-engine-javascript": "100.53.1",
"@dhis2/rules-engine-javascript": "100.55.0",
"@dhis2/app-runtime": "^3.9.3",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/d2-icons": "^1.0.1",
Expand Down Expand Up @@ -73,14 +73,13 @@
"build": "yarn verifyCacheVersion && yarn workspaces run build && GENERATE_SOURCEMAP=false d2-app-scripts build && cp ./package.json ./build/app/package.json",
"build:standalone": "yarn workspaces run build && GENERATE_SOURCEMAP=false d2-app-scripts build --standalone",
"test": "yarn workspaces run build && d2-app-scripts test",
"test2": "react-scripts test",
"test:debug": "yarn workspaces run build && react-scripts --inspect-brk test --runInBand",
"jsdoc": "NODE_ENV=development jsdoc -c jsdoc-conf.json",
"linter:check": "yarn workspaces run linter:check && yarn workspaces run build && eslint -c .eslintrc . --quiet",
"flow:check": "./node_modules/.bin/flow check ./src",
"flow:addTypes": "flow-typed install",
"cy:open": "concurrently --kill-others \"yarn start:forCypress\" \"wait-on 'http-get://localhost:3000' && cypress open\"",
"cy:run": "concurrently --kill-others \"yarn start:forCypress\" \"wait-on 'http-get://localhost:3000' && cypress run\"",
"cy:open": "export NODE_OPTIONS=--openssl-legacy-provider && concurrently --kill-others \"yarn start:forCypress\" \"wait-on 'http-get://127.0.0.1:3000' && cypress open\"",
"cy:run": "export NODE_OPTIONS=--openssl-legacy-provider && concurrently --kill-others \"yarn start:forCypress\" \"wait-on 'http-get://127.0.0.1:3000' && cypress run\"",
"verifyCacheVersion": "node scripts/verifyCacheVersion.js",
"postinstall": "husky install && node scripts/createSymlinkToInternalPackages.mjs",
"i18n:add": "d2-app-scripts i18n extract && git add ./i18n/",
Expand All @@ -106,7 +105,7 @@
"babel-plugin-module-resolver": "^5.0.0",
"concurrently": "^7.0.0",
"cypress": "12",
"docdash": "^1.2.0",
"docdash": "^2.0.2",
"dotenv": "^16.0.3",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/rules-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/rules-engine-javascript",
"version": "100.53.1",
"version": "100.55.0",
"license": "BSD-3-Clause",
"main": "./build/cjs/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
// @flow

import { useDataEngine } from '@dhis2/app-runtime';
import { useQuery } from 'react-query';
import { useApiMetadataQuery } from '../../../../../../utils/reactQueryHelpers';

type Props = {|
selectedScopeId: string,
|}

const configQuery = {
dataEntryFormConfigQuery: {
resource: 'dataStore/capture/dataEntryForms',
},
resource: 'dataStore/capture/dataEntryForms',
};

export const useDataEntryFormConfig = ({ selectedScopeId }: Props) => {
const dataEngine = useDataEngine();


const { data: dataEntryFormConfig, isFetched: configIsFetched } = useQuery(
['dataEntryFormConfig'],
() => dataEngine.query(configQuery),
const { data: dataEntryFormConfig, isFetched: configIsFetched } = useApiMetadataQuery(
['dataEntryFormConfig', selectedScopeId],
configQuery,
{
enabled: !!selectedScopeId,
select: ({ dataEntryFormConfigQuery }) => dataEntryFormConfigQuery?.[selectedScopeId],
cacheTime: Infinity,
staleTime: Infinity,
select: dataEntryFormConfigQuery => dataEntryFormConfigQuery[selectedScopeId],
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import { EnrollmentPageDefault } from './EnrollmentPageDefault';
import { TopBar } from './TopBar.container';

const getStyles = ({ typography }) => ({
container: {
padding: '16px 24px 16px 24px',
},
loadingMask: {
height: '100vh',
},
Expand Down Expand Up @@ -43,7 +40,7 @@ const EnrollmentPagePlain = ({
enrollmentId={enrollmentId}
/>

<div data-test="enrollment-page-content" className={classes.container}>
<div data-test="enrollment-page-content">
{enrollmentPageStatus === enrollmentPageStatuses.MISSING_SELECTIONS && <MissingMessage />}

{enrollmentPageStatus === enrollmentPageStatuses.DEFAULT && <EnrollmentPageDefault />}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// @flow
import {
QuickActions,
StagesAndEvents,
EnrollmentComment,
DefaultWidgetsForEnrollmentOverview,
WidgetTypes,
} from '../../../common/EnrollmentOverviewDomain/EnrollmentPageLayout';
import type {
PageLayoutConfig,
WidgetConfig,
} from '../../../common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.types';

export const WidgetsForEnrollmentPageDefault: $ReadOnly<{ [key: string]: WidgetConfig }> = Object.freeze({
QuickActions,
StagesAndEvents,
EnrollmentComment,
...DefaultWidgetsForEnrollmentOverview,
});

export const DefaultPageLayout: PageLayoutConfig = Object.freeze({
leftColumn: [
{
type: WidgetTypes.COMPONENT,
name: 'QuickActions',
},
{
type: WidgetTypes.COMPONENT,
name: 'StagesAndEvents',
},
],
rightColumn: [
{
type: WidgetTypes.COMPONENT,
name: 'ErrorWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'WarningWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'EnrollmentComment',
},
{
type: WidgetTypes.COMPONENT,
name: 'FeedbackWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'IndicatorWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'TrackedEntityRelationship',
},
{
type: WidgetTypes.COMPONENT,
name: 'ProfileWidget',
settings: { readOnlyMode: false },
},
{
type: WidgetTypes.COMPONENT,
name: 'EnrollmentWidget',
settings: { readOnlyMode: false },
},
],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @flow
export { WidgetsForEnrollmentPageDefault, DefaultPageLayout } from './DefaultPageLayout.constants';
Loading

0 comments on commit 9f4bc87

Please sign in to comment.