@terrestris/shogun-admin 16.1.0-next.1 → 17.0.0-next.2
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/package.json +74 -74
- package/dist/build/assets/App-BP74CNP_.js +0 -1258
- package/dist/build/assets/__federation_shared_react-CvClEUjg.js +0 -9
- package/dist/build/assets/__federation_shared_react-dom-BxqGBSTk.js +0 -24
- package/dist/build/assets/__federation_shared_react-i18next-MD_bYxcL.js +0 -1
- package/dist/build/assets/__federation_shared_react-router-dom-Vy7O6TNk.js +0 -2
- package/dist/build/assets/_commonjsHelpers-BosuxZz1.js +0 -1
- package/dist/build/assets/_virtual___federation_fn_import-PJHfB1tr.js +0 -1
- package/dist/build/assets/abap-DRC6TkPh.js +0 -6
- package/dist/build/assets/apex-BuapDI9Y.js +0 -6
- package/dist/build/assets/azcli-BypH-vXm.js +0 -6
- package/dist/build/assets/bat-BY6pwuIY.js +0 -6
- package/dist/build/assets/bicep-gRuQeaLk.js +0 -7
- package/dist/build/assets/cameligo-ul-Lp4lw.js +0 -6
- package/dist/build/assets/clojure-DeYg-96x.js +0 -6
- package/dist/build/assets/codicon-DCmgc-ay.ttf +0 -0
- package/dist/build/assets/coffee-CfnpWUYo.js +0 -6
- package/dist/build/assets/cpp-C9L3yaDO.js +0 -6
- package/dist/build/assets/csharp-DWGz5Zuj.js +0 -6
- package/dist/build/assets/csp-DrRCxMg5.js +0 -6
- package/dist/build/assets/css-BfLuTCmN.js +0 -8
- package/dist/build/assets/css.worker-BAJD-bzR.js +0 -83
- package/dist/build/assets/cssMode-Btzqpc23.js +0 -4
- package/dist/build/assets/cypher-DoFvH58O.js +0 -6
- package/dist/build/assets/dart-DIovg4uR.js +0 -6
- package/dist/build/assets/dockerfile-D2PfwrvU.js +0 -6
- package/dist/build/assets/ecl-C_scCXcs.js +0 -6
- package/dist/build/assets/editor.worker-MnaSPjGA.js +0 -11
- package/dist/build/assets/elixir-BRk-K-rg.js +0 -6
- package/dist/build/assets/favicon-CwZoocDV.ico +0 -0
- package/dist/build/assets/flow9-DLs3tTet.js +0 -6
- package/dist/build/assets/freemarker2-CoZuEXJi.js +0 -3
- package/dist/build/assets/fsharp-D0UiDa5C.js +0 -6
- package/dist/build/assets/go-CyVeKkvQ.js +0 -6
- package/dist/build/assets/graphql-BygKL3ZF.js +0 -6
- package/dist/build/assets/handlebars-BQ2vXFqT.js +0 -1
- package/dist/build/assets/hcl-D_OY6ada.js +0 -6
- package/dist/build/assets/html-S9BExIX4.js +0 -1
- package/dist/build/assets/html.worker-Bp7pNElH.js +0 -460
- package/dist/build/assets/htmlMode-D6oh_W-n.js +0 -4
- package/dist/build/assets/index-D5X_Cuhy.js +0 -139
- package/dist/build/assets/ini-BTpWsGps.js +0 -6
- package/dist/build/assets/java-3TATJI7h.js +0 -6
- package/dist/build/assets/javascript-C_BsKwTq.js +0 -1
- package/dist/build/assets/json.worker-BfIkrIax.js +0 -48
- package/dist/build/assets/jsonMode-CFQnTUoH.js +0 -10
- package/dist/build/assets/julia-DDpSJMW6.js +0 -6
- package/dist/build/assets/kotlin-DVYH6Lj_.js +0 -6
- package/dist/build/assets/less-CuFlys0T.js +0 -7
- package/dist/build/assets/lexon-m09vb5r-.js +0 -6
- package/dist/build/assets/liquid-CsJvQ-Gd.js +0 -1
- package/dist/build/assets/lua-D2Z7JJdl.js +0 -6
- package/dist/build/assets/m3-B2Cf9XSq.js +0 -6
- package/dist/build/assets/markdown-BXYnMxBe.js +0 -6
- package/dist/build/assets/mdx-CcsV6KQM.js +0 -1
- package/dist/build/assets/mips-Ckkbw-AO.js +0 -6
- package/dist/build/assets/msdax-B5uW3Zvf.js +0 -6
- package/dist/build/assets/mysql-B8ssZoUh.js +0 -6
- package/dist/build/assets/objective-c-CrrKwR0a.js +0 -6
- package/dist/build/assets/pascal-BWBTHuhh.js +0 -6
- package/dist/build/assets/pascaligo-BGLI1Hdo.js +0 -6
- package/dist/build/assets/perl-DDrv2Hr-.js +0 -6
- package/dist/build/assets/pgsql-DLPipH_Q.js +0 -6
- package/dist/build/assets/php-CTNlIIiR.js +0 -6
- package/dist/build/assets/pla-2oJWbEOo.js +0 -6
- package/dist/build/assets/postiats-DOk3G3cc.js +0 -6
- package/dist/build/assets/powerquery-Dgyr3wWZ.js +0 -6
- package/dist/build/assets/powershell-B_i9asfM.js +0 -6
- package/dist/build/assets/protobuf-CV9EbfTh.js +0 -7
- package/dist/build/assets/pug-CCBS_C5_.js +0 -6
- package/dist/build/assets/python-BNsLUA-F.js +0 -1
- package/dist/build/assets/qsharp-BLuZWbUW.js +0 -6
- package/dist/build/assets/r-CzF1MCbP.js +0 -6
- package/dist/build/assets/razor-CwLyy1uA.js +0 -1
- package/dist/build/assets/redis-C75U4IDy.js +0 -6
- package/dist/build/assets/redshift-Bc5xkKR1.js +0 -6
- package/dist/build/assets/restructuredtext-DmdQbaLT.js +0 -6
- package/dist/build/assets/ruby-DB0RB20n.js +0 -6
- package/dist/build/assets/rust-UMmp-gVE.js +0 -6
- package/dist/build/assets/sb-DVG02705.js +0 -6
- package/dist/build/assets/scala-DvSxYeG4.js +0 -6
- package/dist/build/assets/scheme-yf5bffbF.js +0 -6
- package/dist/build/assets/scss-Bzb7OGdO.js +0 -8
- package/dist/build/assets/shell-FNqbgIOG.js +0 -6
- package/dist/build/assets/shogun-spinner-BmOUi9Ar.gif +0 -0
- package/dist/build/assets/shogun_logo-B9ohJOpL.png +0 -0
- package/dist/build/assets/solidity-DyKutqhl.js +0 -6
- package/dist/build/assets/sophia-B4VqtPa2.js +0 -6
- package/dist/build/assets/sparql-B7alP455.js +0 -6
- package/dist/build/assets/sql-D7lU1fdU.js +0 -6
- package/dist/build/assets/st-VuadG5SK.js +0 -6
- package/dist/build/assets/style-CJpWC7V3.css +0 -1
- package/dist/build/assets/swift-BYtUz8ZP.js +0 -8
- package/dist/build/assets/systemverilog-DOAuugfS.js +0 -6
- package/dist/build/assets/tcl-CXKOl_mN.js +0 -6
- package/dist/build/assets/ts.worker-BBBnYv8q.js +0 -51333
- package/dist/build/assets/tsMode-meseu6bK.js +0 -11
- package/dist/build/assets/twig-D9yiNO04.js +0 -6
- package/dist/build/assets/typescript-BuOvk1sq.js +0 -1
- package/dist/build/assets/typespec-BupSXVCO.js +0 -6
- package/dist/build/assets/vb-ZlaFEk-P.js +0 -6
- package/dist/build/assets/wgsl-DrbANKle.js +0 -303
- package/dist/build/assets/xml-BXx9C-xA.js +0 -1
- package/dist/build/assets/yaml-CuMedh6B.js +0 -1
- package/dist/build/index.html +0 -24
- package/dist/lib/App.d.ts +0 -4
- package/dist/lib/App.js +0 -122
- package/dist/lib/Component/Dashboard/Dashboard.d.ts +0 -12
- package/dist/lib/Component/Dashboard/Dashboard.js +0 -10
- package/dist/lib/Component/Dashboard/DashboardCard/DashboardCard.d.ts +0 -13
- package/dist/lib/Component/Dashboard/DashboardCard/DashboardCard.js +0 -7
- package/dist/lib/Component/Dashboard/DashboardStatistics/DashboardStatistics.d.ts +0 -15
- package/dist/lib/Component/Dashboard/DashboardStatistics/DashboardStatistics.js +0 -30
- package/dist/lib/Component/EvictCache/EvictCache.d.ts +0 -6
- package/dist/lib/Component/EvictCache/EvictCache.js +0 -28
- package/dist/lib/Component/FormField/DisplayField/DisplayField.d.ts +0 -13
- package/dist/lib/Component/FormField/DisplayField/DisplayField.js +0 -32
- package/dist/lib/Component/FormField/JSONEditor/JSONEditor.d.ts +0 -13
- package/dist/lib/Component/FormField/JSONEditor/JSONEditor.js +0 -90
- package/dist/lib/Component/FormField/JSONEditor/UserWorker.d.ts +0 -1
- package/dist/lib/Component/FormField/JSONEditor/UserWorker.js +0 -26
- package/dist/lib/Component/FormField/LinkField/LinkField.d.ts +0 -11
- package/dist/lib/Component/FormField/LinkField/LinkField.js +0 -15
- package/dist/lib/Component/FormField/MarkdownEditor/MarkdownEditor.d.ts +0 -10
- package/dist/lib/Component/FormField/MarkdownEditor/MarkdownEditor.js +0 -23
- package/dist/lib/Component/FormField/Permission/GroupPermissionGrid/GroupPermissionGrid.d.ts +0 -7
- package/dist/lib/Component/FormField/Permission/GroupPermissionGrid/GroupPermissionGrid.js +0 -73
- package/dist/lib/Component/FormField/Permission/InstancePermissionGrid/InstancePermissionGrid.d.ts +0 -30
- package/dist/lib/Component/FormField/Permission/InstancePermissionGrid/InstancePermissionGrid.js +0 -151
- package/dist/lib/Component/FormField/Permission/PermissionModal/PermissionModal.d.ts +0 -28
- package/dist/lib/Component/FormField/Permission/PermissionModal/PermissionModal.js +0 -103
- package/dist/lib/Component/FormField/Permission/PermissionSelect/PermissionSelect.d.ts +0 -6
- package/dist/lib/Component/FormField/Permission/PermissionSelect/PermissionSelect.js +0 -21
- package/dist/lib/Component/FormField/Permission/RolePermissionGrid/RolePermissionGrid.d.ts +0 -7
- package/dist/lib/Component/FormField/Permission/RolePermissionGrid/RolePermissionGrid.js +0 -81
- package/dist/lib/Component/FormField/Permission/UserPermissionGrid/UserPermissionGrid.d.ts +0 -8
- package/dist/lib/Component/FormField/Permission/UserPermissionGrid/UserPermissionGrid.js +0 -87
- package/dist/lib/Component/FormField/VerifyProviderDetailsField/VerifyProviderDetailsField.d.ts +0 -13
- package/dist/lib/Component/FormField/VerifyProviderDetailsField/VerifyProviderDetailsField.js +0 -14
- package/dist/lib/Component/FormField/YesOrNoField/YesOrNoField.d.ts +0 -8
- package/dist/lib/Component/FormField/YesOrNoField/YesOrNoField.js +0 -10
- package/dist/lib/Component/FullscreenWrapper/FullscreenWrapper.d.ts +0 -4
- package/dist/lib/Component/FullscreenWrapper/FullscreenWrapper.js +0 -48
- package/dist/lib/Component/GeneralEntity/GeneralEntityForm/GeneralEntityForm.d.ts +0 -43
- package/dist/lib/Component/GeneralEntity/GeneralEntityForm/GeneralEntityForm.js +0 -145
- package/dist/lib/Component/GeneralEntity/GeneralEntityRoot/GeneralEntityRoot.d.ts +0 -22
- package/dist/lib/Component/GeneralEntity/GeneralEntityRoot/GeneralEntityRoot.js +0 -527
- package/dist/lib/Component/GeneralEntity/GeneralEntityTable/GeneralEntityTable.d.ts +0 -46
- package/dist/lib/Component/GeneralEntity/GeneralEntityTable/GeneralEntityTable.js +0 -179
- package/dist/lib/Component/GlobalSettings/GlobalSettingsRoot/GlobalSettingsRoot.d.ts +0 -5
- package/dist/lib/Component/GlobalSettings/GlobalSettingsRoot/GlobalSettingsRoot.js +0 -15
- package/dist/lib/Component/Header/Header.d.ts +0 -8
- package/dist/lib/Component/Header/Header.js +0 -16
- package/dist/lib/Component/ImageFile/ImageFileForm/ImageFileForm.d.ts +0 -7
- package/dist/lib/Component/ImageFile/ImageFileForm/ImageFileForm.js +0 -94
- package/dist/lib/Component/ImageFile/ImageFileRoot/ImageFileRoot.d.ts +0 -7
- package/dist/lib/Component/ImageFile/ImageFileRoot/ImageFileRoot.js +0 -44
- package/dist/lib/Component/ImageFile/ImageFileTable/ImageFileTable.d.ts +0 -9
- package/dist/lib/Component/ImageFile/ImageFileTable/ImageFileTable.js +0 -157
- package/dist/lib/Component/LanguageSelector/index.d.ts +0 -4
- package/dist/lib/Component/LanguageSelector/index.js +0 -15
- package/dist/lib/Component/Layer/LayerTypeSelect/LayerTypeSelect.d.ts +0 -11
- package/dist/lib/Component/Layer/LayerTypeSelect/LayerTypeSelect.js +0 -33
- package/dist/lib/Component/LayerPreview/LayerPreview.d.ts +0 -9
- package/dist/lib/Component/LayerPreview/LayerPreview.js +0 -159
- package/dist/lib/Component/LayerPreview/MapComponent/MapComponent.d.ts +0 -10
- package/dist/lib/Component/LayerPreview/MapComponent/MapComponent.js +0 -22
- package/dist/lib/Component/LogSettings/LogLevelSelect/LogLevelSelect.d.ts +0 -7
- package/dist/lib/Component/LogSettings/LogLevelSelect/LogLevelSelect.js +0 -20
- package/dist/lib/Component/LogSettings/LogLevelTable/LogLevelTable.d.ts +0 -12
- package/dist/lib/Component/LogSettings/LogLevelTable/LogLevelTable.js +0 -73
- package/dist/lib/Component/LogSettings/LogSettingsRoot/LogSettingsRoot.d.ts +0 -4
- package/dist/lib/Component/LogSettings/LogSettingsRoot/LogSettingsRoot.js +0 -11
- package/dist/lib/Component/Logs/Logs.d.ts +0 -5
- package/dist/lib/Component/Logs/Logs.js +0 -58
- package/dist/lib/Component/Menu/Navigation/Navigation.d.ts +0 -10
- package/dist/lib/Component/Menu/Navigation/Navigation.js +0 -96
- package/dist/lib/Component/Menu/User/User.d.ts +0 -7
- package/dist/lib/Component/Menu/User/User.js +0 -91
- package/dist/lib/Component/Metrics/JdbcConnectionsActive/JdbcConnectionsActive.d.ts +0 -6
- package/dist/lib/Component/Metrics/JdbcConnectionsActive/JdbcConnectionsActive.js +0 -7
- package/dist/lib/Component/Metrics/JvmMemoryUsed/JvmMemoryUsed.d.ts +0 -6
- package/dist/lib/Component/Metrics/JvmMemoryUsed/JvmMemoryUsed.js +0 -13
- package/dist/lib/Component/Metrics/JvmThreadsLive/JvmThreadsLive.d.ts +0 -6
- package/dist/lib/Component/Metrics/JvmThreadsLive/JvmThreadsLive.js +0 -7
- package/dist/lib/Component/Metrics/MetricEntry/MetricEntry.d.ts +0 -13
- package/dist/lib/Component/Metrics/MetricEntry/MetricEntry.js +0 -54
- package/dist/lib/Component/Metrics/MetricsRoot/MetricsRoot.d.ts +0 -12
- package/dist/lib/Component/Metrics/MetricsRoot/MetricsRoot.js +0 -28
- package/dist/lib/Component/Metrics/ProcessCpuUsage/ProcessCpuUsage.d.ts +0 -6
- package/dist/lib/Component/Metrics/ProcessCpuUsage/ProcessCpuUsage.js +0 -7
- package/dist/lib/Component/Metrics/ProcessStartTime/ProcessStartTime.d.ts +0 -6
- package/dist/lib/Component/Metrics/ProcessStartTime/ProcessStartTime.js +0 -12
- package/dist/lib/Component/Metrics/ProcessUptime/ProcessUptime.d.ts +0 -6
- package/dist/lib/Component/Metrics/ProcessUptime/ProcessUptime.js +0 -15
- package/dist/lib/Component/Metrics/SystemCpuCount/SystemCpuCount.d.ts +0 -6
- package/dist/lib/Component/Metrics/SystemCpuCount/SystemCpuCount.js +0 -7
- package/dist/lib/Component/Metrics/SystemCpuUsage/SystemCpuUsage.d.ts +0 -6
- package/dist/lib/Component/Metrics/SystemCpuUsage/SystemCpuUsage.js +0 -7
- package/dist/lib/Component/Metrics/SystemLoadAverage/SystemLoadAverage.d.ts +0 -6
- package/dist/lib/Component/Metrics/SystemLoadAverage/SystemLoadAverage.js +0 -7
- package/dist/lib/Component/Modal/ApplicationInfo/ApplicationInfo.d.ts +0 -7
- package/dist/lib/Component/Modal/ApplicationInfo/ApplicationInfo.js +0 -18
- package/dist/lib/Component/ShogunSpinner/ShogunSpinner.d.ts +0 -5
- package/dist/lib/Component/ShogunSpinner/ShogunSpinner.js +0 -7
- package/dist/lib/Component/UserAvatar/UserAvatar.d.ts +0 -9
- package/dist/lib/Component/UserAvatar/UserAvatar.js +0 -13
- package/dist/lib/Component/WelcomeDashboard/WelcomeDashboard.d.ts +0 -5
- package/dist/lib/Component/WelcomeDashboard/WelcomeDashboard.js +0 -35
- package/dist/lib/Context/PluginContext.d.ts +0 -9
- package/dist/lib/Context/PluginContext.js +0 -7
- package/dist/lib/Context/SHOGunAPIClientContext.d.ts +0 -9
- package/dist/lib/Context/SHOGunAPIClientContext.js +0 -7
- package/dist/lib/Controller/ControllerUtil.d.ts +0 -27
- package/dist/lib/Controller/ControllerUtil.js +0 -60
- package/dist/lib/Controller/GenericEntityController.d.ts +0 -169
- package/dist/lib/Controller/GenericEntityController.js +0 -368
- package/dist/lib/Hooks/useClientVersion.d.ts +0 -1
- package/dist/lib/Hooks/useClientVersion.js +0 -3
- package/dist/lib/Hooks/usePlugins.d.ts +0 -3
- package/dist/lib/Hooks/usePlugins.js +0 -6
- package/dist/lib/Hooks/useSHOGunAPIClient.d.ts +0 -3
- package/dist/lib/Hooks/useSHOGunAPIClient.js +0 -6
- package/dist/lib/Logger.d.ts +0 -2
- package/dist/lib/Logger.js +0 -23
- package/dist/lib/Page/Portal/Portal.d.ts +0 -7
- package/dist/lib/Page/Portal/Portal.js +0 -74
- package/dist/lib/Service/GenericServiceImpl/GenericServiceImpl.d.ts +0 -5
- package/dist/lib/Service/GenericServiceImpl/GenericServiceImpl.js +0 -7
- package/dist/lib/Service/LogService/LogService.d.ts +0 -18
- package/dist/lib/Service/LogService/LogService.js +0 -79
- package/dist/lib/Service/MetricService/MetricService.d.ts +0 -26
- package/dist/lib/Service/MetricService/MetricService.js +0 -25
- package/dist/lib/State/atoms.d.ts +0 -7
- package/dist/lib/State/atoms.js +0 -25
- package/dist/lib/State/static.d.ts +0 -3
- package/dist/lib/State/static.js +0 -10
- package/dist/lib/Util/FileUtil.d.ts +0 -3
- package/dist/lib/Util/FileUtil.js +0 -10
- package/dist/lib/Util/JsonUtil.d.ts +0 -11
- package/dist/lib/Util/JsonUtil.js +0 -22
- package/dist/lib/Util/OpenAPIUtil.d.ts +0 -25
- package/dist/lib/Util/OpenAPIUtil.js +0 -230
- package/dist/lib/Util/TableUtil.d.ts +0 -14
- package/dist/lib/Util/TableUtil.js +0 -71
- package/dist/lib/Util/TranslationUtil.d.ts +0 -3
- package/dist/lib/Util/TranslationUtil.js +0 -23
- package/dist/lib/Util/UserUtil.d.ts +0 -22
- package/dist/lib/Util/UserUtil.js +0 -32
- package/dist/lib/i18n/index.d.ts +0 -2
- package/dist/lib/i18n/index.js +0 -17
- package/dist/lib/i18n/translations.d.ts +0 -508
- package/dist/lib/i18n/translations.js +0 -512
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -172
- package/dist/lib/plugin/index.d.ts +0 -58
- package/dist/lib/plugin/index.js +0 -3
- package/dist/lib/test-util.d.ts +0 -6
- package/dist/lib/test-util.js +0 -16
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { createElement as _createElement } from "react";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import './GeneralEntityTable.less';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
import { DeleteOutlined, SyncOutlined } from '@ant-design/icons';
|
|
6
|
-
import { Input, Modal, notification, Table, Tooltip } from 'antd';
|
|
7
|
-
import Logger from 'js-logger';
|
|
8
|
-
import _cloneDeep from 'lodash/cloneDeep';
|
|
9
|
-
import _isEmpty from 'lodash/isEmpty';
|
|
10
|
-
import _isNil from 'lodash/isNil';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
import { useNavigate } from 'react-router-dom';
|
|
13
|
-
import config from 'shogunApplicationConfig';
|
|
14
|
-
import TableUtil from '../../../Util/TableUtil';
|
|
15
|
-
import TranslationUtil from '../../../Util/TranslationUtil';
|
|
16
|
-
import DisplayField from '../../FormField/DisplayField/DisplayField';
|
|
17
|
-
import LinkField from '../../FormField/LinkField/LinkField';
|
|
18
|
-
import VerifyProviderDetailsField from '../../FormField/VerifyProviderDetailsField/VerifyProviderDetailsField';
|
|
19
|
-
import LayerPreview from '../../LayerPreview/LayerPreview';
|
|
20
|
-
export function GeneralEntityTable({ actions = ['delete'], controller, entities, entityType, fetchEntities = () => undefined, i18n, tableConfig, ...tablePassThroughProps }) {
|
|
21
|
-
const routePath = useMemo(() => `${config.appPrefix}/portal/${entityType}`, [entityType]);
|
|
22
|
-
const navigate = useNavigate();
|
|
23
|
-
const { t } = useTranslation();
|
|
24
|
-
const onRowClick = (record) => navigate(`${routePath}/${record.id}`);
|
|
25
|
-
const onDeleteClick = async (record) => {
|
|
26
|
-
const entityId = record?.id;
|
|
27
|
-
if (!entityId) {
|
|
28
|
-
fetchEntities();
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
let entityName = record.name || record.title;
|
|
32
|
-
if (!entityName) {
|
|
33
|
-
entityName = entityId;
|
|
34
|
-
}
|
|
35
|
-
let confirmName;
|
|
36
|
-
Modal.confirm({
|
|
37
|
-
cancelText: t('GeneralEntityTable.cancelText'),
|
|
38
|
-
title: t('GeneralEntityTable.title'),
|
|
39
|
-
content: (_jsxs("div", { children: [_jsx("div", { children: t('GeneralEntityTable.contentInfo', { entityName: entityName }) }), _jsx("br", {}), _jsx("div", { children: t('GeneralEntityTable.contentConfirmInfo') }), _jsx(Input, { onChange: (e) => { confirmName = e.target.value; } })] })),
|
|
40
|
-
onOk: async () => {
|
|
41
|
-
let isCheck = typeof entityName === 'string' ?
|
|
42
|
-
confirmName === TranslationUtil.getTranslationFromConfig(entityName, i18n) :
|
|
43
|
-
parseInt(confirmName, 10) === entityName;
|
|
44
|
-
if (isCheck) {
|
|
45
|
-
try {
|
|
46
|
-
await controller?.delete(record);
|
|
47
|
-
notification.info({
|
|
48
|
-
message: t('GeneralEntityTable.deleteConfirm'),
|
|
49
|
-
description: t('GeneralEntityTable.deleteConfirmDescript', { entityName: entityName })
|
|
50
|
-
});
|
|
51
|
-
fetchEntities();
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
notification.error({
|
|
55
|
-
message: t('GeneralEntityTable.deleteFail'),
|
|
56
|
-
description: t('GeneralEntityTable.deleteFailDescript', { entityName: entityName })
|
|
57
|
-
});
|
|
58
|
-
Logger.error(error);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
const getRenderer = (cellRendererName, cellRenderComponentProps, mapping) => (value, record) => {
|
|
65
|
-
const displayValue = mapping ? mapping[value] : value;
|
|
66
|
-
if (cellRendererName === 'JSONCell') {
|
|
67
|
-
return (_jsx(DisplayField, { value: displayValue, format: "json", ...cellRenderComponentProps }));
|
|
68
|
-
}
|
|
69
|
-
if (cellRendererName === 'DateCell') {
|
|
70
|
-
return (_jsx(DisplayField, { value: displayValue, format: "date", ...cellRenderComponentProps }));
|
|
71
|
-
}
|
|
72
|
-
if (cellRendererName === 'LinkCell') {
|
|
73
|
-
return (_jsx(LinkField, { i18n: i18n, value: displayValue, ...cellRenderComponentProps }));
|
|
74
|
-
}
|
|
75
|
-
if (cellRendererName === 'LayerPreviewCell') {
|
|
76
|
-
if (!isLayerType(record)) {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
return (_jsx(LayerPreview, { layer: record, ...cellRenderComponentProps }));
|
|
80
|
-
}
|
|
81
|
-
if (cellRendererName === 'VerifyProviderDetailsCell') {
|
|
82
|
-
return (_jsx(VerifyProviderDetailsField, { i18n: i18n, value: displayValue, record: record, ...cellRenderComponentProps }));
|
|
83
|
-
}
|
|
84
|
-
return _jsx(_Fragment, { children: displayValue });
|
|
85
|
-
};
|
|
86
|
-
const isLayerType = (entity) => {
|
|
87
|
-
return Object.hasOwn(entity, 'type') && Object.hasOwn(entity, 'sourceConfig');
|
|
88
|
-
};
|
|
89
|
-
const getTableColumns = () => {
|
|
90
|
-
let cols;
|
|
91
|
-
if (_isEmpty(tableConfig?.columnDefinition)) {
|
|
92
|
-
cols = [{
|
|
93
|
-
title: t('GeneralEntityTable.columnId'),
|
|
94
|
-
key: 'id',
|
|
95
|
-
dataIndex: 'id',
|
|
96
|
-
sorter: TableUtil.getSorter('id'),
|
|
97
|
-
defaultSortOrder: 'ascend'
|
|
98
|
-
}, {
|
|
99
|
-
title: t('GeneralEntityTable.columnName'),
|
|
100
|
-
dataIndex: 'name',
|
|
101
|
-
key: 'name',
|
|
102
|
-
sorter: TableUtil.getSorter('name'),
|
|
103
|
-
defaultSortOrder: 'ascend',
|
|
104
|
-
...TableUtil.getColumnSearchProps('name')
|
|
105
|
-
}];
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
// check for preconfigured sorters, filters and custom components (TODO)
|
|
109
|
-
cols = tableConfig?.columnDefinition?.map(cfg => {
|
|
110
|
-
let copyCfg = _cloneDeep(cfg);
|
|
111
|
-
copyCfg.title = TranslationUtil.getTranslationFromConfig(cfg.title, i18n);
|
|
112
|
-
const { sortConfig, filterConfig, cellRenderComponentName, cellRenderComponentProps } = copyCfg;
|
|
113
|
-
let columnDef = copyCfg;
|
|
114
|
-
if (!_isEmpty(sortConfig) && sortConfig.isSortable) {
|
|
115
|
-
columnDef = {
|
|
116
|
-
...columnDef,
|
|
117
|
-
sorter: columnDef.dataIndex === 'name' ? TableUtil.getSorter('name') : true,
|
|
118
|
-
defaultSortOrder: columnDef.dataIndex === 'name' ? 'ascend' : sortConfig.sortOrder
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
let dataIndex = copyCfg?.dataIndex?.toString();
|
|
122
|
-
if (!_isEmpty(filterConfig) && filterConfig.isFilterable) {
|
|
123
|
-
columnDef = {
|
|
124
|
-
...columnDef,
|
|
125
|
-
...TableUtil.getColumnSearchProps(dataIndex)
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
const mapping = tableConfig.dataMapping?.[dataIndex];
|
|
129
|
-
if (!_isEmpty(cellRenderComponentName)) {
|
|
130
|
-
columnDef = {
|
|
131
|
-
...columnDef,
|
|
132
|
-
render: getRenderer(cellRenderComponentName, cellRenderComponentProps, mapping)
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return columnDef;
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
let retArray = [];
|
|
139
|
-
if (!_isNil(cols)) {
|
|
140
|
-
retArray.push(...cols);
|
|
141
|
-
}
|
|
142
|
-
retArray.push({
|
|
143
|
-
title: (_jsx(Tooltip, { title: t('GeneralEntityTable.tooltipReload'), children: _jsx(SyncOutlined, { onClick: fetchEntities }) })),
|
|
144
|
-
className: 'operation-column',
|
|
145
|
-
width: 100,
|
|
146
|
-
dataIndex: 'operation',
|
|
147
|
-
key: 'operation',
|
|
148
|
-
render: (_, record) => {
|
|
149
|
-
return (_jsx("div", { className: "actions", children: actions.includes('delete') &&
|
|
150
|
-
_jsx(Tooltip, { title: t('GeneralEntityTable.tooltipDelete'), children: _jsx(DeleteOutlined, { onClick: () => onDeleteClick(record) }) }) }));
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
return retArray;
|
|
154
|
-
};
|
|
155
|
-
return (_createElement(Table, { className: "general-entity-table", columns: getTableColumns(), locale: {
|
|
156
|
-
filterTitle: t('Table.filterTitle'),
|
|
157
|
-
filterConfirm: t('Table.filterConfirm'),
|
|
158
|
-
filterReset: t('Table.filterReset'),
|
|
159
|
-
filterEmptyText: t('Table.filterEmptyText'),
|
|
160
|
-
filterCheckall: t('Table.filterCheckall'),
|
|
161
|
-
filterSearchPlaceholder: t('Table.filterSearchPlaceholder'),
|
|
162
|
-
emptyText: t('Table.emptyText'),
|
|
163
|
-
selectAll: t('Table.selectAll'),
|
|
164
|
-
selectInvert: t('Table.selectInvert'),
|
|
165
|
-
selectNone: t('Table.selectNone'),
|
|
166
|
-
selectionAll: t('Table.selectionAll'),
|
|
167
|
-
sortTitle: t('Table.sortTitle'),
|
|
168
|
-
expand: t('Table.expand'),
|
|
169
|
-
collapse: t('Table.collapse'),
|
|
170
|
-
triggerDesc: t('Table.triggerDesc'),
|
|
171
|
-
triggerAsc: t('Table.triggerAsc'),
|
|
172
|
-
cancelSort: t('Table.cancelSort')
|
|
173
|
-
}, dataSource: entities, onRow: (record) => {
|
|
174
|
-
return {
|
|
175
|
-
onClick: () => onRowClick(record)
|
|
176
|
-
};
|
|
177
|
-
}, rowKey: 'id', ...tablePassThroughProps, key: entityType }));
|
|
178
|
-
}
|
|
179
|
-
export default GeneralEntityTable;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './GlobalSettingsRoot.less';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { PageHeader } from '@ant-design/pro-components';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { useNavigate } from 'react-router-dom';
|
|
7
|
-
import EvictCache from '../../../Component/EvictCache/EvictCache';
|
|
8
|
-
export const GlobalSettings = (props) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
}, []);
|
|
13
|
-
return (_jsxs("div", { className: "global-settings-root", children: [_jsx(PageHeader, { className: "header", onBack: () => navigate(-1), title: t('GlobalSettings.global'), subTitle: t('GlobalSettings.globalInfo') }), _jsx("div", { className: "global-settings-container", children: _jsx(EvictCache, {}) })] }));
|
|
14
|
-
};
|
|
15
|
-
export default GlobalSettings;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './Header.less';
|
|
3
|
-
import { PageHeader } from '@ant-design/pro-components';
|
|
4
|
-
import { Link } from 'react-router-dom';
|
|
5
|
-
import config from 'shogunApplicationConfig';
|
|
6
|
-
import defaultLogo from '../../../assets/img/shogun_logo.png';
|
|
7
|
-
import LanguageSelect from '../LanguageSelector';
|
|
8
|
-
import User from '../Menu/User/User';
|
|
9
|
-
export const Header = () => {
|
|
10
|
-
const logo = config.path?.logo || defaultLogo;
|
|
11
|
-
return (_jsx("header", { children: _jsx(PageHeader, { className: "page-header", title: _jsxs(Link, { to: `${config.appPrefix}/portal`, className: "header-link", children: [_jsx("img", { className: "header-logo", src: logo }), "SHOGun Admin"] }), extra: [
|
|
12
|
-
_jsx(LanguageSelect, {}, "languageselect"),
|
|
13
|
-
_jsx(User, {}, "user")
|
|
14
|
-
] }) }));
|
|
15
|
-
};
|
|
16
|
-
export default Header;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import './ImageFileForm.less';
|
|
3
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
-
import { PageHeader } from '@ant-design/pro-components';
|
|
5
|
-
import { Form, Spin, Switch } from 'antd';
|
|
6
|
-
import _isNil from 'lodash/isNil';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { matchPath, useLocation } from 'react-router-dom';
|
|
9
|
-
import config from 'shogunApplicationConfig';
|
|
10
|
-
import { getBearerTokenHeader } from '@terrestris/shogun-util/dist/security/getBearerTokenHeader';
|
|
11
|
-
import useSHOGunAPIClient from '../../../Hooks/useSHOGunAPIClient';
|
|
12
|
-
export const ImageFileForm = () => {
|
|
13
|
-
const [fileBlob, setFileBlob] = useState();
|
|
14
|
-
const [file, setFile] = useState();
|
|
15
|
-
const [isPublic, setPublic] = useState(false);
|
|
16
|
-
const location = useLocation();
|
|
17
|
-
const client = useSHOGunAPIClient();
|
|
18
|
-
const match = matchPath({
|
|
19
|
-
path: `${config.appPrefix}/portal/imagefile/:id`
|
|
20
|
-
}, location.pathname);
|
|
21
|
-
const imageFileId = match?.params?.id;
|
|
22
|
-
const { t } = useTranslation();
|
|
23
|
-
const onPublicChange = useCallback(async (checked) => {
|
|
24
|
-
if (!client || _isNil(imageFileId)) {
|
|
25
|
-
setFileBlob(undefined);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const response = await fetch(`/imagefiles/${imageFileId}/permissions/public`, {
|
|
29
|
-
method: checked ? 'POST' : 'DELETE',
|
|
30
|
-
headers: {
|
|
31
|
-
...getBearerTokenHeader(client.getKeycloak())
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
if (response.ok) {
|
|
35
|
-
setPublic(checked);
|
|
36
|
-
}
|
|
37
|
-
}, [imageFileId, client]);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (!file) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const fetchImageBlob = async () => {
|
|
43
|
-
if (!client || _isNil(file.fileUuid)) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const response = await client.imagefile().findOne(file.fileUuid);
|
|
47
|
-
setFileBlob(response);
|
|
48
|
-
};
|
|
49
|
-
fetchImageBlob();
|
|
50
|
-
}, [file, client]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!client || _isNil(imageFileId)) {
|
|
53
|
-
setFileBlob(undefined);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const fetchImageData = async () => {
|
|
57
|
-
const result = await client.graphql().sendQuery({
|
|
58
|
-
query: `query($id: Int) {
|
|
59
|
-
imageFileById(id: $id) {
|
|
60
|
-
active
|
|
61
|
-
fileType
|
|
62
|
-
id
|
|
63
|
-
created
|
|
64
|
-
modified
|
|
65
|
-
fileUuid
|
|
66
|
-
fileName
|
|
67
|
-
width
|
|
68
|
-
height
|
|
69
|
-
}
|
|
70
|
-
}`,
|
|
71
|
-
variables: {
|
|
72
|
-
id: imageFileId
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
setFile(result.imageFileById);
|
|
76
|
-
};
|
|
77
|
-
const fetchPublicState = async () => {
|
|
78
|
-
const response = await fetch(`/imagefiles/${imageFileId}/permissions/public`, {
|
|
79
|
-
headers: {
|
|
80
|
-
...getBearerTokenHeader(client.getKeycloak())
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
const data = await response.json();
|
|
84
|
-
setPublic(data.public);
|
|
85
|
-
};
|
|
86
|
-
fetchImageData();
|
|
87
|
-
fetchPublicState();
|
|
88
|
-
}, [imageFileId, client]);
|
|
89
|
-
return (_jsxs(_Fragment, { children: [_jsx(PageHeader, { title: t('ImageFileForm.title') }), _jsx(Spin, { spinning: false, children: _jsxs(Form, { className: "image-file-form", labelCol: { span: 5 }, wrapperCol: { span: 20 }, children: [_jsx(Form.Item, { label: t('ImageFileForm.name'), children: file?.fileName }), _jsx(Form.Item, { label: t('ImageFileForm.uuid'), children: isPublic
|
|
90
|
-
? _jsx("a", { target: "_blank", href: `/imagefiles/${file?.fileUuid}`, children: file?.fileUuid })
|
|
91
|
-
: file?.fileUuid }), _jsx(Form.Item, { label: t('ImageFileForm.public'), children: _jsx(Switch, { checked: isPublic, onChange: onPublicChange }, "public") }), _jsx(Form.Item, { label: t('ImageFileForm.preview'), children: fileBlob &&
|
|
92
|
-
_jsx("div", { className: "image-preview", children: _jsx("img", { src: URL.createObjectURL(fileBlob), alt: "preview" }) }) })] }) })] }));
|
|
93
|
-
};
|
|
94
|
-
export default ImageFileForm;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './ImageFileRoot.less';
|
|
3
|
-
import { PageHeader } from '@ant-design/pro-components';
|
|
4
|
-
import { Button, notification, Upload } from 'antd';
|
|
5
|
-
import _isNil from 'lodash/isNil';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { matchPath, useLocation, useNavigate } from 'react-router-dom';
|
|
8
|
-
import config from 'shogunApplicationConfig';
|
|
9
|
-
import useSHOGunAPIClient from '../../../Hooks/useSHOGunAPIClient';
|
|
10
|
-
import ImageFileForm from '../ImageFileForm/ImageFileForm';
|
|
11
|
-
import ImageFileTable from '../ImageFileTable/ImageFileTable';
|
|
12
|
-
export const ImageFileRoot = () => {
|
|
13
|
-
const navigate = useNavigate();
|
|
14
|
-
const location = useLocation();
|
|
15
|
-
const client = useSHOGunAPIClient();
|
|
16
|
-
const match = matchPath({
|
|
17
|
-
path: `${config.appPrefix}/portal/imagefile/:id`
|
|
18
|
-
}, location.pathname);
|
|
19
|
-
const imageFileId = match?.params?.id;
|
|
20
|
-
const { t } = useTranslation();
|
|
21
|
-
return (_jsxs("div", { className: "imagefile-root", children: [_jsx(PageHeader, { className: "header", onBack: () => navigate(-1), title: t('ImageFileRoot.title'), subTitle: t('ImageFileRoot.subTitle') }), _jsxs("div", { className: "left-container", children: [_jsx("div", { className: "left-toolbar", children: _jsx(Upload, { showUploadList: false, customRequest: async (options) => {
|
|
22
|
-
const file = options.file;
|
|
23
|
-
if (!(file instanceof File)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
const uploadedFile = await client?.imagefile().upload(file);
|
|
28
|
-
if (!_isNil(uploadedFile)) {
|
|
29
|
-
notification.info({
|
|
30
|
-
message: t('ImageFileRoot.success'),
|
|
31
|
-
description: t('ImageFileRoot.uploadSuccess', { entityName: file.name })
|
|
32
|
-
});
|
|
33
|
-
navigate(`${config.appPrefix}/portal/imagefile/${uploadedFile.id}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
notification.error({
|
|
38
|
-
message: t('ImageFileRoot.failure'),
|
|
39
|
-
description: t('ImageFileRoot.uploadFailure', { entityName: file.name })
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}, children: _jsx(Button, { type: "primary", children: t('ImageFileRoot.button') }) }, "upload") }), _jsx(ImageFileTable, {})] }), _jsx("div", { className: "right-container", children: !_isNil(imageFileId) && (_jsx(ImageFileForm, {})) })] }));
|
|
43
|
-
};
|
|
44
|
-
export default ImageFileRoot;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './ImageFileTable.less';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TableProps } from 'antd';
|
|
4
|
-
import ImageFile from '@terrestris/shogun-util/dist/model/ImageFile';
|
|
5
|
-
interface OwnProps {
|
|
6
|
-
}
|
|
7
|
-
type ImageFileTableProps = OwnProps & Partial<TableProps<ImageFile>>;
|
|
8
|
-
export declare const ImageFileTable: React.FC<ImageFileTableProps>;
|
|
9
|
-
export default ImageFileTable;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import './ImageFileTable.less';
|
|
3
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
-
import { DeleteOutlined, SyncOutlined } from '@ant-design/icons';
|
|
5
|
-
import { Modal, notification, Table, Tooltip } from 'antd';
|
|
6
|
-
import _isNil from 'lodash/isNil';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { useNavigate } from 'react-router-dom';
|
|
9
|
-
import config from 'shogunApplicationConfig';
|
|
10
|
-
import useSHOGunAPIClient from '../../../Hooks/useSHOGunAPIClient';
|
|
11
|
-
import TableUtil from '../../../Util/TableUtil';
|
|
12
|
-
export const ImageFileTable = ({ ...passThroughProps }) => {
|
|
13
|
-
const [entities, setEntities] = useState();
|
|
14
|
-
const [loadingState, setLoadingState] = useState();
|
|
15
|
-
const [pageTotal, setPageTotal] = useState();
|
|
16
|
-
const [pageSize, setPageSize] = useState(config.defaultPageSize || 10);
|
|
17
|
-
const [pageCurrent, setPageCurrent] = useState(1);
|
|
18
|
-
const [sortField, setSortField] = useState();
|
|
19
|
-
const [sortOrder, setSortOrder] = useState();
|
|
20
|
-
const navigate = useNavigate();
|
|
21
|
-
const client = useSHOGunAPIClient();
|
|
22
|
-
const service = client?.imagefile();
|
|
23
|
-
const { t, i18n } = useTranslation();
|
|
24
|
-
const columns = [{
|
|
25
|
-
title: 'UUID',
|
|
26
|
-
key: 'fileUuid',
|
|
27
|
-
dataIndex: 'fileUuid',
|
|
28
|
-
sorter: TableUtil.getSorter('fileUuid'),
|
|
29
|
-
...TableUtil.getColumnSearchProps('fileUuid')
|
|
30
|
-
}, {
|
|
31
|
-
title: 'Name',
|
|
32
|
-
key: 'fileName',
|
|
33
|
-
dataIndex: 'fileName',
|
|
34
|
-
sorter: TableUtil.getSorter('fileName'),
|
|
35
|
-
defaultSortOrder: 'ascend',
|
|
36
|
-
...TableUtil.getColumnSearchProps('fileName')
|
|
37
|
-
}, {
|
|
38
|
-
title: 'Created',
|
|
39
|
-
key: 'created',
|
|
40
|
-
dataIndex: 'created',
|
|
41
|
-
sorter: TableUtil.getSorter('created'),
|
|
42
|
-
defaultSortOrder: 'descend',
|
|
43
|
-
render: (val) => new Date(val).toLocaleString(i18n.language),
|
|
44
|
-
...TableUtil.getColumnSearchProps('created')
|
|
45
|
-
}];
|
|
46
|
-
const onRowClick = (imageFile) => {
|
|
47
|
-
navigate(`${config.appPrefix}/portal/imagefile/${imageFile.id}`);
|
|
48
|
-
};
|
|
49
|
-
const name = {
|
|
50
|
-
singular: t('ImageFileTable.imageSingular'),
|
|
51
|
-
plural: t('ImageFileTable.imagePlural')
|
|
52
|
-
};
|
|
53
|
-
const fetchEntities = useCallback(async () => {
|
|
54
|
-
setLoadingState('loading');
|
|
55
|
-
try {
|
|
56
|
-
const fetchedEntities = await service?.findAll({
|
|
57
|
-
page: pageCurrent - 1,
|
|
58
|
-
size: pageSize,
|
|
59
|
-
sort: {
|
|
60
|
-
properties: _isNil(sortField) ? [] : [sortField],
|
|
61
|
-
order: sortOrder === 'ascend' ? 'asc' : sortOrder === 'descend' ? 'desc' : undefined
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
setPageTotal(fetchedEntities?.totalElements);
|
|
65
|
-
setEntities(fetchedEntities?.content);
|
|
66
|
-
setLoadingState('done');
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
setLoadingState('failed');
|
|
70
|
-
}
|
|
71
|
-
}, [service, pageCurrent, pageSize, sortField, sortOrder]);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
fetchEntities();
|
|
74
|
-
}, [fetchEntities]);
|
|
75
|
-
const onDeleteClick = (record) => {
|
|
76
|
-
if (!record.id) {
|
|
77
|
-
setEntities(entities?.filter(r => r !== record));
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
Modal.confirm({
|
|
81
|
-
cancelText: t('ImageFileTable.cancel'),
|
|
82
|
-
title: t('ImageFileTable.delete', { entity: name.singular }),
|
|
83
|
-
content: (_jsxs("div", { children: [_jsx("div", { children: t('ImageFileTable.confirmInfo', { entity: name.singular }) }), _jsx("br", {}), _jsx("div", { children: t('ImageFileTable.conFirmTooltip', { entity: name.singular }) })] })),
|
|
84
|
-
onOk: async () => {
|
|
85
|
-
try {
|
|
86
|
-
if (!_isNil(record.fileUuid)) {
|
|
87
|
-
await service?.delete(record.fileUuid);
|
|
88
|
-
notification.info({
|
|
89
|
-
message: t('ImageFileTable.deletionInfo', { entity: name.singular }),
|
|
90
|
-
description: t('ImageFileTable.deletionInfo', {
|
|
91
|
-
entity: name.singular,
|
|
92
|
-
record: record.fileName
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
await fetchEntities();
|
|
96
|
-
navigate(`${config.appPrefix}/portal/imagefile`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
notification.error({
|
|
101
|
-
message: t('ImageFileTable.deleteFail'),
|
|
102
|
-
description: t('ImageFileTable.deleteFailDescript', { record: record.fileName })
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
const tableColumns = [
|
|
109
|
-
...columns,
|
|
110
|
-
{
|
|
111
|
-
title: (_jsx(Tooltip, { title: t('ImageFileTable.reloadTooltip'), children: _jsx(SyncOutlined, { onClick: fetchEntities }) })),
|
|
112
|
-
className: 'operation-column',
|
|
113
|
-
width: 100,
|
|
114
|
-
dataIndex: 'operation',
|
|
115
|
-
render: (_, record) => (_jsx("div", { className: "actions", children: _jsx(Tooltip, { title: "L\u00F6schen", children: _jsx(DeleteOutlined, { onClick: () => onDeleteClick(record) }) }) }))
|
|
116
|
-
}
|
|
117
|
-
];
|
|
118
|
-
const onTableChange = (pagination, filters, sorter) => {
|
|
119
|
-
if (!Array.isArray(sorter)) {
|
|
120
|
-
setSortOrder(sorter.order);
|
|
121
|
-
setSortField(sorter.field);
|
|
122
|
-
}
|
|
123
|
-
if (!_isNil(pagination.current)) {
|
|
124
|
-
setPageCurrent(pagination.current);
|
|
125
|
-
}
|
|
126
|
-
if (!_isNil(pagination.pageSize)) {
|
|
127
|
-
setPageSize(pagination.pageSize);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
if (!entities) {
|
|
131
|
-
return _jsx(_Fragment, {});
|
|
132
|
-
}
|
|
133
|
-
return (_jsx(Table, { className: "imagefile-table", columns: tableColumns, rowKey: (record) => `${record?.id}`, rowClassName: () => 'editable-row', dataSource: entities, onRow: (record) => {
|
|
134
|
-
return {
|
|
135
|
-
onClick: () => onRowClick(record)
|
|
136
|
-
};
|
|
137
|
-
}, bordered: true, size: "small", loading: loadingState === 'loading', onChange: onTableChange, pagination: {
|
|
138
|
-
total: pageTotal,
|
|
139
|
-
current: pageCurrent,
|
|
140
|
-
pageSize: pageSize,
|
|
141
|
-
showTotal: total => `${t('GeneralEntityTable.paging.total')}: ${total}`,
|
|
142
|
-
showSizeChanger: true,
|
|
143
|
-
showQuickJumper: true,
|
|
144
|
-
locale: {
|
|
145
|
-
// eslint-disable-next-line camelcase
|
|
146
|
-
next_page: t('GeneralEntityTable.paging.nextPage'),
|
|
147
|
-
// eslint-disable-next-line camelcase
|
|
148
|
-
prev_page: t('GeneralEntityTable.paging.prevPage'),
|
|
149
|
-
// eslint-disable-next-line camelcase
|
|
150
|
-
items_per_page: `/ ${t('GeneralEntityTable.paging.itemsPerPage')}`,
|
|
151
|
-
// eslint-disable-next-line camelcase
|
|
152
|
-
jump_to: t('GeneralEntityTable.paging.jumpTo'),
|
|
153
|
-
page: t('GeneralEntityTable.paging.page'),
|
|
154
|
-
}
|
|
155
|
-
}, ...passThroughProps }));
|
|
156
|
-
};
|
|
157
|
-
export default ImageFileTable;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './index.less';
|
|
3
|
-
import { Select } from 'antd';
|
|
4
|
-
import i18n from '../../i18n';
|
|
5
|
-
const { Option } = Select;
|
|
6
|
-
export const LanguageSelect = () => {
|
|
7
|
-
const supportedLanguages = Object.keys(i18n.services.resourceStore.data);
|
|
8
|
-
const onLanguageChange = (lang) => {
|
|
9
|
-
i18n.changeLanguage(lang);
|
|
10
|
-
};
|
|
11
|
-
return (_jsx("div", { className: "language-select", children: _jsx(Select, { defaultValue: i18n.language || 'en', onChange: onLanguageChange, children: supportedLanguages.map(supportedLanguage => {
|
|
12
|
-
return (_jsx(Option, { value: supportedLanguage, children: supportedLanguage.toUpperCase() }, supportedLanguage));
|
|
13
|
-
}) }) }));
|
|
14
|
-
};
|
|
15
|
-
export default LanguageSelect;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectProps } from 'antd/lib/select';
|
|
3
|
-
import LayerType from '@terrestris/shogun-util/dist/model/enum/LayerType';
|
|
4
|
-
type SelectPropsExcludes = 'defaultValue' | 'value' | 'options' | 'onChange';
|
|
5
|
-
export interface LayerTypeSelectProps extends Omit<SelectProps<LayerType>, SelectPropsExcludes> {
|
|
6
|
-
supportedTypes?: LayerType[];
|
|
7
|
-
value?: LayerType;
|
|
8
|
-
onChange?: (value?: LayerType) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const LayerTypeSelect: React.FC<LayerTypeSelectProps>;
|
|
11
|
-
export default LayerTypeSelect;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { Select } from 'antd';
|
|
4
|
-
export const LayerTypeSelect = ({ supportedTypes = [
|
|
5
|
-
'TILEWMS',
|
|
6
|
-
'VECTORTILE',
|
|
7
|
-
'WFS',
|
|
8
|
-
'WMS',
|
|
9
|
-
'WMSTIME',
|
|
10
|
-
'WMTS',
|
|
11
|
-
'XYZ'
|
|
12
|
-
], value, onChange = () => undefined, ...passThroughProps }) => {
|
|
13
|
-
const [currentValue, setCurrentValue] = useState(value);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
setCurrentValue(value);
|
|
16
|
-
}, [value]);
|
|
17
|
-
const getOptions = () => {
|
|
18
|
-
const options = [];
|
|
19
|
-
for (const supportedType of supportedTypes) {
|
|
20
|
-
options.push({
|
|
21
|
-
label: supportedType,
|
|
22
|
-
value: supportedType
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return options;
|
|
26
|
-
};
|
|
27
|
-
const changeHandler = (val) => {
|
|
28
|
-
setCurrentValue(val);
|
|
29
|
-
onChange(val);
|
|
30
|
-
};
|
|
31
|
-
return (_jsx(Select, { defaultValue: currentValue, value: currentValue, options: getOptions(), onChange: changeHandler, ...passThroughProps }));
|
|
32
|
-
};
|
|
33
|
-
export default LayerTypeSelect;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './LayerPreview.less';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ModalProps } from 'antd';
|
|
4
|
-
import Layer from '@terrestris/shogun-util/dist/model/Layer';
|
|
5
|
-
export interface LayerPreviewProps extends ModalProps {
|
|
6
|
-
layer: Layer;
|
|
7
|
-
}
|
|
8
|
-
export declare const LayerPreview: React.FC<LayerPreviewProps>;
|
|
9
|
-
export default LayerPreview;
|