@mbehenri/openmrs-esm-opentms-meet-app 1.0.0
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/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +57 -0
- package/.husky/pre-commit +7 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +14 -0
- package/.turbo.json +18 -0
- package/.yarn/install-state.gz +0 -0
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/.yarn/releases/yarn-3.6.1.cjs +874 -0
- package/.yarnrc.yml +9 -0
- package/LICENSE +401 -0
- package/README.md +26 -0
- package/__mocks__/react-i18next.js +55 -0
- package/e2e/README.md +115 -0
- package/e2e/core/global-setup.ts +32 -0
- package/e2e/core/index.ts +1 -0
- package/e2e/core/test.ts +20 -0
- package/e2e/fixtures/api.ts +26 -0
- package/e2e/fixtures/index.ts +1 -0
- package/e2e/pages/home-page.ts +9 -0
- package/e2e/pages/index.ts +1 -0
- package/e2e/specs/sample-test.spec.ts +11 -0
- package/e2e/support/github/Dockerfile +34 -0
- package/e2e/support/github/docker-compose.yml +24 -0
- package/e2e/support/github/run-e2e-docker-env.sh +49 -0
- package/example.env +6 -0
- package/i18next-parser.config.js +89 -0
- package/jest.config.js +31 -0
- package/package.json +108 -0
- package/playwright.config.ts +32 -0
- package/src/Extensions/AppointmentTabExt.tsx +23 -0
- package/src/Extensions/DemandTabExt.tsx +14 -0
- package/src/Extensions/MeetIframeExt.tsx +14 -0
- package/src/Extensions/ValidateDemandFormExt.tsx +14 -0
- package/src/assets/img/Logo-texte.png +0 -0
- package/src/assets/img/Logo-texte.sim.white.png +0 -0
- package/src/assets/img/Logo-texte.white.png +0 -0
- package/src/assets/img/Logo.png +0 -0
- package/src/assets/img/favicon.ico +0 -0
- package/src/components/Appointment/index.scss +91 -0
- package/src/components/Appointment/index.tsx +207 -0
- package/src/components/Appointment/menu.scss +7 -0
- package/src/components/Appointment/menu.tsx +48 -0
- package/src/components/Appointment/tab.tsx +162 -0
- package/src/components/Demand/form.scss +19 -0
- package/src/components/Demand/form.tsx +236 -0
- package/src/components/Demand/index.tsx +0 -0
- package/src/components/Demand/tab.scss +145 -0
- package/src/components/Demand/tab.tsx +315 -0
- package/src/components/EmptyLayout/index.scss +69 -0
- package/src/components/EmptyLayout/index.tsx +32 -0
- package/src/components/MeetIframe/index.scss +56 -0
- package/src/components/MeetIframe/index.tsx +117 -0
- package/src/config-schema.ts +45 -0
- package/src/dashboard.meta.ts +12 -0
- package/src/declarations.d.ts +6 -0
- package/src/index.ts +75 -0
- package/src/pages/home/home.component.tsx +8 -0
- package/src/privileges/doctor.ts +213 -0
- package/src/repositories/Opencare/index.ts +12 -0
- package/src/repositories/Opencare/prodRepository.ts +176 -0
- package/src/repositories/Opencare/repository.ts +34 -0
- package/src/repositories/TypeRepository.ts +1 -0
- package/src/repositories/env.ts +7 -0
- package/src/repositories/errors.ts +13 -0
- package/src/root.component.tsx +46 -0
- package/src/root.scss +15 -0
- package/src/root.test.tsx +54 -0
- package/src/routes.json +44 -0
- package/src/services/doctor.ts +165 -0
- package/src/setup-tests.ts +1 -0
- package/src/utils.ts +41 -0
- package/translations/en.json +1 -0
- package/translations/es.json +24 -0
- package/translations/fr.json +24 -0
- package/translations/he.json +24 -0
- package/translations/km.json +24 -0
- package/tsconfig.json +24 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A fixture which initializes an [`APIRequestContext`](https://playwright.dev/docs/api/class-apirequestcontext)
|
|
5
|
+
* that is bound to the configured OpenMRS API server. The context is automatically authenticated
|
|
6
|
+
* using the configured admin account.
|
|
7
|
+
*
|
|
8
|
+
* Use the request context like this:
|
|
9
|
+
* ```ts
|
|
10
|
+
* test('your test', async ({ api }) => {
|
|
11
|
+
* const res = await api.get('patient/1234');
|
|
12
|
+
* await expect(res.ok()).toBeTruthy();
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const api: WorkerFixture<APIRequestContext, PlaywrightWorkerArgs> = async ({ playwright }, use) => {
|
|
17
|
+
const ctx = await playwright.request.newContext({
|
|
18
|
+
baseURL: `${process.env.E2E_BASE_URL}/ws/rest/v1/`,
|
|
19
|
+
httpCredentials: {
|
|
20
|
+
username: process.env.E2E_USER_ADMIN_USERNAME,
|
|
21
|
+
password: process.env.E2E_USER_ADMIN_PASSWORD,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
await use(ctx);
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './home-page';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import test from "@playwright/test";
|
|
2
|
+
import { HomePage } from "../pages";
|
|
3
|
+
import { expect } from "@playwright/test";
|
|
4
|
+
|
|
5
|
+
// This test is a sample E2E test. You can delete it.
|
|
6
|
+
|
|
7
|
+
test("Sample test", async ({ page}) => {
|
|
8
|
+
const homePage = new HomePage(page);
|
|
9
|
+
await homePage.goto();
|
|
10
|
+
await expect(homePage.page.getByRole('link', { name: 'Home' })).toBeVisible();
|
|
11
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.3
|
|
2
|
+
FROM --platform=$BUILDPLATFORM node:18-alpine as dev
|
|
3
|
+
|
|
4
|
+
ARG APP_SHELL_VERSION=next
|
|
5
|
+
|
|
6
|
+
RUN mkdir -p /app
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
COPY . .
|
|
10
|
+
|
|
11
|
+
RUN npm_config_legacy_peer_deps=true npm install -g openmrs@${APP_SHELL_VERSION:-next}
|
|
12
|
+
ARG CACHE_BUST
|
|
13
|
+
RUN npm_config_legacy_peer_deps=true openmrs assemble --manifest --mode config --config spa-assemble-config.json --target ./spa
|
|
14
|
+
|
|
15
|
+
FROM --platform=$BUILDPLATFORM openmrs/openmrs-reference-application-3-frontend:nightly as frontend
|
|
16
|
+
FROM nginx:1.23-alpine
|
|
17
|
+
|
|
18
|
+
RUN apk update && \
|
|
19
|
+
apk upgrade && \
|
|
20
|
+
# add more utils for sponge to support our startup script
|
|
21
|
+
apk add --no-cache moreutils
|
|
22
|
+
|
|
23
|
+
# clear any default files installed by nginx
|
|
24
|
+
RUN rm -rf /usr/share/nginx/html/*
|
|
25
|
+
|
|
26
|
+
COPY --from=frontend /etc/nginx/nginx.conf /etc/nginx/nginx.conf
|
|
27
|
+
# this assumes that NOTHING in the framework is in a subdirectory
|
|
28
|
+
COPY --from=frontend /usr/share/nginx/html/* /usr/share/nginx/html/
|
|
29
|
+
COPY --from=frontend /usr/local/bin/startup.sh /usr/local/bin/startup.sh
|
|
30
|
+
RUN chmod +x /usr/local/bin/startup.sh
|
|
31
|
+
|
|
32
|
+
COPY --from=dev /app/spa/ /usr/share/nginx/html/
|
|
33
|
+
|
|
34
|
+
CMD ["/usr/local/bin/startup.sh"]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This docker compose file is used to create a backend environment for the e2e.yml workflow.
|
|
2
|
+
version: "3.7"
|
|
3
|
+
|
|
4
|
+
services:
|
|
5
|
+
gateway:
|
|
6
|
+
image: openmrs/openmrs-reference-application-3-gateway:${TAG:-nightly}
|
|
7
|
+
ports:
|
|
8
|
+
- "8080:80"
|
|
9
|
+
|
|
10
|
+
frontend:
|
|
11
|
+
build:
|
|
12
|
+
context: .
|
|
13
|
+
environment:
|
|
14
|
+
SPA_PATH: /openmrs/spa
|
|
15
|
+
API_URL: /openmrs
|
|
16
|
+
|
|
17
|
+
backend:
|
|
18
|
+
image: openmrs/openmrs-reference-application-3-backend:nightly-with-data
|
|
19
|
+
depends_on:
|
|
20
|
+
- db
|
|
21
|
+
|
|
22
|
+
# MariaDB
|
|
23
|
+
db:
|
|
24
|
+
image: openmrs/openmrs-reference-application-3-db:nightly-with-data
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env bash -eu
|
|
2
|
+
|
|
3
|
+
# get the dir containing the script
|
|
4
|
+
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
5
|
+
# create a temporary working directory
|
|
6
|
+
working_dir=$(mktemp -d "${TMPDIR:-/tmp/}openmrs-e2e-frontends.XXXXXXXXXX")
|
|
7
|
+
# get a list of all the apps in this workspace
|
|
8
|
+
apps=$(yarn workspaces list --json | jq -r 'if ((.location == ".") or (.location | test("form-engine-app")) or (.location | test("-app") | not)) then halt else .name end')
|
|
9
|
+
# this array will hold all of the packed app names
|
|
10
|
+
app_names=()
|
|
11
|
+
|
|
12
|
+
echo "Creating packed archives of apps..."
|
|
13
|
+
# for each app
|
|
14
|
+
for app in $apps
|
|
15
|
+
do
|
|
16
|
+
# @openmrs/esm-whatever -> _openmrs_esm_whatever
|
|
17
|
+
app_name=$(echo "$app" | tr '[:punct:]' '_');
|
|
18
|
+
# add to our array
|
|
19
|
+
app_names+=("$app_name.tgz");
|
|
20
|
+
# run yarn pack for our app and add it to the working directory
|
|
21
|
+
yarn workspace "$app" pack -o "$working_dir/$app_name.tgz" >/dev/null;
|
|
22
|
+
done;
|
|
23
|
+
echo "Created packed app archives"
|
|
24
|
+
|
|
25
|
+
echo "Creating dynamic spa-assemble-config.json..."
|
|
26
|
+
# dynamically assemble our list of frontend modules, prepending the login app and
|
|
27
|
+
# primary navigation apps; apps will all be in the /app directory of the Docker
|
|
28
|
+
# container
|
|
29
|
+
jq -n \
|
|
30
|
+
--arg apps "$apps" \
|
|
31
|
+
--arg app_names "$(echo ${app_names[@]})" \
|
|
32
|
+
'{"@openmrs/esm-primary-navigation-app": "next", "@openmrs/esm-home-app": "next"} + (
|
|
33
|
+
($apps | split("\n")) as $apps | ($app_names | split(" ") | map("/app/" + .)) as $app_files
|
|
34
|
+
| [$apps, $app_files]
|
|
35
|
+
| transpose
|
|
36
|
+
| map({"key": .[0], "value": .[1]})
|
|
37
|
+
| from_entries
|
|
38
|
+
)' | jq '{"frontendModules": .}' > "$working_dir/spa-assemble-config.json"
|
|
39
|
+
echo "Created dynamic spa-assemble-config.json"
|
|
40
|
+
|
|
41
|
+
echo "Copying Docker configuration..."
|
|
42
|
+
cp "$script_dir/Dockerfile" "$working_dir/Dockerfile"
|
|
43
|
+
cp "$script_dir/docker-compose.yml" "$working_dir/docker-compose.yml"
|
|
44
|
+
|
|
45
|
+
cd $working_dir
|
|
46
|
+
echo "Starting Docker containers..."
|
|
47
|
+
# CACHE_BUST to ensure the assemble step is always run
|
|
48
|
+
docker compose build --build-arg CACHE_BUST=$(date +%s) frontend
|
|
49
|
+
docker compose up -d
|
package/example.env
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# This is an example environment file for configuring dynamic values.
|
|
2
|
+
E2E_BASE_URL=http://localhost:8080/openmrs
|
|
3
|
+
E2E_USER_ADMIN_USERNAME=admin
|
|
4
|
+
E2E_USER_ADMIN_PASSWORD=Admin123
|
|
5
|
+
E2E_LOGIN_DEFAULT_LOCATION_UUID=44c3efb0-2583-4c80-a79e-1f756a03c0a1
|
|
6
|
+
# The above location UUID is for the "Outpatient Clinic" location in the reference application
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
contextSeparator: "_",
|
|
3
|
+
// Key separator used in your translation keys
|
|
4
|
+
|
|
5
|
+
createOldCatalogs: false,
|
|
6
|
+
// Save the \_old files
|
|
7
|
+
|
|
8
|
+
defaultNamespace: "translations",
|
|
9
|
+
// Default namespace used in your i18next config
|
|
10
|
+
|
|
11
|
+
defaultValue: "",
|
|
12
|
+
// Default value to give to empty keys
|
|
13
|
+
// You may also specify a function accepting the locale, namespace, and key as arguments
|
|
14
|
+
|
|
15
|
+
indentation: 2,
|
|
16
|
+
// Indentation of the catalog files
|
|
17
|
+
|
|
18
|
+
keepRemoved: false,
|
|
19
|
+
// Keep keys from the catalog that are no longer in code
|
|
20
|
+
|
|
21
|
+
keySeparator: ".",
|
|
22
|
+
// Key separator used in your translation keys
|
|
23
|
+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
|
24
|
+
|
|
25
|
+
// see below for more details
|
|
26
|
+
lexers: {
|
|
27
|
+
hbs: ["HandlebarsLexer"],
|
|
28
|
+
handlebars: ["HandlebarsLexer"],
|
|
29
|
+
|
|
30
|
+
htm: ["HTMLLexer"],
|
|
31
|
+
html: ["HTMLLexer"],
|
|
32
|
+
|
|
33
|
+
mjs: ["JavascriptLexer"],
|
|
34
|
+
js: ["JavascriptLexer"], // if you're writing jsx inside .js files, change this to JsxLexer
|
|
35
|
+
ts: ["JavascriptLexer"],
|
|
36
|
+
jsx: ["JsxLexer"],
|
|
37
|
+
tsx: ["JsxLexer"],
|
|
38
|
+
|
|
39
|
+
default: ["JavascriptLexer"],
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
lineEnding: "auto",
|
|
43
|
+
// Control the line ending. See options at https://github.com/ryanve/eol
|
|
44
|
+
|
|
45
|
+
locales: ["en"],
|
|
46
|
+
// An array of the locales in your applications
|
|
47
|
+
|
|
48
|
+
namespaceSeparator: ":",
|
|
49
|
+
// Namespace separator used in your translation keys
|
|
50
|
+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
|
51
|
+
|
|
52
|
+
output: "$NAMESPACE/$LOCALE.json",
|
|
53
|
+
// Supports $LOCALE and $NAMESPACE injection
|
|
54
|
+
// Supports JSON (.json) and YAML (.yml) file formats
|
|
55
|
+
// Where to write the locale files relative to process.cwd()
|
|
56
|
+
|
|
57
|
+
pluralSeparator: "_",
|
|
58
|
+
// Plural separator used in your translation keys
|
|
59
|
+
// If you want to use plain english keys, separators such as `_` might conflict. You might want to set `pluralSeparator` to a different string that does not occur in your keys.
|
|
60
|
+
|
|
61
|
+
input: undefined,
|
|
62
|
+
// An array of globs that describe where to look for source files
|
|
63
|
+
// relative to the location of the configuration file
|
|
64
|
+
|
|
65
|
+
sort: true,
|
|
66
|
+
// Whether or not to sort the catalog
|
|
67
|
+
|
|
68
|
+
useKeysAsDefaultValue: false,
|
|
69
|
+
// Whether to use the keys as the default value; ex. "Hello": "Hello", "World": "World"
|
|
70
|
+
// This option takes precedence over the `defaultValue` and `skipDefaultValues` options
|
|
71
|
+
// You may also specify a function accepting the locale and namespace as arguments
|
|
72
|
+
|
|
73
|
+
verbose: false,
|
|
74
|
+
// Display info about the parsing including some stats
|
|
75
|
+
|
|
76
|
+
failOnWarnings: false,
|
|
77
|
+
// Exit with an exit code of 1 on warnings
|
|
78
|
+
|
|
79
|
+
customValueTemplate: null,
|
|
80
|
+
// If you wish to customize the value output the value as an object, you can set your own format.
|
|
81
|
+
// ${defaultValue} is the default value you set in your translation function.
|
|
82
|
+
// Any other custom property will be automatically extracted.
|
|
83
|
+
//
|
|
84
|
+
// Example:
|
|
85
|
+
// {
|
|
86
|
+
// message: "${defaultValue}",
|
|
87
|
+
// description: "${maxLength}", // t('my-key', {maxLength: 150})
|
|
88
|
+
// }
|
|
89
|
+
};
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @returns {Promise<import('jest').Config>}
|
|
3
|
+
*/
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
collectCoverageFrom: [
|
|
8
|
+
'**/src/**/*.component.tsx',
|
|
9
|
+
'!**/node_modules/**',
|
|
10
|
+
'!**/vendor/**',
|
|
11
|
+
'!**/src/**/*.test.*',
|
|
12
|
+
'!**/src/declarations.d.ts',
|
|
13
|
+
'!**/e2e/**',
|
|
14
|
+
],
|
|
15
|
+
transform: {
|
|
16
|
+
"^.+\\.tsx?$": ["@swc/jest"],
|
|
17
|
+
},
|
|
18
|
+
transformIgnorePatterns: ["/node_modules/(?!@openmrs)"],
|
|
19
|
+
moduleNameMapper: {
|
|
20
|
+
"@openmrs/esm-framework": "@openmrs/esm-framework/mock",
|
|
21
|
+
"\\.(s?css)$": "identity-obj-proxy",
|
|
22
|
+
"^lodash-es/(.*)$": "lodash/$1",
|
|
23
|
+
"^dexie$": require.resolve("dexie"),
|
|
24
|
+
},
|
|
25
|
+
setupFilesAfterEnv: ["<rootDir>/src/setup-tests.ts"],
|
|
26
|
+
testPathIgnorePatterns: [path.resolve(__dirname, 'e2e')],
|
|
27
|
+
testEnvironment: "jsdom",
|
|
28
|
+
testEnvironmentOptions: {
|
|
29
|
+
url: "http://localhost/",
|
|
30
|
+
},
|
|
31
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mbehenri/openmrs-esm-opentms-meet-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MPL-2.0",
|
|
5
|
+
"description": "The OpenMRS Opentms Meet application (micro front-end)",
|
|
6
|
+
"browser": "dist/openmrs-esm-opentms-meet-app.js",
|
|
7
|
+
"main": "src/index.ts",
|
|
8
|
+
"source": true,
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "openmrs develop",
|
|
11
|
+
"serve": "webpack serve --mode=development",
|
|
12
|
+
"build": "webpack --mode production",
|
|
13
|
+
"analyze": "webpack --mode=production --env analyze=true",
|
|
14
|
+
"lint": "TIMING=1 eslint src --ext js,jsx,ts,tsx",
|
|
15
|
+
"prettier": "prettier --write \"src/**/*.{ts,tsx}\" --list-different",
|
|
16
|
+
"typescript": "tsc",
|
|
17
|
+
"test": "jest --config jest.config.js --passWithNoTests",
|
|
18
|
+
"verify": "turbo lint typescript",
|
|
19
|
+
"verifyplus": "turbo lint typescript coverage",
|
|
20
|
+
"coverage": "yarn test --coverage",
|
|
21
|
+
"prepare": "husky install",
|
|
22
|
+
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js",
|
|
23
|
+
"test-e2e": "playwright test"
|
|
24
|
+
},
|
|
25
|
+
"husky": {
|
|
26
|
+
"hooks": {
|
|
27
|
+
"pre-commit": "pretty-quick --staged && yarn verify"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"browserslist": [
|
|
31
|
+
"extends browserslist-config-openmrs"
|
|
32
|
+
],
|
|
33
|
+
"keywords": [
|
|
34
|
+
"openmrs",
|
|
35
|
+
"microfrontends"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/OpenSecureFoundation/openmrs-esm-opentms-meet-app"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/OpenSecureFoundation/openmrs-esm-opentms-meet-app#readme",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/OpenSecureFoundation/openmrs-esm-opentms-meet-app/issues"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@carbon/react": "^1.33.1",
|
|
50
|
+
"lodash-es": "^4.17.21",
|
|
51
|
+
"react-image-annotate": "^1.8.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@openmrs/esm-framework": "*",
|
|
55
|
+
"dayjs": "1.x",
|
|
56
|
+
"react": "18.x",
|
|
57
|
+
"react-i18next": "11.x",
|
|
58
|
+
"react-router-dom": "6.x",
|
|
59
|
+
"rxjs": "6.x"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@openmrs/esm-framework": "next",
|
|
63
|
+
"@openmrs/esm-styleguide": "next",
|
|
64
|
+
"@playwright/test": "^1.30.0",
|
|
65
|
+
"@swc/cli": "^0.1.62",
|
|
66
|
+
"@swc/core": "^1.3.68",
|
|
67
|
+
"@swc/jest": "^0.2.26",
|
|
68
|
+
"@testing-library/dom": "^8.20.1",
|
|
69
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
70
|
+
"@testing-library/react": "^13.4.0",
|
|
71
|
+
"@testing-library/user-event": "^14.4.3",
|
|
72
|
+
"@types/react": "^18.2.14",
|
|
73
|
+
"@types/react-dom": "^18.2.6",
|
|
74
|
+
"@types/react-router": "^5.1.20",
|
|
75
|
+
"@types/react-router-dom": "^5.3.3",
|
|
76
|
+
"@types/webpack-env": "^1.18.1",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
|
78
|
+
"@typescript-eslint/parser": "^5.61.0",
|
|
79
|
+
"css-loader": "^6.8.1",
|
|
80
|
+
"dotenv": "^16.0.3",
|
|
81
|
+
"eslint": "^8.44.0",
|
|
82
|
+
"eslint-config-prettier": "^8.8.0",
|
|
83
|
+
"eslint-config-ts-react-important-stuff": "^3.0.0",
|
|
84
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
85
|
+
"husky": "^8.0.3",
|
|
86
|
+
"i18next": "^23.2.8",
|
|
87
|
+
"i18next-parser": "^8.0.0",
|
|
88
|
+
"identity-obj-proxy": "^3.0.0",
|
|
89
|
+
"jest": "^28.1.3",
|
|
90
|
+
"jest-cli": "^28.1.3",
|
|
91
|
+
"jest-environment-jsdom": "^28.1.3",
|
|
92
|
+
"openmrs": "next",
|
|
93
|
+
"prettier": "^2.8.8",
|
|
94
|
+
"pretty-quick": "^3.1.3",
|
|
95
|
+
"react": "^18.2.0",
|
|
96
|
+
"react-dom": "^18.2.0",
|
|
97
|
+
"react-i18next": "^11.18.6",
|
|
98
|
+
"react-router-dom": "^6.14.1",
|
|
99
|
+
"rxjs": "^6.6.7",
|
|
100
|
+
"swc-loader": "^0.2.3",
|
|
101
|
+
"turbo": "^1.12.4",
|
|
102
|
+
"typescript": "^4.9.5",
|
|
103
|
+
"webpack": "^5.88.1",
|
|
104
|
+
"webpack-cli": "^5.1.4",
|
|
105
|
+
"webpack-dev-server": "^5.0.4"
|
|
106
|
+
},
|
|
107
|
+
"packageManager": "yarn@3.6.1"
|
|
108
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { devices, PlaywrightTestConfig } from '@playwright/test';
|
|
2
|
+
import * as dotenv from 'dotenv';
|
|
3
|
+
dotenv.config();
|
|
4
|
+
|
|
5
|
+
// See https://playwright.dev/docs/test-configuration.
|
|
6
|
+
const config: PlaywrightTestConfig = {
|
|
7
|
+
testDir: './e2e/specs',
|
|
8
|
+
timeout: 3 * 60 * 1000,
|
|
9
|
+
expect: {
|
|
10
|
+
timeout: 40 * 1000,
|
|
11
|
+
},
|
|
12
|
+
fullyParallel: true,
|
|
13
|
+
forbidOnly: !!process.env.CI,
|
|
14
|
+
retries: 0,
|
|
15
|
+
reporter: process.env.CI ? [['junit', { outputFile: 'results.xml' }], ['html']] : [['html']],
|
|
16
|
+
globalSetup: require.resolve('./e2e/core/global-setup'),
|
|
17
|
+
use: {
|
|
18
|
+
baseURL: `${process.env.E2E_BASE_URL}/spa/`,
|
|
19
|
+
storageState: 'e2e/storageState.json',
|
|
20
|
+
video: 'retain-on-failure',
|
|
21
|
+
},
|
|
22
|
+
projects: [
|
|
23
|
+
{
|
|
24
|
+
name: 'chromium',
|
|
25
|
+
use: {
|
|
26
|
+
...devices['Desktop Chrome'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default config;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PatientAppointmentsBase from "../components/Appointment";
|
|
3
|
+
import { usePatient } from "@openmrs/esm-framework";
|
|
4
|
+
|
|
5
|
+
/* interface Props {} */
|
|
6
|
+
|
|
7
|
+
const AppointmentTabExt: React.FC /* <Props> */ = () => {
|
|
8
|
+
const { isLoading, patientUuid, error } = usePatient();
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div>
|
|
12
|
+
{isLoading ? (
|
|
13
|
+
<span>...</span>
|
|
14
|
+
) : error ? (
|
|
15
|
+
<span></span>
|
|
16
|
+
) : (
|
|
17
|
+
<PatientAppointmentsBase patientUuid={patientUuid} />
|
|
18
|
+
)}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default AppointmentTabExt;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DemandTab from "../components/Demand/tab";
|
|
3
|
+
|
|
4
|
+
/* interface Props {} */
|
|
5
|
+
|
|
6
|
+
const DemandTabExt: React.FC /* <Props> */ = (/* {} */) => {
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<DemandTab />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default DemandTabExt;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { MeetIframe } from "../components/MeetIframe";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
url: string;
|
|
6
|
+
context: string;
|
|
7
|
+
closeWorkspace: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const MeetIframeExt: React.FC<Props> = ({ url }) => {
|
|
11
|
+
return <MeetIframe url={url} username="" token="" />;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default MeetIframeExt;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ValidateDemandForm } from "../components/Demand/form";
|
|
3
|
+
|
|
4
|
+
export interface ValidateDemandFormExtProps {
|
|
5
|
+
demand: any;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const ValidateDemandFormExt: React.FC<ValidateDemandFormExtProps> = ({
|
|
10
|
+
demand,
|
|
11
|
+
onClose,
|
|
12
|
+
}) => {
|
|
13
|
+
return <ValidateDemandForm demand={demand} onClose={onClose} />;
|
|
14
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/styles/scss/spacing';
|
|
3
|
+
@use '@carbon/styles/scss/type';
|
|
4
|
+
@import '@openmrs/esm-styleguide/src/vars';
|
|
5
|
+
|
|
6
|
+
// TO DO Move this styles to style - guide
|
|
7
|
+
// https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/_vars.scss
|
|
8
|
+
$color-blue-30: #a6c8ff;
|
|
9
|
+
$color-blue-10: #edf5ff;
|
|
10
|
+
|
|
11
|
+
.widgetCard {
|
|
12
|
+
border: 1px solid $ui-03;
|
|
13
|
+
max-width: 60rem;
|
|
14
|
+
margin: auto;
|
|
15
|
+
margin-top: spacing.$spacing-05;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.productiveHeading01 {
|
|
19
|
+
@include type.type-style('heading-compact-01');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.contentSwitcherWrapper {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 60%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.contentViewWrapper {
|
|
30
|
+
background-color: $color-blue-10;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 550px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.contentSwitcherWrapper>div>button {
|
|
36
|
+
background-color: $ui-02;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.contentSwitcherWrapper>div button:first-child {
|
|
40
|
+
border-top: 1px solid $color-blue-30;
|
|
41
|
+
border-bottom: 1px solid $color-blue-30;
|
|
42
|
+
border-left: 1px solid $color-blue-30;
|
|
43
|
+
border-right: none;
|
|
44
|
+
border-radius: spacing.$spacing-02 0 0px spacing.$spacing-02;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.contentSwitcherWrapper>div button:last-child {
|
|
48
|
+
border-top: 1px solid $color-blue-30;
|
|
49
|
+
border-bottom: 1px solid $color-blue-30;
|
|
50
|
+
border-right: 1px solid $color-blue-30;
|
|
51
|
+
border-left: none;
|
|
52
|
+
border-radius: 0px spacing.$spacing-02 spacing.$spacing-02 0px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.contentSwitcherWrapper>div>button[aria-selected='true'],
|
|
56
|
+
.contentSwitcherWrapper>div>button[aria-selected='true']:first-child {
|
|
57
|
+
background-color: $color-blue-10;
|
|
58
|
+
color: $color-blue-60-2;
|
|
59
|
+
border-color: $color-blue-60-2;
|
|
60
|
+
border-right: 1px solid $color-blue-60-2;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.contentSwitcherWrapper>div>button[aria-selected='true'],
|
|
64
|
+
.contentSwitcherWrapper>div>button[aria-selected='true']:last-child {
|
|
65
|
+
background-color: $color-blue-10;
|
|
66
|
+
color: $color-blue-60-2;
|
|
67
|
+
border-color: $color-blue-60-2;
|
|
68
|
+
border-left: 1px solid $color-blue-60-2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.contentSwitcherWrapper>div>button[aria-selected='true']:focus {
|
|
72
|
+
box-shadow: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.divider {
|
|
76
|
+
width: 1px;
|
|
77
|
+
height: spacing.$spacing-05;
|
|
78
|
+
color: colors.$gray-20;
|
|
79
|
+
margin: 0 spacing.$spacing-05;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.content {
|
|
83
|
+
@include type.type-style('heading-compact-01');
|
|
84
|
+
color: $text-02;
|
|
85
|
+
margin-top: spacing.$spacing-05;
|
|
86
|
+
margin-bottom: spacing.$spacing-03;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tile {
|
|
90
|
+
text-align: center;
|
|
91
|
+
}
|