@openmrs/esm-metadataexport-app 4.4.1-pre.809 → 4.4.1-pre.836
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/1118.css +1 -1
- package/dist/1118.css.map +1 -1
- package/dist/1118.js +1 -1
- package/dist/1118.js.map +1 -1
- package/dist/{4606.css.map → 2109.css.map} +1 -1
- package/dist/{4606.js → 2109.js} +10 -10
- package/dist/2109.js.map +1 -0
- package/dist/3566.js +1 -1
- package/dist/3566.js.map +1 -1
- package/dist/5065.js +1 -1
- package/dist/5065.js.map +1 -1
- package/dist/5117.js +1 -1
- package/dist/5117.js.map +1 -1
- package/dist/8359.js +1 -1
- package/dist/8359.js.map +1 -1
- package/dist/9503.js +1 -1
- package/dist/9503.js.map +1 -1
- package/dist/openmrs-esm-metadataexport-app.js +2 -2
- package/dist/openmrs-esm-metadataexport-app.js.buildmanifest.json +49 -49
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/components/metadata-export-header/metadata-export-header.component.tsx +2 -2
- package/src/components/metadata-export-header/metadata-export-header.scss +1 -3
- package/src/components/metadata-export-header/metadata-export-header.test.tsx +6 -0
- package/src/components/metadata-package-form/metadata-package-form.workspace.test.tsx +1 -0
- package/src/components/metadata-package-form/metadata-package-form.workspace.tsx +2 -11
- package/src/components/packages-table/packages-table.component.tsx +57 -36
- package/src/components/packages-table/packages-table.scss +4 -0
- package/src/components/packages-table/packages-table.test.tsx +101 -5
- package/src/components/view-metadata-package/delete-metadata-package.modal.test.tsx +1 -0
- package/src/components/view-metadata-package/delete-metadata-package.modal.tsx +2 -5
- package/src/components/view-metadata-package/view-metadata-package.workspace.test.tsx +1 -0
- package/src/components/view-metadata-package/view-metadata-package.workspace.tsx +1 -5
- package/src/packages/packages.resource.ts +14 -7
- package/translations/en.json +2 -0
- package/translations/ru_RU.json +8 -8
- package/dist/4606.js.map +0 -1
- /package/dist/{4606.css → 2109.css} +0 -0
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
|
-
import { type FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import { type FetchResponse, openmrsFetch, restBaseUrl, useOpenmrsPagination } from '@openmrs/esm-framework';
|
|
3
3
|
import type { ExportBuildStatus, ExportPackage, ExportPackageRequest, ExportPackageBuild } from '../types';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const packagesUrl = `${restBaseUrl}/metadataexport/packages`;
|
|
6
|
+
|
|
7
|
+
// useOpenmrsPagination keys the SWR cache with absolute URLs, so match on inclusion rather than prefix.
|
|
8
|
+
export const isPackagesCacheKey = (key: unknown) => typeof key === 'string' && key.includes(packagesUrl);
|
|
9
|
+
|
|
10
|
+
export function usePackages(pageSize: number, includeRetired = false) {
|
|
6
11
|
// entries and latestBuild are only present in the full representation.
|
|
7
12
|
const apiUrl = `${restBaseUrl}/metadataexport/packages?includeAll=${includeRetired}&v=full`;
|
|
8
|
-
const { data, error, isLoading, isValidating, mutate } =
|
|
9
|
-
|
|
10
|
-
Error
|
|
11
|
-
>(apiUrl, openmrsFetch);
|
|
13
|
+
const { data, error, isLoading, isValidating, currentPage, currentPageSize, totalCount, goTo, mutate } =
|
|
14
|
+
useOpenmrsPagination<ExportPackage>(apiUrl, pageSize, { swrConfig: { keepPreviousData: true } });
|
|
12
15
|
|
|
13
16
|
return {
|
|
14
|
-
packages: data
|
|
17
|
+
packages: data ?? [],
|
|
18
|
+
totalCount,
|
|
19
|
+
currentPage,
|
|
20
|
+
currentPageSize,
|
|
21
|
+
goTo,
|
|
15
22
|
isLoading,
|
|
16
23
|
isValidating,
|
|
17
24
|
error,
|
package/translations/en.json
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"managePackages": "Manage packages",
|
|
29
29
|
"metadataexport": "Metadata Export",
|
|
30
30
|
"newpackage": "New Package",
|
|
31
|
+
"nextPage": "Next page",
|
|
31
32
|
"noBuilds": "No builds",
|
|
32
33
|
"noBuildsYet": "No builds yet",
|
|
33
34
|
"notStarted": "Not started",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"packageUpdated": "Package updated",
|
|
45
46
|
"packageUpdatedSubtitle": "{{name}} was updated successfully",
|
|
46
47
|
"packageUpdateFailed": "Failed to update package",
|
|
48
|
+
"previousPage": "Previous page",
|
|
47
49
|
"QUEUED": "Queued",
|
|
48
50
|
"reason": "Reason",
|
|
49
51
|
"reasonPlaceholder": "Enter a reason for deleting this package",
|
package/translations/ru_RU.json
CHANGED
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"details": "Подробнее",
|
|
20
20
|
"domains": "Домены",
|
|
21
21
|
"download": "Скачать",
|
|
22
|
-
"edit": "
|
|
22
|
+
"edit": "Изменить",
|
|
23
23
|
"errorLoadingDomains": "Ошибка загрузки",
|
|
24
|
-
"errorLoadingPackage": "
|
|
24
|
+
"errorLoadingPackage": "Ошибка при загрузке пакета",
|
|
25
25
|
"FAILED": "Ошибка",
|
|
26
26
|
"loadingBuilds": "Загружаю сборки...",
|
|
27
|
-
"loadingPackage": "
|
|
27
|
+
"loadingPackage": "Загружаю пакет...",
|
|
28
28
|
"managePackages": "Управление",
|
|
29
29
|
"metadataexport": "Экспорт Метаданных",
|
|
30
30
|
"newpackage": "Новый",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"packageNamePlaceholder": "напр. Основные справочные данные",
|
|
42
42
|
"packages": "Пакеты",
|
|
43
43
|
"packages__lower": "пакеты",
|
|
44
|
-
"packageUpdated": "
|
|
45
|
-
"packageUpdatedSubtitle": "{{name}}
|
|
46
|
-
"packageUpdateFailed": "
|
|
44
|
+
"packageUpdated": "Пакет обновлен",
|
|
45
|
+
"packageUpdatedSubtitle": "{{name}} обновлен",
|
|
46
|
+
"packageUpdateFailed": "Сбой при обновлении пакета",
|
|
47
47
|
"QUEUED": "Запланировано",
|
|
48
48
|
"reason": "Причина",
|
|
49
49
|
"reasonPlaceholder": "Введите причину удаления пакета",
|
|
50
50
|
"RUNNING": "Выполняется",
|
|
51
|
-
"saveChanges": "
|
|
52
|
-
"saving": "
|
|
51
|
+
"saveChanges": "Сохранить изменения",
|
|
52
|
+
"saving": "Сохраняю",
|
|
53
53
|
"selectAll": "Все",
|
|
54
54
|
"startedAgo": "Начато {{time}} назад",
|
|
55
55
|
"status": "Состояние",
|