From 1e0a3b49882510402c6335ad53519880e6053741 Mon Sep 17 00:00:00 2001 From: Pedro Sousa Date: Fri, 22 Mar 2024 14:59:50 +0000 Subject: [PATCH 1/7] Added start date to cohort payload --- src/add-group-modal/AddGroupModal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/add-group-modal/AddGroupModal.tsx b/src/add-group-modal/AddGroupModal.tsx index 5d917fc..c6b1005 100644 --- a/src/add-group-modal/AddGroupModal.tsx +++ b/src/add-group-modal/AddGroupModal.tsx @@ -206,10 +206,15 @@ const AddGroupModal = ({ const handleSubmit = () => { if (validate()) { + const startDate = new Date().toISOString(); post({ uuid: cohortUuid, name: name, - cohortMembers: patientList.map((p) => ({ patient: p.uuid })), + startDate: startDate, + cohortMembers: patientList.map((p) => ({ + patient: p.uuid, + startDate: startDate, + })), }); if (onPostSubmit) { onPostSubmit(); From 0443a9e144534e72c5c9e2cccfd489a7d9c601cb Mon Sep 17 00:00:00 2001 From: Jose Francisco <94977371+icrc-jofrancisco@users.noreply.github.com> Date: Mon, 25 Mar 2024 10:56:17 +0000 Subject: [PATCH 2/7] (fix) Inconsistent dates between session date and encounter date (#77) --- src/FormBootstrap.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FormBootstrap.tsx b/src/FormBootstrap.tsx index eedf776..5dcb102 100644 --- a/src/FormBootstrap.tsx +++ b/src/FormBootstrap.tsx @@ -164,7 +164,10 @@ const FormBootstrap = ({ handleEncounterCreate, handleOnValidate, showDiscardSubmitButtons: false, - preFilledQuestions: { ...activeSessionMeta }, + preFilledQuestions: { + ...activeSessionMeta, + encDate: activeSessionMeta.sessionDate, + }, }} /> )} From e9018739bd91168db2c0fd33eb3d9503f2917e9a Mon Sep 17 00:00:00 2001 From: Jose Francisco <94977371+icrc-jofrancisco@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:29:02 +0000 Subject: [PATCH 3/7] (feat) Add session and cohort identifiers for group sessions (#72) * (feat) Add session and cohort identifiers for group sessions) * (chore) session identifiers refactor --- src/config-schema.ts | 15 +++++++++++ src/context/GroupFormWorkflowContext.tsx | 4 +++ src/context/GroupFormWorkflowReducer.ts | 10 +++++++ .../GroupSessionWorkspace.tsx | 26 ++++++++++++++++--- 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/config-schema.ts b/src/config-schema.ts index 9ffbc38..d3473ac 100644 --- a/src/config-schema.ts +++ b/src/config-schema.ts @@ -81,6 +81,21 @@ export const configSchema = { _description: "UUID of concept for Session Notes", _default: "fa8fedc0-c066-4da3-8dc1-2ad8621fc480", }, + cohortId: { + _type: Type.UUID, + _description: "UUID of concept for cohort identifier", + _default: "5461f231-7e59-4be8-93a4-6d49fd13c00a", + }, + cohortName: { + _type: Type.UUID, + _description: "UUID of concept for cohort name", + _default: "6029f289-92a6-4a68-80f1-3078d0152449", + }, + sessionUuid: { + _type: Type.UUID, + _description: "UUID of concept for session identifier", + _default: "6a803908-8a5b-4598-adea-19358c83529a", + }, }, specificQuestions: { _type: Type.Array, diff --git a/src/context/GroupFormWorkflowContext.tsx b/src/context/GroupFormWorkflowContext.tsx index 3e97972..c3ca1ae 100644 --- a/src/context/GroupFormWorkflowContext.tsx +++ b/src/context/GroupFormWorkflowContext.tsx @@ -49,6 +49,7 @@ export const initialWorkflowState = { workflowState: null, // pseudo field from state[activeFormUuid].workflowState activePatientUuid: null, // pseudo field from state[activeFormUuid].activePatientUuid activeEncounterUuid: null, // pseudo field from state[activeFormUuid].activeEncounterUuid + activeSessionUuid: null, // pseudo field from state[activeFormUuid].activeSessionUuid activeVisitUuid: null, // pseudo field from state[activeFormUuid].activeVisitUuid patientUuids: [], // pseudo field from state[activeFormUuid].patientUuids encounters: {}, // pseudo field from state[activeFormUuid].encounters @@ -138,6 +139,9 @@ const GroupFormWorkflowProvider = ({ children }) => { workflowState: state.forms?.[state.activeFormUuid]?.workflowState ?? initialWorkflowState.workflowState, + activeSessionUuid: + state.forms?.[state.activeFormUuid]?.activeSessionUuid ?? + initialWorkflowState.activeSessionUuid, activePatientUuid: state.forms?.[state.activeFormUuid]?.activePatientUuid ?? initialWorkflowState.activePatientUuid, diff --git a/src/context/GroupFormWorkflowReducer.ts b/src/context/GroupFormWorkflowReducer.ts index e8b19aa..8b35cd2 100644 --- a/src/context/GroupFormWorkflowReducer.ts +++ b/src/context/GroupFormWorkflowReducer.ts @@ -1,5 +1,6 @@ import { navigate } from "@openmrs/esm-framework"; import { initialWorkflowState } from "./FormWorkflowContext"; +import { v4 as uuid } from "uuid"; export const fdeGroupWorkflowStorageVersion = "1.0.5"; export const fdeGroupWorkflowStorageName = @@ -19,6 +20,7 @@ const initialFormState = { activePatientUuid: null, activeEncounterUuid: null, activeVisitUuid: null, + activeSessionUuid: null, patientUuids: [], encounters: {}, visits: {}, @@ -45,6 +47,7 @@ const reducer = (state, action) => { thisSavedForm?.patientUuids?.[0] || // something probably went wrong... null; + const activeSessionUuid = thisSavedForm?.activeSessionUuid || uuid(); newState = { ...savedDataObject, // set current form to this one @@ -60,6 +63,7 @@ const reducer = (state, action) => { thisSavedForm?.encounters?.[activePatientUuid] || null, activeVisitUuid: thisSavedForm?.visits?.[activePatientUuid] || null, + activeSessionUuid: activeSessionUuid, }, }, }; @@ -102,6 +106,7 @@ const reducer = (state, action) => { activePatientUuid: null, activeEncounterUuid: null, activeVisitUuid: null, + activeSessionUuid: null, }, }, }; @@ -122,6 +127,7 @@ const reducer = (state, action) => { activePatientUuid: null, activeEncounterUuid: null, activeVisitUuid: null, + activeSessionUuid: null, }, }, }; @@ -147,6 +153,7 @@ const reducer = (state, action) => { state.forms[state.activeFormUuid].visits[ state.forms[state.activeFormUuid].patientUuids?.[0] ] || null, + activeSessionUuid: uuid(), workflowState: "EDIT_FORM", }, }, @@ -230,6 +237,7 @@ const reducer = (state, action) => { activePatientUuid: nextPatientUuid, activeEncounterUuid: thisForm.encounters[nextPatientUuid] || null, activeVisitUuid: thisForm.visits[nextPatientUuid] || null, + activeSessionUuid: thisForm.activeSessionUuid, workflowState: "EDIT_FORM", }, }, @@ -250,6 +258,7 @@ const reducer = (state, action) => { activeVisitUuid: state.forms[state.activeFormUuid].visits[action.patientUuid], activePatientUuid: action.patientUuid, + activeSessionUuid: action.activeSessionUuid, workflowState: "EDIT_FORM", }, }, @@ -393,6 +402,7 @@ const reducer = (state, action) => { activeEncounterUuid: null, activVisitUuid: null, activePatientUuid: null, + activeSessionUuid: null, workflowState: "REVIEW", }, }, diff --git a/src/group-form-entry-workflow/GroupSessionWorkspace.tsx b/src/group-form-entry-workflow/GroupSessionWorkspace.tsx index 3390e70..e4f4793 100644 --- a/src/group-form-entry-workflow/GroupSessionWorkspace.tsx +++ b/src/group-form-entry-workflow/GroupSessionWorkspace.tsx @@ -91,6 +91,9 @@ const GroupSessionWorkspace = () => { activeEncounterUuid, activeVisitUuid, activeFormUuid, + activeGroupUuid, + activeGroupName, + activeSessionUuid, saveEncounter, activeSessionMeta, groupVisitTypeUuid, @@ -125,11 +128,23 @@ const GroupSessionWorkspace = () => { const visitUuid = activeVisitUuid ? activeVisitUuid : uuid(); if (!activeVisitUuid) { Object.entries(groupSessionConcepts).forEach(([field, uuid]) => { - payload.obs.push({ - concept: uuid, - value: activeSessionMeta?.[field], - }); + if (activeSessionMeta?.[field] != null) { + payload.obs.push({ + concept: uuid, + value: activeSessionMeta[field], + }); + } }); + + const otherIdentifiers = [ + { concept: groupSessionConcepts.cohortId, value: activeGroupUuid }, + { concept: groupSessionConcepts.cohortName, value: activeGroupName }, + { + concept: groupSessionConcepts.sessionUuid, + value: activeSessionUuid, + }, + ]; + payload.obs.push(...otherIdentifiers); // If this is a newly created encounter and visit, add session concepts to encounter payload. const visitInfo = { startDatetime: activeSessionMeta.sessionDate, @@ -156,6 +171,9 @@ const GroupSessionWorkspace = () => { activeVisitUuid, sessionLocation?.uuid, groupSessionConcepts, + activeGroupUuid, + activeGroupName, + activeSessionUuid, activePatientUuid, groupVisitTypeUuid, updateVisitUuid, From 2d2a5ed4f5744d20043196f871731dbcb10b0db4 Mon Sep 17 00:00:00 2001 From: Thembo Jonathan Date: Tue, 26 Mar 2024 07:41:58 +0300 Subject: [PATCH 4/7] (chore) Migrate to newer transifex version (#68) * (chore)Migrate to newer transifex version * Add `resource_name` --------- Co-authored-by: Dennis Kigen --- .tx/config | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.tx/config b/.tx/config index 30513c0..3ec09a3 100644 --- a/.tx/config +++ b/.tx/config @@ -1,9 +1,12 @@ [main] host = https://www.transifex.com -[openmrs-esm-fast-data-entry-app.esm-fast-data-entry-app] -file_filter = translations/.json -minimum_perc = 0 -source_file = translations/en.json -source_lang = en -type = KEYVALUEJSON +[o:openmrs:p:openmrs-esm-fast-data-entry-app:r:esm-fast-data-entry-app] +file_filter = translations/.json +source_file = translations/en.json +source_lang = en +type = KEYVALUEJSON +minimum_perc = 0 +replace_edited_strings = false +keep_translations = false +resource_name = esm-fast-data-entry-app From 9393be24091fb02a3a828279f5da8217860d001a Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Wed, 27 Mar 2024 22:30:51 +0300 Subject: [PATCH 5/7] (chore) Bump dependencies and setup tooling (#64) --- .eslintrc | 76 + .eslintrc.js | 10 - .github/workflows/ci.yml | 8 +- .gitignore | 2 + .husky/pre-push | 3 +- package.json | 55 +- src/add-group-modal/styles.scss | 6 +- src/context/GroupFormWorkflowContext.tsx | 2 +- src/declarations.d.ts | 2 +- src/empty-state/styles.scss | 28 +- .../form-review-card/styles.scss | 20 +- .../patient-banner/styles.scss | 23 +- .../patient-search-header/styles.scss | 19 +- src/form-entry-workflow/styles.scss | 24 +- .../workflow-review/styles.scss | 4 - src/forms-page/FormsPage.tsx | 4 +- src/forms-page/forms-table/styles.scss | 9 +- src/forms-page/styles.scss | 8 +- .../GroupSessionWorkspace.tsx | 2 +- .../ConfigurableQuestionsSection.tsx | 4 +- .../group-display-header/styles.scss | 40 +- .../group-search-header/styles.scss | 16 +- .../group-search/CompactGroupSearch.tsx | 2 +- .../group-search/GroupSearch.tsx | 2 +- .../group-search/compact-group-result.scss | 33 +- .../group-search/compact-group-search.scss | 15 +- .../group-search/group-search.scss | 43 +- src/group-form-entry-workflow/styles.scss | 29 +- src/hooks/useForm.ts | 2 +- src/hooks/useSearchEndpoint.ts | 16 +- src/patient-card/styles.scss | 6 +- translations/am.json | 2 +- translations/en.json | 2 +- translations/he.json | 2 +- translations/km.json | 2 +- turbo.json | 18 + yarn.lock | 2373 +++++++++-------- 37 files changed, 1526 insertions(+), 1386 deletions(-) create mode 100644 .eslintrc delete mode 100644 .eslintrc.js create mode 100644 turbo.json diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..d5486b6 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,76 @@ +{ + "env": { + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "prettier" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": true, + "tsconfigRootDir": "__dirname" + }, + "plugins": ["@typescript-eslint"], + "root": true, + "rules": { + // turned off to keep the diff small for now + "@typescript-eslint/no-floating-promises": "off", + "@typescript-eslint/no-misused-promises": "off", + // The following rules need `noImplicitAny` to be set to `true` in our tsconfig. They are too restrictive for now, but should be reconsidered in future + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/unbound-method": "off", + // Nitpicky. Prefer `interface T` over type T + "@typescript-eslint/consistent-type-definitions": "off", + "@typescript-eslint/consistent-type-exports": "error", + // Use `import type` instead of `import` for type imports + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "fixStyle": "inline-type-imports" + } + ], + // Use Array instead of T[] consistently + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "no-console": ["error", { "allow": ["warn", "error"] }], + "no-restricted-imports": [ + "error", + { + "paths": [ + // These two rules ensure that we're importing lodash and lodash-es correctly. Not doing so can bloat our bundle size significantly. + { + "name": "lodash", + "message": "Import specific methods from `lodash`. e.g. `import map from 'lodash/map'`" + }, + { + "name": "lodash-es", + "importNames": ["default"], + "message": "Import specific methods from `lodash-es`. e.g. `import { map } from 'lodash-es'`" + }, + // These two rules ensure that we're importing Carbon components and icons from the correct packages (after v10). May be removed in the future. + { + "name": "carbon-components-react", + "message": "Import from `@carbon/react` directly. e.g. `import { Toggle } from '@carbon/react'`" + }, + { + "name": "@carbon/icons-react", + "message": "Import from `@carbon/react/icons`. e.g. `import { ChevronUp } from '@carbon/react/icons'`" + } + ] + } + ] + } +} diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 717be3b..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - "extends": [ - "eslint:recommended", - "ts-react-important-stuff", - "plugin:prettier/recommended", - 'react-app', - 'plugin:@typescript-eslint/recommended', - ], - "parser": "@typescript-eslint/parser", -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aaf3880..f0f0c99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Node.js CI +name: OpenMRS CI on: push: @@ -25,7 +25,7 @@ jobs: node-version: "18" - run: yarn install --immutable - run: yarn verify - - run: yarn build + - run: yarn turbo build - name: Upload Artifacts uses: actions/upload-artifact@v4 with: @@ -57,7 +57,7 @@ jobs: run: yarn install --immutable - run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" - - run: yarn build + - run: yarn turbo build - run: git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI" - run: git add . && git commit -m "Prerelease version" --no-verify - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --tag next @@ -102,6 +102,6 @@ jobs: with: node-version: "18" registry-url: 'https://registry.npmjs.org' - - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish + - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.gitignore b/.gitignore index d65a5aa..5cb9af9 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,5 @@ dist/ !.yarn/releases !.yarn/sdks !.yarn/versions + +.turbo diff --git a/.husky/pre-push b/.husky/pre-push index d008e86..879f05d 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -3,5 +3,4 @@ set -e # die on error -yarn run verify - +yarn verify diff --git a/package.json b/package.json index 033536e..b9c20f9 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,13 @@ "scripts": { "start": "openmrs develop", "serve": "webpack serve --mode=development", - "build": "webpack --mode production", + "build": "webpack --mode production --color", "analyze": "webpack --mode=production --env.analyze=true", - "lint": "eslint \"src/**/*.ts\" \"src/**/*.tsx\" --fix --max-warnings=0 -c .eslintrc.js", + "lint": "eslint \"src/**/*.ts\" \"src/**/*.tsx\" --fix --max-warnings=0", "prettier": "prettier --write \"src/**/*.{ts,tsx}\" --list-different", "typescript": "tsc", "test": "jest --config jest.config.json --passWithNoTests", - "verify": "concurrently 'yarn:lint' 'yarn:test' 'yarn:typescript'", + "verify": "turbo lint typescript test", "coverage": "yarn test -- --coverage ", "postinstall": "husky install", "extract-translations": "i18next 'src/**/*.tsx' --config ./tools/i18next-parser.config.js" @@ -49,46 +49,47 @@ "swr": "2.x" }, "devDependencies": { - "@carbon/react": "^1.9.0", + "@carbon/react": "^1.37.0", "@openmrs/esm-framework": "next", - "@swc-node/loader": "^1.3.5", - "@swc/core": "^1.2.245", - "@swc/jest": "^0.2.22", - "@testing-library/dom": "^7.20.0", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^13.3.0", + "@swc-node/loader": "^1.3.7", + "@swc/core": "^1.3.84", + "@swc/jest": "^0.2.29", + "@testing-library/dom": "^7.31.2", + "@testing-library/jest-dom": "^5.17.0", + "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.4.3", - "@types/jest": "^28.1.7", - "@types/react-dom": "^18.0.6", + "@types/jest": "^28.1.8", + "@types/react-dom": "^18.2.7", "@types/react-router-dom": "^5.3.3", - "@types/testing-library__jest-dom": "^5.14.5", - "@types/webpack-env": "^1.16.0", - "@typescript-eslint/parser": "^5.14.0", - "concurrently": "^6.2.0", + "@types/testing-library__jest-dom": "^5.14.9", + "@types/webpack-env": "^1.18.1", + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "concurrently": "^6.5.1", "css-loader": "^6.8.1", - "eslint": "^8.20.0", - "eslint-config-prettier": "^8.3.0", + "eslint": "^8.49.0", + "eslint-config-prettier": "^8.10.0", "eslint-config-react-app": "^7.0.1", - "eslint-config-ts-react-important-stuff": "^3.0.0", "eslint-plugin-prettier": "^4.2.1", - "husky": "^8.0.1", + "husky": "^8.0.3", "identity-obj-proxy": "^3.0.0", "jest": "^28.1.3", "jest-cli": "^28.1.3", "jest-environment-jsdom": "^28.1.3", "lodash-es": "^4.17.21", "openmrs": "next", - "prettier": "^2.3.0", - "pretty-quick": "^3.1.0", + "prettier": "^2.8.8", + "pretty-quick": "^3.1.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-i18next": "^11.18.4", - "react-router-dom": "^6.3.0", - "semver": "^7.3.7", + "react-i18next": "^11.18.6", + "react-router-dom": "^6.15.0", + "semver": "^7.5.4", "swc-loader": "^0.2.3", "swr": "^2.2.4", - "typescript": "^4.7.3", - "webpack": "^5.73.0", + "turbo": "^1.10.13", + "typescript": "^4.9.5", + "webpack": "^5.88.2", "webpack-cli": "^5.1.4" }, "dependencies": { diff --git a/src/add-group-modal/styles.scss b/src/add-group-modal/styles.scss index 900c3c9..0557f11 100644 --- a/src/add-group-modal/styles.scss +++ b/src/add-group-modal/styles.scss @@ -1,5 +1,5 @@ -@use '@carbon/styles/scss/spacing'; @use '@carbon/colors'; +@use '@carbon/layout'; .modal { :global(.cds--modal) { @@ -36,7 +36,7 @@ .patientName { flex-grow: 1; - padding-left: spacing.$spacing-05; + padding-left: layout.$spacing-05; } .loading { @@ -45,5 +45,5 @@ flex-direction: column; justify-content: center; align-items: center; - row-gap: spacing.$spacing-05; + row-gap: layout.$spacing-05; } diff --git a/src/context/GroupFormWorkflowContext.tsx b/src/context/GroupFormWorkflowContext.tsx index c3ca1ae..9c4c5d3 100644 --- a/src/context/GroupFormWorkflowContext.tsx +++ b/src/context/GroupFormWorkflowContext.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo, useReducer } from "react"; import reducer from "./GroupFormWorkflowReducer"; import { useParams } from "react-router-dom"; -import { Type, useSession } from "@openmrs/esm-framework"; +import { type Type, useSession } from "@openmrs/esm-framework"; import useGetSystemSetting from "../hooks/useGetSystemSetting"; interface ParamTypes { formUuid?: string; diff --git a/src/declarations.d.ts b/src/declarations.d.ts index bea7fc2..21b9066 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -1,4 +1,4 @@ +declare module "@carbon/react"; declare module "*.css"; declare module "*.scss"; -declare module "@carbon/react"; declare type SideNavProps = object; diff --git a/src/empty-state/styles.scss b/src/empty-state/styles.scss index aeec75a..9c5d549 100644 --- a/src/empty-state/styles.scss +++ b/src/empty-state/styles.scss @@ -1,36 +1,36 @@ -@import "~@openmrs/esm-styleguide/src/vars"; -@import "~carbon-components/src/globals/scss/vars"; -@import "~carbon-components/src/globals/scss/mixins"; +@use '@carbon/colors'; +@use '@carbon/layout'; +@use '@carbon/type'; .action { - margin-bottom: $spacing-03; + margin-bottom: layout.$spacing-03; } .content { - @include carbon--type-style("productive-heading-01"); - color: $text-02; - margin-top: $spacing-05; - margin-bottom: $spacing-03; + @include type.type-style("heading-compact-01"); + color: colors.$gray-70; + margin-top: layout.$spacing-05; + margin-bottom: layout.$spacing-03; } .desktopHeading { h4 { - @include carbon--type-style('productive-heading-02'); - color: $text-02; + @include type.type-style('heading-compact-02'); + color: colors.$gray-70; } } .tabletHeading { h4 { - @include carbon--type-style('productive-heading-03'); - color: $text-02; + @include type.type-style('heading-03'); + color: colors.$gray-70; } } .desktopHeading, .tabletHeading { text-align: left; text-transform: capitalize; - margin-bottom: $spacing-05; + margin-bottom: layout.$spacing-05; h4:after { content: ""; @@ -51,5 +51,5 @@ .tile { text-align: center; - border: 1px solid $ui-03; + border: 1px solid colors.$gray-20; } diff --git a/src/form-entry-workflow/form-review-card/styles.scss b/src/form-entry-workflow/form-review-card/styles.scss index 07569a1..44efddc 100644 --- a/src/form-entry-workflow/form-review-card/styles.scss +++ b/src/form-entry-workflow/form-review-card/styles.scss @@ -1,12 +1,10 @@ -@use '@carbon/styles/scss/spacing'; -// @use '@carbon/colors'; -@use '@carbon/styles/scss/type'; -@import '~@openmrs/esm-styleguide/src/vars'; - +@use '@carbon/colors'; +@use '@carbon/layout'; +@use '@carbon/type'; .formReviewCard { - background-color: $ui-02; - padding: spacing.$spacing-02; + background-color: colors.$white-0; + padding: layout.$spacing-02; } .formReviewCard :global(.cds--accordion) :global(.cds--accordion__item) { @@ -16,17 +14,17 @@ .formReviewCard :global(.cds--accordion__title) { display: flex; align-items: baseline; - column-gap: spacing.$spacing-05; + column-gap: layout.$spacing-05; } .formReviewCard :global(.cds--accordion__content) { - padding: spacing.$spacing-03; + padding: layout.$spacing-03; } .dataField { @include type.type-style('code-02'); - background-color: $ui-01; - padding: spacing.$spacing-03; + background-color: colors.$gray-10; + padding: layout.$spacing-03; } .displayName { diff --git a/src/form-entry-workflow/patient-banner/styles.scss b/src/form-entry-workflow/patient-banner/styles.scss index 683bd03..5ed544d 100644 --- a/src/form-entry-workflow/patient-banner/styles.scss +++ b/src/form-entry-workflow/patient-banner/styles.scss @@ -1,16 +1,15 @@ -@use '@carbon/styles/scss/spacing'; -// @use '@carbon/colors'; -@use '@carbon/styles/scss/type'; -@import '~@openmrs/esm-styleguide/src/vars'; +@use '@carbon/colors'; +@use '@carbon/layout'; +@use '@carbon/type'; .container { - height: spacing.$spacing-11; + height: layout.$spacing-11; display: flex; align-items: center; - background-color: $ui-02; - border-top: 0.0125rem solid $ui-03; - border-bottom: 0.0125rem solid $ui-03; - padding: 0 spacing.$spacing-05; + background-color: colors.$white-0; + border-top: 0.0125rem solid colors.$gray-20; + border-bottom: 0.0125rem solid colors.$gray-20; + padding: 0 layout.$spacing-05; } .photoPlaceholder { @@ -35,11 +34,11 @@ min-height: 2rem; } @include type.type-style('body-compact-02'); - color: $text-02; + color: colors.$gray-70; column-gap: 0.8rem; } .patientEditBtn { - color: $ui-05; - margin: spacing.$spacing-03; + color: colors.$gray-100; + margin: layout.$spacing-03; } diff --git a/src/form-entry-workflow/patient-search-header/styles.scss b/src/form-entry-workflow/patient-search-header/styles.scss index 9df1ba3..98d4176 100644 --- a/src/form-entry-workflow/patient-search-header/styles.scss +++ b/src/form-entry-workflow/patient-search-header/styles.scss @@ -1,16 +1,15 @@ -@use '@carbon/styles/scss/spacing'; -// @use '@carbon/colors'; -// @use '@carbon/styles/scss/type'; -@import '~@openmrs/esm-styleguide/src/vars'; +@use '@carbon/colors'; +@use '@carbon/layout'; +@use '@carbon/type'; .searchHeaderContainer { - height: spacing.$spacing-11; + height: layout.$spacing-11; display: flex; align-items: center; - background-color: $ui-02; - border-top: 0.0125rem solid $ui-03; - border-bottom: 0.0125rem solid $ui-03; - padding: 0 spacing.$spacing-05; + background-color: colors.$white-0; + border-top: 0.0125rem solid colors.$gray-20; + border-bottom: 0.0125rem solid colors.$gray-20; + padding: 0 layout.$spacing-05; } .searchBarWrapper { @@ -22,5 +21,5 @@ } .padded { - padding: spacing.$spacing-05; + padding: layout.$spacing-05; } diff --git a/src/form-entry-workflow/styles.scss b/src/form-entry-workflow/styles.scss index 504957d..40a6387 100644 --- a/src/form-entry-workflow/styles.scss +++ b/src/form-entry-workflow/styles.scss @@ -1,13 +1,11 @@ -@use '@carbon/styles/scss/spacing'; @use '@carbon/colors'; -@use '@carbon/styles/scss/type'; -@import '~@openmrs/esm-styleguide/src/vars'; - +@use '@carbon/layout'; +@use '@carbon/type'; .breadcrumbsContainer > div > div > nav { - background-color: $ui-02; - padding: spacing.$spacing-04 spacing.$spacing-05; - height: spacing.$spacing-08; + background-color: colors.$white-0; + padding: layout.$spacing-04 layout.$spacing-05; + height: layout.$spacing-08; } .workspaceWrapper { @@ -20,16 +18,16 @@ } .selectPatientMessage { - @include type.type-style('productive-heading-03'); - margin: spacing.$spacing-07; + @include type.type-style('heading-03'); + margin: layout.$spacing-07; text-align: center; } .formMainContent { display: flex; text-align: center; - margin-top: spacing.$spacing-05; - column-gap: spacing.$spacing-05; + margin-top: layout.$spacing-05; + column-gap: layout.$spacing-05; } .formContainer { @@ -50,14 +48,14 @@ } .patientCardsSection { - margin: spacing.$spacing-05 0; + margin: layout.$spacing-05 0; border-bottom: 1px solid colors.$gray-10; } .rightPanelActionButtons { display: flex; flex-direction: column; - row-gap: spacing.$spacing-03; + row-gap: layout.$spacing-03; & button { width: 100%; text-decoration: "none"; diff --git a/src/form-entry-workflow/workflow-review/styles.scss b/src/form-entry-workflow/workflow-review/styles.scss index 9e2407c..73242ad 100644 --- a/src/form-entry-workflow/workflow-review/styles.scss +++ b/src/form-entry-workflow/workflow-review/styles.scss @@ -1,7 +1,3 @@ -@import "~@openmrs/esm-styleguide/src/vars"; -@import "~carbon-components/src/globals/scss/vars"; -@import "~carbon-components/src/globals/scss/mixins"; - .workspaceWrapper { display: flex; justify-content: center; diff --git a/src/forms-page/FormsPage.tsx b/src/forms-page/FormsPage.tsx index 762fb0b..cb04d5e 100644 --- a/src/forms-page/FormsPage.tsx +++ b/src/forms-page/FormsPage.tsx @@ -1,7 +1,7 @@ import { useConfig, useSession } from "@openmrs/esm-framework"; import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@carbon/react"; import React from "react"; -import { Config } from "../config-schema"; +import { type Config } from "../config-schema"; import { useGetAllForms } from "../hooks"; import FormsTable from "./forms-table"; import styles from "./styles.scss"; @@ -44,7 +44,7 @@ const prepareRowsForTable = (rawFormData) => { }; const FormsPage = () => { - const config = useConfig() as Config; + const config = useConfig(); const { t } = useTranslation(); const { formCategories, formCategoriesToShow } = config; const { forms, isLoading, error } = useGetAllForms(); diff --git a/src/forms-page/forms-table/styles.scss b/src/forms-page/forms-table/styles.scss index 09cf51f..a6fc206 100644 --- a/src/forms-page/forms-table/styles.scss +++ b/src/forms-page/forms-table/styles.scss @@ -1,11 +1,10 @@ -@import "~@openmrs/esm-styleguide/src/vars"; -@import "~carbon-components/src/globals/scss/vars"; -@import "~carbon-components/src/globals/scss/mixins"; +@use '@carbon/colors'; +@use '@carbon/layout'; .toolbarWrapper { position: relative; display: flex; - height: $spacing-09; + height: layout.$spacing-09; justify-content: flex-end; } @@ -15,6 +14,6 @@ } .inactiveLink { - color: $carbon--gray-40; + color: colors.$gray-40; cursor: not-allowed; } diff --git a/src/forms-page/styles.scss b/src/forms-page/styles.scss index 96b5e3e..566d034 100644 --- a/src/forms-page/styles.scss +++ b/src/forms-page/styles.scss @@ -1,11 +1,9 @@ -@use '@carbon/styles/scss/spacing'; -// @use '@carbon/styles/scss/type'; -// @import '~@openmrs/esm-styleguide/src/vars'; +@use '@carbon/layout'; .mainContent { - padding: spacing.$spacing-07; + padding: layout.$spacing-07; } .pageTitle { - margin-bottom: spacing.$spacing-06; + margin-bottom: layout.$spacing-06; } diff --git a/src/group-form-entry-workflow/GroupSessionWorkspace.tsx b/src/group-form-entry-workflow/GroupSessionWorkspace.tsx index e4f4793..30b743f 100644 --- a/src/group-form-entry-workflow/GroupSessionWorkspace.tsx +++ b/src/group-form-entry-workflow/GroupSessionWorkspace.tsx @@ -57,7 +57,7 @@ const WorkflowNavigationButtons = () => { > {isLastPatient ? t("saveForm", "Save Form") - : t("nextPatient", "Next Patient")} + : t("nextPatient", "Next patient")}