@openmrs/esm-fast-data-entry-app 1.0.0-pre.50 → 1.0.0-pre.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ "extends": [
3
+ "eslint:recommended",
4
+ "ts-react-important-stuff",
5
+ "plugin:prettier/recommended",
6
+ 'react-app',
7
+ 'plugin:@typescript-eslint/recommended',
8
+ ],
9
+ "parser": "@typescript-eslint/parser",
10
+ }
@@ -0,0 +1 @@
1
+ yarn verify
@@ -5,9 +5,9 @@
5
5
  "initial": false,
6
6
  "entry": false,
7
7
  "recorded": false,
8
- "size": 93704,
8
+ "size": 94054,
9
9
  "sizes": {
10
- "javascript": 93704
10
+ "javascript": 94054
11
11
  },
12
12
  "names": [],
13
13
  "idHints": [],
@@ -18,7 +18,7 @@
18
18
  "61.js"
19
19
  ],
20
20
  "auxiliaryFiles": [],
21
- "hash": "34793f4c5b80e9bbd78b",
21
+ "hash": "6d75057e80778c7da82c",
22
22
  "childrenByOrder": {}
23
23
  },
24
24
  {
@@ -275,9 +275,9 @@
275
275
  "initial": false,
276
276
  "entry": false,
277
277
  "recorded": false,
278
- "size": 364,
278
+ "size": 397,
279
279
  "sizes": {
280
- "javascript": 364
280
+ "javascript": 397
281
281
  },
282
282
  "names": [],
283
283
  "idHints": [],
@@ -288,7 +288,7 @@
288
288
  "776.js"
289
289
  ],
290
290
  "auxiliaryFiles": [],
291
- "hash": "6e66cb877869f3408d72",
291
+ "hash": "272eaf44225e70b8c5af",
292
292
  "childrenByOrder": {}
293
293
  },
294
294
  {
@@ -366,9 +366,9 @@
366
366
  "initial": false,
367
367
  "entry": false,
368
368
  "recorded": false,
369
- "size": 44076,
369
+ "size": 44083,
370
370
  "sizes": {
371
- "javascript": 44034,
371
+ "javascript": 44041,
372
372
  "consume-shared": 42
373
373
  },
374
374
  "names": [],
@@ -380,7 +380,7 @@
380
380
  "990.js"
381
381
  ],
382
382
  "auxiliaryFiles": [],
383
- "hash": "70a1838bac7961d64f3f",
383
+ "hash": "9693925128d586be8781",
384
384
  "childrenByOrder": {}
385
385
  }
386
386
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-fast-data-entry-app",
3
- "version": "1.0.0-pre.50",
3
+ "version": "1.0.0-pre.51",
4
4
  "license": "MPL-2.0",
5
5
  "description": "An OpenMRS 3.x microfrontend",
6
6
  "browser": "dist/openmrs-esm-fast-data-entry-app.js",
@@ -11,7 +11,7 @@
11
11
  "serve": "webpack serve --mode=development",
12
12
  "build": "webpack --mode production",
13
13
  "analyze": "webpack --mode=production --env.analyze=true",
14
- "lint": "eslint src --ext js,jsx,ts,tsx",
14
+ "lint": "eslint \"src/**/*.ts\" \"src/**/*.tsx\" --fix --max-warnings=0 -c .eslintrc.js",
15
15
  "prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
16
16
  "typescript": "tsc",
17
17
  "test": "jest --config jest.config.json --passWithNoTests",
@@ -80,10 +80,11 @@
80
80
  "babel-jest": "^27.0.2",
81
81
  "babel-preset-minify": "^0.5.1",
82
82
  "concurrently": "^6.2.0",
83
- "eslint": "^7.27.0",
83
+ "eslint": "^8.20.0",
84
84
  "eslint-config-prettier": "^8.3.0",
85
+ "eslint-config-react-app": "^7.0.1",
85
86
  "eslint-config-ts-react-important-stuff": "^3.0.0",
86
- "eslint-plugin-prettier": "^3.4.0",
87
+ "eslint-plugin-prettier": "^4.2.1",
87
88
  "husky": "^8.0.1",
88
89
  "identity-obj-proxy": "^3.0.0",
89
90
  "jest": "^26.4.2",
@@ -69,7 +69,7 @@ export interface Observation {
69
69
  display: string;
70
70
  };
71
71
  }>;
72
- value: any;
72
+ value: unknown;
73
73
  obsDatetime: string;
74
74
  }
75
75
 
@@ -131,7 +131,7 @@ const FormBootstrap = ({
131
131
  patientUuid,
132
132
  patient,
133
133
  encounterUuid: encounterUuid ?? "",
134
- closeWorkspace: () => {},
134
+ closeWorkspace: () => undefined,
135
135
  handlePostResponse,
136
136
  showDiscardSubmitButtons: false,
137
137
  }}
