@openmrs/esm-devtools-app 9.0.3-pre.4533 → 9.0.3-pre.4550
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/.turbo/turbo-build.log +2 -2
- package/dist/{347.js → 261.js} +1 -1
- package/dist/261.js.map +1 -0
- package/dist/807.js +1 -1
- package/dist/807.js.map +1 -1
- package/dist/827.js +1 -1
- package/dist/827.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/openmrs-esm-devtools-app.js +2 -2
- package/dist/openmrs-esm-devtools-app.js.buildmanifest.json +35 -35
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/setup-tests.ts +1 -5
- package/src/devtools/devtools.component.tsx +1 -1
- package/src/devtools/devtools.test.tsx +4 -4
- package/src/devtools/import-map-list/import-map.modal.tsx +18 -10
- package/src/devtools/import-map-list/list.component.tsx +19 -14
- package/src/devtools/import-map.component.tsx +3 -2
- package/tsconfig.json +1 -1
- package/dist/347.js.map +0 -1
|
@@ -13,7 +13,18 @@ import {
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import fuzzy from 'fuzzy';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
useDebounce,
|
|
18
|
+
type ImportMap,
|
|
19
|
+
showModal,
|
|
20
|
+
resetRouteMapOverrides,
|
|
21
|
+
getCurrentPageMap,
|
|
22
|
+
getImportMapDefaultMap,
|
|
23
|
+
getImportMapNextPageMap,
|
|
24
|
+
getImportMapOverrideMap,
|
|
25
|
+
getImportMapDisabledOverrides,
|
|
26
|
+
resetImportMapOverrides,
|
|
27
|
+
} from '@openmrs/esm-framework/src/internal';
|
|
17
28
|
import type { Module } from './types';
|
|
18
29
|
import styles from './list.scss';
|
|
19
30
|
|
|
@@ -75,8 +86,7 @@ const initialImportMapState: ImportMapListState = {
|
|
|
75
86
|
};
|
|
76
87
|
|
|
77
88
|
function updateToNext(dispatch: Dispatch<ImportMapDispatchAction>) {
|
|
78
|
-
return () =>
|
|
79
|
-
window.importMapOverrides.getNextPageMap().then((nextPageMap) => dispatch({ type: 'set_next_map', nextPageMap }));
|
|
89
|
+
return () => getImportMapNextPageMap().then((nextPageMap) => dispatch({ type: 'set_next_map', nextPageMap }));
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
function reducer(state: ImportMapListState, action: ImportMapDispatchAction) {
|
|
@@ -103,8 +113,8 @@ function reducer(state: ImportMapListState, action: ImportMapDispatchAction) {
|
|
|
103
113
|
dialogModule: null,
|
|
104
114
|
};
|
|
105
115
|
case 'reset_all_overrides':
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
resetImportMapOverrides();
|
|
117
|
+
resetRouteMapOverrides();
|
|
108
118
|
return state;
|
|
109
119
|
}
|
|
110
120
|
}
|
|
@@ -118,13 +128,8 @@ const ImportMapList = forwardRef<HTMLDivElement>((props, ref) => {
|
|
|
118
128
|
const searchVal = useDebounce(searchQuery);
|
|
119
129
|
|
|
120
130
|
useEffect(() => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
.getDefaultMap()
|
|
124
|
-
.then((notOverriddenMap) => dispatch({ type: 'set_default_map', notOverriddenMap }));
|
|
125
|
-
window.importMapOverrides
|
|
126
|
-
.getCurrentPageMap()
|
|
127
|
-
.then((currentPageMap) => dispatch({ type: 'set_current_map', currentPageMap }));
|
|
131
|
+
getImportMapDefaultMap().then((notOverriddenMap) => dispatch({ type: 'set_default_map', notOverriddenMap }));
|
|
132
|
+
getCurrentPageMap().then((currentPageMap) => dispatch({ type: 'set_current_map', currentPageMap }));
|
|
128
133
|
|
|
129
134
|
// focus on the search box
|
|
130
135
|
inputRef.current?.focus();
|
|
@@ -157,9 +162,9 @@ const ImportMapList = forwardRef<HTMLDivElement>((props, ref) => {
|
|
|
157
162
|
externalOverrideModules: Array<Module> = [],
|
|
158
163
|
pendingRefreshDefaultModules: Array<Module> = [];
|
|
159
164
|
|
|
160
|
-
const overrideMap =
|
|
165
|
+
const overrideMap = getImportMapOverrideMap(true).imports;
|
|
161
166
|
const notOverriddenKeys = Object.keys(state.notOverriddenMap.imports);
|
|
162
|
-
const disabledModules =
|
|
167
|
+
const disabledModules = getImportMapDisabledOverrides();
|
|
163
168
|
|
|
164
169
|
const searchableKeys = [...new Set([...notOverriddenKeys, ...Object.keys(overrideMap)])];
|
|
165
170
|
searchableKeys.sort();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect } from 'react';
|
|
2
|
+
import { getImportMapOverrideMap } from '@openmrs/esm-framework/src/internal';
|
|
2
3
|
import ImportMapList from './import-map-list/list.component';
|
|
3
4
|
import styles from './import-map.styles.css';
|
|
4
5
|
|
|
@@ -24,9 +25,9 @@ export default function ImportMap({ toggleOverridden }: ImportMapProps) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export function importMapOverridden(): boolean {
|
|
27
|
-
return Object.keys(
|
|
28
|
+
return Object.keys(getImportMapOverrideMap().imports).length > 0;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export function isOverriddenInImportMap(esmName: string): boolean {
|
|
31
|
-
return
|
|
32
|
+
return Object.hasOwn(getImportMapOverrideMap().imports, esmName);
|
|
32
33
|
}
|