@openmrs/esm-openconceptlab-app 4.3.1-pre.534 → 4.4.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/.turbo/turbo-build.log +2 -2
- package/dist/1339.js +1 -0
- package/dist/1339.js.map +1 -0
- package/dist/1540.js +1 -1
- package/dist/1540.js.map +1 -1
- package/dist/335.js +1 -1
- package/dist/335.js.map +1 -1
- package/dist/3720.js +1 -0
- package/dist/3720.js.map +1 -0
- package/dist/3799.js +1 -1
- package/dist/3799.js.map +1 -1
- package/dist/3989.js +1 -0
- package/dist/3989.js.map +1 -0
- package/dist/5853.js +1 -0
- package/dist/5853.js.map +1 -0
- package/dist/7689.js +32 -0
- package/dist/7689.js.map +1 -0
- package/dist/9061.js +1 -1
- package/dist/9061.js.map +1 -1
- package/dist/9771.js +1 -1
- package/dist/9771.js.map +1 -1
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-openconceptlab-app.js +3 -3
- package/dist/openmrs-esm-openconceptlab-app.js.buildmanifest.json +135 -82
- package/dist/openmrs-esm-openconceptlab-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +8 -6
- package/src/import/import.component.tsx +3 -3
- package/src/import/import.test.tsx +12 -11
- package/src/previous-imports/import-overview/import-items.test.tsx +20 -10
- package/src/previous-imports/import-overview/import-overview.test.tsx +1 -0
- package/src/previous-imports/previous-imports.test.tsx +8 -7
- package/src/root.test.tsx +1 -0
- package/src/subscription/subscription.test.tsx +20 -19
- package/vitest.config.ts +4 -0
- package/dist/1442.js +0 -1
- package/dist/1442.js.map +0 -1
- package/dist/2152.js +0 -1
- package/dist/2152.js.map +0 -1
- package/dist/2255.js +0 -32
- package/dist/2255.js.map +0 -1
- package/dist/7209.js +0 -1
- package/dist/7209.js.map +0 -1
- package/jest.config.js +0 -3
|
@@ -17,14 +17,14 @@ import { showNotification } from '@openmrs/esm-framework';
|
|
|
17
17
|
import { startImportWithFile, startImportWithSubscription, useSubscription } from './import.resource';
|
|
18
18
|
import styles from './import.scss';
|
|
19
19
|
|
|
20
|
+
const allowedMimeTypes = ['application/zip', 'application/x-zip-compressed'];
|
|
21
|
+
|
|
20
22
|
const Import: React.FC = () => {
|
|
21
23
|
const { t } = useTranslation();
|
|
22
24
|
const [isSubscriptionAvailable, setIsSubscriptionAvailable] = useState(false);
|
|
23
25
|
const [file, setFile] = useState<File>();
|
|
24
26
|
const [isFileUploading, setIsFileUploading] = useState(false);
|
|
25
27
|
|
|
26
|
-
const allowedMimeTypes = ['application/zip', 'application/x-zip-compressed']
|
|
27
|
-
|
|
28
28
|
const { data: subscription, isLoading, error } = useSubscription();
|
|
29
29
|
|
|
30
30
|
useEffect(() => {
|
|
@@ -180,7 +180,7 @@ const Import: React.FC = () => {
|
|
|
180
180
|
/>
|
|
181
181
|
) : (
|
|
182
182
|
<FileUploaderDropContainer
|
|
183
|
-
accept={
|
|
183
|
+
accept={allowedMimeTypes}
|
|
184
184
|
multiple
|
|
185
185
|
labelText={t('importFromFileDragInfo', 'Drag and drop file here or click to upload')}
|
|
186
186
|
onAddFiles={onAddFiles}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { screen, waitFor } from '@testing-library/react';
|
|
4
5
|
import { type FetchResponse, openmrsFetch, showNotification } from '@openmrs/esm-framework';
|
|
@@ -7,23 +8,23 @@ import { renderWithSwr } from '@tools/test-helpers';
|
|
|
7
8
|
import { startImportWithSubscription } from './import.resource';
|
|
8
9
|
import Import from './import.component';
|
|
9
10
|
|
|
10
|
-
const mockOpenmrsFetch = openmrsFetch
|
|
11
|
-
const mockShowNotification =
|
|
12
|
-
const mockStartImportWithSubscription =
|
|
11
|
+
const mockOpenmrsFetch = vi.mocked(openmrsFetch);
|
|
12
|
+
const mockShowNotification = vi.mocked(showNotification);
|
|
13
|
+
const mockStartImportWithSubscription = vi.mocked(startImportWithSubscription);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
const originalModule =
|
|
15
|
+
vi.mock('./import.resource', async () => {
|
|
16
|
+
const originalModule = (await vi.importActual('./import.resource')) as object;
|
|
16
17
|
|
|
17
18
|
return {
|
|
18
19
|
...originalModule,
|
|
19
|
-
startImportWithSubscription:
|
|
20
|
-
startImportWithFile:
|
|
20
|
+
startImportWithSubscription: vi.fn(),
|
|
21
|
+
startImportWithFile: vi.fn(),
|
|
21
22
|
};
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
describe('Import component', () => {
|
|
25
26
|
it('renders the form elements', async () => {
|
|
26
|
-
mockOpenmrsFetch.
|
|
27
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [] } } as unknown as FetchResponse);
|
|
27
28
|
renderWithSwr(<Import />);
|
|
28
29
|
await waitForLoadingToFinish();
|
|
29
30
|
|
|
@@ -36,7 +37,7 @@ describe('Import component', () => {
|
|
|
36
37
|
});
|
|
37
38
|
|
|
38
39
|
it('renders correctly when there is no subscription', async () => {
|
|
39
|
-
mockOpenmrsFetch.
|
|
40
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [] } } as unknown as FetchResponse);
|
|
40
41
|
renderWithSwr(<Import />);
|
|
41
42
|
await waitForLoadingToFinish();
|
|
42
43
|
|
|
@@ -45,7 +46,7 @@ describe('Import component', () => {
|
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
it('renders correctly when when a subscription exists', async () => {
|
|
48
|
-
mockOpenmrsFetch.
|
|
49
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [mockSubscription] } } as unknown as FetchResponse);
|
|
49
50
|
renderWithSwr(<Import />);
|
|
50
51
|
await waitForLoadingToFinish();
|
|
51
52
|
|
|
@@ -55,7 +56,7 @@ describe('Import component', () => {
|
|
|
55
56
|
|
|
56
57
|
it('allows starting an import using the subscription', async () => {
|
|
57
58
|
const user = userEvent.setup();
|
|
58
|
-
mockOpenmrsFetch.
|
|
59
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [mockSubscription] } } as unknown as FetchResponse);
|
|
59
60
|
renderWithSwr(<Import />);
|
|
60
61
|
await waitForLoadingToFinish();
|
|
61
62
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
2
3
|
import { screen, waitFor } from '@testing-library/react';
|
|
3
|
-
import { usePagination } from '@openmrs/esm-framework';
|
|
4
|
+
import { type FetchResponse, usePagination } from '@openmrs/esm-framework';
|
|
5
|
+
import { type ImportItem } from '../../types';
|
|
4
6
|
import { renderWithSwr } from '@tools/test-helpers';
|
|
5
7
|
import { mockImportItems, mockPreviousImports } from '@mocks/openconceptlab.mock';
|
|
6
8
|
import { getImportDetails } from './import-items.resource';
|
|
@@ -10,26 +12,30 @@ const defaultProps = {
|
|
|
10
12
|
importUuid: mockPreviousImports[1].uuid,
|
|
11
13
|
};
|
|
12
14
|
|
|
13
|
-
const mockGetImportDetails = getImportDetails
|
|
14
|
-
const mockUsePagination = usePagination
|
|
15
|
+
const mockGetImportDetails = vi.mocked(getImportDetails);
|
|
16
|
+
const mockUsePagination = vi.mocked(usePagination);
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
const originalModule =
|
|
18
|
+
vi.mock('./import-items.resource', async () => {
|
|
19
|
+
const originalModule = (await vi.importActual('./import-items.resource')) as object;
|
|
18
20
|
|
|
19
21
|
return {
|
|
20
22
|
...originalModule,
|
|
21
|
-
getImportDetails:
|
|
23
|
+
getImportDetails: vi.fn(),
|
|
22
24
|
};
|
|
23
25
|
});
|
|
24
26
|
|
|
25
27
|
describe('Import items', () => {
|
|
26
28
|
it('renders a tabular overview', async () => {
|
|
27
|
-
mockGetImportDetails.
|
|
29
|
+
mockGetImportDetails.mockResolvedValue({
|
|
30
|
+
status: 200,
|
|
31
|
+
ok: true,
|
|
32
|
+
data: mockImportItems,
|
|
33
|
+
} as unknown as FetchResponse<{ results: ImportItem[] }>);
|
|
28
34
|
mockUsePagination.mockReturnValue({
|
|
29
35
|
currentPage: 1,
|
|
30
36
|
goTo: () => {},
|
|
31
37
|
results: mockImportItems,
|
|
32
|
-
});
|
|
38
|
+
} as unknown as ReturnType<typeof usePagination>);
|
|
33
39
|
renderWithSwr(<ImportItems {...defaultProps} />);
|
|
34
40
|
await waitForLoadingToFinish();
|
|
35
41
|
|
|
@@ -38,12 +44,16 @@ describe('Import items', () => {
|
|
|
38
44
|
});
|
|
39
45
|
|
|
40
46
|
it('renders the import items correctly', async () => {
|
|
41
|
-
mockGetImportDetails.
|
|
47
|
+
mockGetImportDetails.mockResolvedValue({
|
|
48
|
+
status: 200,
|
|
49
|
+
ok: true,
|
|
50
|
+
data: mockImportItems,
|
|
51
|
+
} as unknown as FetchResponse<{ results: ImportItem[] }>);
|
|
42
52
|
mockUsePagination.mockReturnValue({
|
|
43
53
|
currentPage: 1,
|
|
44
54
|
goTo: () => {},
|
|
45
55
|
results: mockImportItems,
|
|
46
|
-
});
|
|
56
|
+
} as unknown as ReturnType<typeof usePagination>);
|
|
47
57
|
renderWithSwr(<ImportItems {...defaultProps} />);
|
|
48
58
|
await waitForLoadingToFinish();
|
|
49
59
|
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
2
3
|
import { screen, waitFor } from '@testing-library/react';
|
|
3
|
-
import { formatDatetime, openmrsFetch, usePagination } from '@openmrs/esm-framework';
|
|
4
|
+
import { type FetchResponse, formatDatetime, openmrsFetch, usePagination } from '@openmrs/esm-framework';
|
|
4
5
|
import { renderWithSwr } from '@tools/test-helpers';
|
|
5
6
|
import { mockPreviousImports } from '@mocks/openconceptlab.mock';
|
|
6
7
|
import PreviousImports from './previous-imports.component';
|
|
7
8
|
|
|
8
|
-
const mockOpenmrsFetch = openmrsFetch
|
|
9
|
-
const mockUsePagination = usePagination
|
|
9
|
+
const mockOpenmrsFetch = vi.mocked(openmrsFetch);
|
|
10
|
+
const mockUsePagination = vi.mocked(usePagination);
|
|
10
11
|
|
|
11
12
|
describe('Previous imports', () => {
|
|
12
13
|
it('renders the table', async () => {
|
|
13
|
-
mockOpenmrsFetch.
|
|
14
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [] } } as unknown as FetchResponse);
|
|
14
15
|
mockUsePagination.mockReturnValue({
|
|
15
16
|
currentPage: 1,
|
|
16
17
|
goTo: () => {},
|
|
17
18
|
results: [],
|
|
18
|
-
});
|
|
19
|
+
} as unknown as ReturnType<typeof usePagination>);
|
|
19
20
|
renderWithSwr(<PreviousImports />);
|
|
20
21
|
await waitForLoadingToFinish();
|
|
21
22
|
|
|
@@ -26,12 +27,12 @@ describe('Previous imports', () => {
|
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
it('renders the previous imports correctly', async () => {
|
|
29
|
-
mockOpenmrsFetch.
|
|
30
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: mockPreviousImports } } as unknown as FetchResponse);
|
|
30
31
|
mockUsePagination.mockReturnValue({
|
|
31
32
|
currentPage: 1,
|
|
32
33
|
goTo: () => {},
|
|
33
34
|
results: mockPreviousImports,
|
|
34
|
-
});
|
|
35
|
+
} as unknown as ReturnType<typeof usePagination>);
|
|
35
36
|
renderWithSwr(<PreviousImports />);
|
|
36
37
|
await waitForLoadingToFinish();
|
|
37
38
|
|
package/src/root.test.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { screen, waitFor } from '@testing-library/react';
|
|
4
5
|
import { type FetchResponse, openmrsFetch, showNotification } from '@openmrs/esm-framework';
|
|
@@ -7,34 +8,34 @@ import { mockSubscription } from '@mocks/openconceptlab.mock';
|
|
|
7
8
|
import { deleteSubscription, updateSubscription } from './subscription.resource';
|
|
8
9
|
import Subscription from './subscription.component';
|
|
9
10
|
|
|
10
|
-
const mockOpenmrsFetch = openmrsFetch
|
|
11
|
-
const mockUpdateSubscription =
|
|
12
|
-
const mockDeleteSubscription =
|
|
13
|
-
const mockShowNotification =
|
|
11
|
+
const mockOpenmrsFetch = vi.mocked(openmrsFetch);
|
|
12
|
+
const mockUpdateSubscription = vi.mocked(updateSubscription);
|
|
13
|
+
const mockDeleteSubscription = vi.mocked(deleteSubscription);
|
|
14
|
+
const mockShowNotification = vi.mocked(showNotification);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
const originalModule =
|
|
16
|
+
vi.mock('./subscription.resource', async () => {
|
|
17
|
+
const originalModule = (await vi.importActual('./subscription.resource')) as object;
|
|
17
18
|
|
|
18
19
|
return {
|
|
19
20
|
...originalModule,
|
|
20
|
-
updateSubscription:
|
|
21
|
-
deleteSubscription:
|
|
21
|
+
updateSubscription: vi.fn(),
|
|
22
|
+
deleteSubscription: vi.fn(),
|
|
22
23
|
};
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
describe('Subscription component', () => {
|
|
26
27
|
it('renders the empty forms', async () => {
|
|
27
|
-
mockOpenmrsFetch.
|
|
28
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [] } } as unknown as FetchResponse);
|
|
28
29
|
renderWithSwr(<Subscription />);
|
|
29
30
|
await waitForLoadingToFinish();
|
|
30
31
|
|
|
31
32
|
expect(screen.getByText('Setup Subscription')).toBeVisible();
|
|
32
33
|
expect(screen.getByRole('heading', { name: 'Unsubscribe' })).toBeVisible();
|
|
33
|
-
expect(screen.getByRole('button', { name:
|
|
34
|
+
expect(screen.getByRole('button', { name: /danger\s*Unsubscribe/i })).toBeDisabled();
|
|
34
35
|
});
|
|
35
36
|
|
|
36
37
|
it('renders the subscription if a subscription exists', async () => {
|
|
37
|
-
mockOpenmrsFetch.
|
|
38
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [mockSubscription] } } as unknown as FetchResponse);
|
|
38
39
|
renderWithSwr(<Subscription />);
|
|
39
40
|
await waitForLoadingToFinish();
|
|
40
41
|
await waitForLoadingSubscription();
|
|
@@ -45,12 +46,12 @@ describe('Subscription component', () => {
|
|
|
45
46
|
expect(
|
|
46
47
|
screen.getByLabelText('Disable validation (should be used with care for well curated collections or sources)'),
|
|
47
48
|
).not.toBeChecked();
|
|
48
|
-
expect(screen.getByRole('button', { name:
|
|
49
|
+
expect(screen.getByRole('button', { name: /danger\s*Unsubscribe/i })).toBeEnabled();
|
|
49
50
|
});
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
it.skip('allows adding a new subscription', async () => {
|
|
52
53
|
const user = userEvent.setup();
|
|
53
|
-
mockOpenmrsFetch.
|
|
54
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [] } } as unknown as FetchResponse);
|
|
54
55
|
renderWithSwr(<Subscription />);
|
|
55
56
|
await waitForLoadingToFinish();
|
|
56
57
|
|
|
@@ -79,9 +80,9 @@ describe('Subscription component', () => {
|
|
|
79
80
|
expect(mockShowNotification).toHaveBeenCalledTimes(1);
|
|
80
81
|
});
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
it.skip('allows changing the saved subscription', async () => {
|
|
83
84
|
const user = userEvent.setup();
|
|
84
|
-
mockOpenmrsFetch.
|
|
85
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [mockSubscription] } } as unknown as FetchResponse);
|
|
85
86
|
renderWithSwr(<Subscription />);
|
|
86
87
|
await waitForLoadingToFinish();
|
|
87
88
|
await waitForLoadingSubscription();
|
|
@@ -117,14 +118,14 @@ describe('Subscription component', () => {
|
|
|
117
118
|
expect(mockShowNotification).toHaveBeenCalledTimes(1);
|
|
118
119
|
});
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
it.skip('allows removing the saved subscription', async () => {
|
|
121
122
|
const user = userEvent.setup();
|
|
122
|
-
mockOpenmrsFetch.
|
|
123
|
+
mockOpenmrsFetch.mockResolvedValueOnce({ data: { results: [mockSubscription] } } as unknown as FetchResponse);
|
|
123
124
|
renderWithSwr(<Subscription />);
|
|
124
125
|
await waitForLoadingToFinish();
|
|
125
126
|
await waitForLoadingSubscription();
|
|
126
127
|
|
|
127
|
-
const unsubscribeButton = screen.getByRole('button', { name:
|
|
128
|
+
const unsubscribeButton = screen.getByRole('button', { name: /danger\s*Unsubscribe/i });
|
|
128
129
|
|
|
129
130
|
mockDeleteSubscription.mockResolvedValueOnce({ status: 204 } as unknown as FetchResponse);
|
|
130
131
|
|
package/vitest.config.ts
ADDED
package/dist/1442.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_openconceptlab_app=globalThis.webpackChunk_openmrs_esm_openconceptlab_app||[]).push([["1442"],{9876(e,a,l){l.r(a),l.d(a,{default:()=>c,immutable:()=>n});var p=l(5216),t=l(2372);let n=e=>(a,l,p)=>(p.revalidateOnFocus=!1,p.revalidateIfStale=!1,p.revalidateOnReconnect=!1,e(a,l,p)),c=(0,t.Ht)(p.Ay,n)}}]);
|
package/dist/1442.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1442.js","sources":["webpack://@openmrs/esm-openconceptlab-app/../../node_modules/swr/dist/immutable/index.mjs"],"names":[],"mappings":"mOAGA,IAAM,EAAY,AAAC,GAAa,CAAC,EAAK,EAAS,KAEvC,EAAO,iBAAiB,CAAG,GAC3B,EAAO,iBAAiB,CAAG,GAC3B,EAAO,qBAAqB,CAAG,GACxB,EAAW,EAAK,EAAS,IAElC,EAAkB,SAAe,IAAM,CAAE,E"}
|
package/dist/2152.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_openconceptlab_app=globalThis.webpackChunk_openmrs_esm_openconceptlab_app||[]).push([["2152"],{2470(e,t,r){r.r(t),r.d(t,{default:()=>m,infinite:()=>k,unstable_serialize:()=>d});var a=r(2491),l=r(5216),n=r(4350),i=r(2372),u=r(8139);let s=()=>{},o=s(),c=Object,f=e=>e===o,p=new WeakMap,_=(e,t)=>c.prototype.toString.call(e)===`[object ${t}]`,b=0,g=e=>{let t,r,a=typeof e,l=_(e,"Date"),n=_(e,"RegExp"),i=_(e,"Object");if(c(e)!==e||l||n)t=l?e.toJSON():"symbol"==a?e.toString():"string"==a?JSON.stringify(e):""+e;else{if(t=p.get(e))return t;if(t=++b+"~",p.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=g(e[r])+",";p.set(e,t)}if(i){t="#";let a=c.keys(e).sort();for(;!f(r=a.pop());)f(e[r])||(t+=r+":"+g(e[r])+",");p.set(e,t)}}return t},y=e=>(e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?g(e):"",t]})(e?e(0,null):null)[0],d=e=>"$inf$"+y(e),h=Promise.resolve(),k=e=>(t,r,l)=>{let i,s=(0,a.useRef)(!1),{cache:o,initialSize:c=1,revalidateAll:f=!1,persistSize:p=!1,revalidateFirstPage:_=!0,revalidateOnMount:b=!1,parallel:g=!1}=l,[,,,d]=n.b.get(n.c);try{(i=y(t))&&(i="$inf$"+i)}catch(e){}let[k,m,z]=(0,n.z)(o,i),v=(0,a.useCallback)(()=>(0,n.e)(k()._l)?c:k()._l,[o,i,c]);(0,u.useSyncExternalStore)((0,a.useCallback)(e=>i?z(i,()=>{e()}):()=>{},[o,i]),v,v);let w=(0,a.useCallback)(()=>{let e=k()._l;return(0,n.e)(e)?c:e},[i,c]),C=(0,a.useRef)(w());(0,n.u)(()=>{if(!s.current){s.current=!0;return}i&&m({_l:p?C.current:w()})},[i,o]);let S=b&&!s.current,A=e(i,async e=>{let a=k()._i,i=k()._r;m({_r:n.U});let u=[],s=w(),[c]=(0,n.z)(o,e),p=c().data,b=[],y=null;for(let e=0;e<s;++e){let[s,c]=(0,n.s)(t(e,g?null:y));if(!s)break;let[h,k]=(0,n.z)(o,s),m=h().data,z=f||a||(0,n.e)(m)||_&&!e&&!(0,n.e)(p)||S||p&&!(0,n.e)(p[e])&&!l.compare(p[e],m);if(r&&("function"==typeof i?i(m,c):z)){let t=async()=>{if(s in d){let e=d[s];delete d[s],m=await e}else m=await r(c);k({data:m,_k:c}),u[e]=m};g?b.push(t):await t()}else u[e]=m;g||(y=m)}return g&&await Promise.all(b.map(e=>e())),m({_i:n.U}),u},l),$=(0,a.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},a=!1!==r.revalidate;return i?(a&&((0,n.e)(e)?m({_i:!0,_r:r.revalidate}):m({_i:!1,_r:r.revalidate})),arguments.length?A.mutate(e,{...r,revalidate:a}):A.mutate()):h},[i,o]),O=(0,a.useCallback)(e=>{let r;if(!i)return h;let[,a]=(0,n.z)(o,i);if((0,n.a)(e)?r=e(w()):"number"==typeof e&&(r=e),"number"!=typeof r)return h;a({_l:r}),C.current=r;let l=[],[u]=(0,n.z)(o,i),s=null;for(let e=0;e<r;++e){let[r]=(0,n.s)(t(e,s)),[a]=(0,n.z)(o,r),i=r?a().data:n.U;if((0,n.e)(i))return $(u().data);l.push(i),s=i}return $(l)},[i,o,$,w]);return{size:w(),setSize:O,mutate:$,get data(){return A.data},get error(){return A.error},get isValidating(){return A.isValidating},get isLoading(){return A.isLoading}}},m=(0,i.Ht)(l.Ay,k)}}]);
|
package/dist/2152.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2152.js","sources":["webpack://@openmrs/esm-openconceptlab-app/../../node_modules/swr/dist/infinite/index.mjs"],"names":["Object","WeakMap","t","i","JSON","Array","Promise","p","e","u","arguments"],"mappings":"yRAOA,IAAM,EAAO,KAAK,EAKZ,EAA8B,IAC9B,EAASA,OACT,EAAc,AAAC,GAAI,IAAM,EAOzB,EAAQ,IAAIC,QACZ,EAAe,CAAC,EAAOC,IAAO,E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