@@ -1,4 +1,4 @@
1
- import { Type, validator } from "@openmrs/esm-framework";
1
+ import { Type } from "@openmrs/esm-framework";
2
2
 
3
3
  /**
4
4
  * This is the config schema.
@@ -68,11 +68,11 @@ export type Form = {
68
68
  };
69
69
 
70
70
  export type Category = {
71
- name: String;
71
+ name: string;
72
72
  forms: Array<Form>;
73
73
  };
74
74
 
75
75
  export type Config = {
76
76
  formCategories: Array<Category>;
77
- formCategoriesToShow: Array<String>;
77
+ formCategoriesToShow: Array<string>;
78
78
  };
@@ -12,13 +12,13 @@ const initialState = {
12
12
  activeEncounterUuid: null,
13
13
  encounters: {},
14
14
  workflowState: null,
15
- addPatient: (uuid: string | number) => {},
16
- openPatientSearch: () => {},
17
- saveEncounter: (encounterUuid: string | number) => {},
18
- editEncounter: (patientUuid: string | number) => {},
19
- submitForNext: () => {},
20
- submitForReview: () => {},
21
- goToReview: () => {},
15
+ addPatient: (uuid: string | number) => undefined,
16
+ openPatientSearch: () => undefined,
17
+ saveEncounter: (encounterUuid: string | number) => undefined,
18
+ editEncounter: (patientUuid: string | number) => undefined,
19
+ submitForNext: () => undefined,
20
+ submitForReview: () => undefined,
21
+ goToReview: () => undefined,
22
22
  };
23
23
 
24
24
  const FormWorkflowContext = React.createContext(initialState);
@@ -17,10 +17,6 @@ import FormWorkflowContext, {
17
17
  } from "../context/FormWorkflowContext";
18
18
  import WorkflowReview from "../workflow-review";
19
19
 
20
- interface ParamTypes {
21
- formUuid: string;
22
- }
23
-
24
20
  const formStore = getGlobalStore("ampath-form-state");
25
21
 
26
22
  const WorkflowNavigationButtons = () => {
@@ -5,6 +5,7 @@ import { ConfigurableLink } from "@openmrs/esm-framework";
5
5
  export default function OfflineToolsAppMenuLink() {
6
6
  const { t } = useTranslation();
7
7
  return (
8
+ // eslint-disable-next-line
8
9
  <ConfigurableLink to="${openmrsSpaBase}/forms">
9
10
  {t("formsAppMenuLink", "Forms")}
10
11
  </ConfigurableLink>
@@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
10
10
  // helper function useful for debugging
11
11
  // given a list of forms, it will organize into permissions
12
12
  // and list which forms are associated with that permission
13
- const getFormPermissions = (forms) => {
13
+ export const getFormPermissions = (forms) => {
14
14
  const output = {};
15
15
  forms?.forEach(
16
16
  (form) =>
@@ -1,5 +1,4 @@
1
- import { fetchCurrentPatient, openmrsFetch } from "@openmrs/esm-framework";
2
- import { useEffect, useState } from "react";
1
+ import { openmrsFetch } from "@openmrs/esm-framework";
3
2
  import useSWR from "swr";
4
3
 
5
4
  const encounterUrl = "/ws/rest/v1/encounter/";
@@ -8,7 +8,7 @@ const CardContainer = ({ active, onClick, children }) => {
8
8
  return (
9
9
  <div
10
10
  className={`${styles.cardContainer} ${!active && styles.inactiveCard}`}
11
- onClick={active ? onClick : () => {}}
11
+ onClick={active ? onClick : () => undefined}
12
12
  role="button"
13
13
  tabIndex={0}
14
14
  >
@@ -26,7 +26,7 @@ const PatientCard = ({ patientUuid }) => {
26
26
 
27
27
  if (!patient) {
28
28
  return (
29
- <CardContainer onClick={() => {}} active={true}>
29
+ <CardContainer onClick={() => undefined} active={true}>
30
30
  <SkeletonText className={styles.skeletonText} />
31
31
  </CardContainer>
32
32
  );
@@ -3,7 +3,6 @@ import React, { useContext } from "react";
3
3
  import { useHistory } from "react-router-dom";
4
4
  import FormWorkflowContext from "../context/FormWorkflowContext";
5
5
  import FormReviewCard from "../form-review-card";
6
- import PatientCard from "../patient-card";
7
6
  import styles from "./styles.scss";
8
7
 
9
8
  const WorkflowReview = () => {
package/.eslintrc DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "parser": "@typescript-eslint/parser",
3
- "extends": ["ts-react-important-stuff", "plugin:prettier/recommended"]
4
- }