@gen-epix/ui-client-common 4.7.0 → 4.9.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/dist/_chunks/CrudPage.js +236 -235
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +2 -1
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +39 -35
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +1048 -714
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +5187 -230
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +51 -38
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +3 -3
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/{_cacheHas.js → _arrayIncludesWith.js} +17 -17
- package/dist/_chunks/_arrayIncludesWith.js.map +1 -0
- package/dist/_chunks/{isArrayLike.js → _arrayMap.js} +94 -94
- package/dist/_chunks/_arrayMap.js.map +1 -0
- package/dist/_chunks/_baseGet.js +61 -61
- package/dist/_chunks/_baseGet.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +28 -28
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/_setToString.js +7 -7
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +74 -58
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +271 -269
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/tableStore.js +291 -246
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +2 -2
- package/dist/_chunks/uniq.js.map +1 -1
- package/dist/_chunks/useMutation.js +17 -17
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +103 -103
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +11 -0
- package/dist/classes/abstracts/FilterAbstract/index.js +48 -3
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/BooleanFilter.d.ts +1 -0
- package/dist/classes/filters/DateFilter.d.ts +1 -1
- package/dist/classes/filters/GeoFilter.d.ts +1 -0
- package/dist/classes/filters/MultiSelectFilter.d.ts +9 -6
- package/dist/classes/filters/NumberRangeFilter.d.ts +1 -0
- package/dist/classes/filters/TextFilter.d.ts +1 -0
- package/dist/classes/services/EmotionCacheService/index.js +3 -1
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/components/app/App/index.js +4 -3
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +2 -0
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +1 -0
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/Table/TableDownloadSidebarItem.d.ts +10 -0
- package/dist/components/ui/Table/TableSidebarMenu.d.ts +2 -1
- package/dist/components/ui/Table/index.d.ts +1 -0
- package/dist/components/ui/Table/index.js +1 -1
- package/dist/components/ui/Table/useTableColumnsMenu.d.ts +6 -0
- package/dist/dataHooks/useSitesQuery/index.d.ts +1 -0
- package/dist/dataHooks/useSitesQuery/index.js +18 -0
- package/dist/dataHooks/useSitesQuery/index.js.map +1 -0
- package/dist/dataHooks/useSitesQuery/useSitesQuery.d.ts +5 -0
- package/dist/locale/en.json +16 -0
- package/dist/locale/nl.json +16 -0
- package/dist/models/table.models.d.ts +2 -1
- package/dist/models/table.models.js.map +1 -1
- package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +12 -11
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +55 -55
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +90 -90
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/stores/tableStore/tableStore.d.ts +3 -1
- package/dist/theme/demoTheme/index.js +1 -1
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/TableUtil/TableUtil.d.ts +13 -1
- package/package.json +38 -34
- package/dist/_chunks/_baseFlatten.js +0 -26
- package/dist/_chunks/_baseFlatten.js.map +0 -1
- package/dist/_chunks/_cacheHas.js.map +0 -1
- package/dist/_chunks/isArrayLike.js.map +0 -1
- package/dist/_chunks/useColumnsMenu.js +0 -159
- package/dist/_chunks/useColumnsMenu.js.map +0 -1
- package/dist/hooks/useColumnsMenu/index.d.ts +0 -1
- package/dist/hooks/useColumnsMenu/index.js +0 -1
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +0 -6
- package/dist/test/lib/index.d.ts +0 -1
- package/dist/test/lib/render.d.ts +0 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { API_ORGANIZATION_TOKEN as e } from "../../constants/api.constants.js";
|
|
2
|
+
import { COMMON_QUERY_KEY as t } from "../../constants/query.constants.js";
|
|
3
|
+
import { t as n } from "../../_chunks/QueryClientService.js";
|
|
4
|
+
import { t as r } from "../../_chunks/useQueryMemo.js";
|
|
5
|
+
import { DataHookUtil as i } from "../../utils/DataHookUtil/index.js";
|
|
6
|
+
import { container as a } from "tsyringe";
|
|
7
|
+
import { useMemo as o } from "react";
|
|
8
|
+
// src/dataHooks/useSitesQuery/useSitesQuery.ts
|
|
9
|
+
var s = () => r({
|
|
10
|
+
queryFn: async ({ signal: t }) => (await a.resolve(e).sitesGetAll(null, null, { signal: t })).data,
|
|
11
|
+
queryKey: a.resolve(n).getGenericKey(t.SITES)
|
|
12
|
+
}), c = () => {
|
|
13
|
+
let e = s();
|
|
14
|
+
return o(() => i.createUseOptionsDataHook(e, (e) => e.id, (e) => e.name), [e]);
|
|
15
|
+
};
|
|
16
|
+
export { c as useSiteOptionsQuery, s as useSitesQuery };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["QueryClientService","useQueryMemo","useSitesQuery","container","API_ORGANIZATION_TOKEN","COMMON_QUERY_KEY","useSiteOptionsQuery","sitesQuery","useMemo","DataHookUtil","site"],"sources":["../../../src/dataHooks/useSitesQuery/useSitesQuery.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport { useMemo } from 'react';\nimport type { CommonDbSite } from '@gen-epix/api-commondb';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport { useQueryMemo } from '../../hooks/useQueryMemo';\nimport type { UseOptions } from '../../models/data-hooks.models';\nimport { DataHookUtil } from '../../utils/DataHookUtil';\n\nexport const useSitesQuery = (): ReturnType<typeof useQueryMemo<CommonDbSite[]>> => {\n return useQueryMemo({\n queryFn: async ({ signal }) => {\n const response = await container.resolve(API_ORGANIZATION_TOKEN).sitesGetAll(null, null, { signal });\n return response.data;\n },\n queryKey: container.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.SITES),\n });\n};\n\nexport const useSiteOptionsQuery = (): UseOptions<string> => {\n const sitesQuery = useSitesQuery();\n\n return useMemo(() => {\n return DataHookUtil.createUseOptionsDataHook<CommonDbSite>(sitesQuery, site => site.id, site => site.name);\n }, [sitesQuery]);\n};\n"],"mappings":";;;;;;;;AAWA,IAAaE,UACJD,EAAa;CAClB,SAAS,OAAO,EAAE,iBAET,MADgBE,EAAU,QAAQC,CAAsB,CAAC,CAAC,YAAY,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,CACnF;CAElB,UAAUD,EAAU,QAAQH,CAAkB,CAAC,CAAC,cAAcK,EAAiB,KAAK;AACtF,CAAC,GAGUC,UAAgD;CAC3D,IAAMC,IAAaL,EAAc;CAEjC,OAAOM,QACEC,EAAa,yBAAuCF,IAAY,MAAQG,EAAK,KAAI,MAAQA,EAAK,IAAI,GACxG,CAACH,CAAU,CAAC;AACjB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommonDbSite } from '@gen-epix/api-commondb';
|
|
2
|
+
import { useQueryMemo } from '../../hooks/useQueryMemo';
|
|
3
|
+
import { UseOptions } from '../../models/data-hooks.models';
|
|
4
|
+
export declare const useSitesQuery: () => ReturnType<typeof useQueryMemo<CommonDbSite[]>>;
|
|
5
|
+
export declare const useSiteOptionsQuery: () => UseOptions<string>;
|
package/dist/locale/en.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"Active to": "Active to",
|
|
47
47
|
"ago": "ago",
|
|
48
48
|
"All filters have been removed, but have not yet been applied.": "All filters have been removed, but have not yet been applied.",
|
|
49
|
+
"All rows": "All rows",
|
|
49
50
|
"Anonymize": "Anonymize",
|
|
50
51
|
"Anonymize user": "Anonymize user",
|
|
51
52
|
"Anonymizing user: {{userName}}": "Anonymizing user: {{userName}}",
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"Click the logout button to logout": "Click the logout button to logout",
|
|
76
77
|
"Clone": "Clone",
|
|
77
78
|
"Close": "Close",
|
|
79
|
+
"Close download": "Close download",
|
|
78
80
|
"Close filters": "Close filters",
|
|
79
81
|
"Close notifications drawer": "Close notifications drawer",
|
|
80
82
|
"Code": "Code",
|
|
@@ -106,6 +108,11 @@
|
|
|
106
108
|
"Delete item: {{itemName}}": "Delete item: {{itemName}}",
|
|
107
109
|
"Description": "Description",
|
|
108
110
|
"Details for our technicians": "Details for our technicians",
|
|
111
|
+
"Download": "Download",
|
|
112
|
+
"Download all rows as CSV": "Download all rows as CSV",
|
|
113
|
+
"Download all rows as Excel": "Download all rows as Excel",
|
|
114
|
+
"Download selected rows as CSV": "Download selected rows as CSV",
|
|
115
|
+
"Download selected rows as Excel": "Download selected rows as Excel",
|
|
109
116
|
"Drag handle for {{label}}": "Drag handle for {{label}}",
|
|
110
117
|
"E-Mail": "E-Mail",
|
|
111
118
|
"Edit": "Edit",
|
|
@@ -137,7 +144,9 @@
|
|
|
137
144
|
"Identifier issuers": "Identifier issuers",
|
|
138
145
|
"Identifier Issuers": "Identifier Issuers",
|
|
139
146
|
"If known, fill in the user's key. This is typically the user's email address, but can be any string depending on the Identity Provider. Filling in a key makes the invitation more secure. If left empty, the invitation can be consumed by anyone with the invite link.": "If known, fill in the user's key. This is typically the user's email address, but can be any string depending on the Identity Provider. Filling in a key makes the invitation more secure. If left empty, the invitation can be consumed by anyone with the invite link.",
|
|
147
|
+
"Include missing values": "Include missing values",
|
|
140
148
|
"Invitation": "Invitation",
|
|
149
|
+
"Invitation details": "Invitation details",
|
|
141
150
|
"Invitation details for {{email}}": "Invitation details for {{email}}",
|
|
142
151
|
"Invitation has been consumed by bearer token": "Invitation has been consumed by bearer token",
|
|
143
152
|
"Invitation link: {{invitationLink}}": "Invitation link: {{invitationLink}}",
|
|
@@ -171,6 +180,7 @@
|
|
|
171
180
|
"Manage users": "Manage users",
|
|
172
181
|
"Manage your organizations": "Manage your organizations",
|
|
173
182
|
"Management": "Management",
|
|
183
|
+
"Missing": "Missing",
|
|
174
184
|
"more than {{hours}} hours": "more than {{hours}} hours",
|
|
175
185
|
"My API permissions": "My API permissions",
|
|
176
186
|
"My organization": "My organization",
|
|
@@ -185,6 +195,7 @@
|
|
|
185
195
|
"No new notifications in this session": "No new notifications in this session",
|
|
186
196
|
"Not found.": "Not found.",
|
|
187
197
|
"Notifications": "Notifications",
|
|
198
|
+
"Open download": "Open download",
|
|
188
199
|
"Open filters": "Open filters",
|
|
189
200
|
"Open project homepage in new tab": "Open project homepage in new tab",
|
|
190
201
|
"Organization": "Organization",
|
|
@@ -224,7 +235,9 @@
|
|
|
224
235
|
"Row actions": "Row actions",
|
|
225
236
|
"Save": "Save",
|
|
226
237
|
"Select all": "Select all",
|
|
238
|
+
"Select missing values": "Select missing values",
|
|
227
239
|
"Select row": "Select row",
|
|
240
|
+
"Selected rows": "Selected rows",
|
|
228
241
|
"Send": "Send",
|
|
229
242
|
"Send invitation": "Send invitation",
|
|
230
243
|
"Show": "Show",
|
|
@@ -246,6 +259,7 @@
|
|
|
246
259
|
"System": "System",
|
|
247
260
|
"Thank you for sharing your feedback with us": "Thank you for sharing your feedback with us",
|
|
248
261
|
"The invitation for {{email}} will expire on {{expiryDate}}.": "The invitation for {{email}} will expire on {{expiryDate}}.",
|
|
262
|
+
"The invitation will expire on {{expiryDate}}.": "The invitation will expire on {{expiryDate}}.",
|
|
249
263
|
"The item you requested can not be found. It may have been moved or deleted.": "The item you requested can not be found. It may have been moved or deleted.",
|
|
250
264
|
"There are scheduled outages. Our platform will be disrupted during these times.": "There are scheduled outages. Our platform will be disrupted during these times.",
|
|
251
265
|
"There no current or scheduled outages.": "There no current or scheduled outages.",
|
|
@@ -278,6 +292,8 @@
|
|
|
278
292
|
"We have encountered a problem. The error has been automatically logged. One of our staff will look into it shortly. Error message: {{message}}": "We have encountered a problem. The error has been automatically logged. One of our staff will look into it shortly. Error message: {{message}}",
|
|
279
293
|
"We were unable to process this page or item.": "We were unable to process this page or item.",
|
|
280
294
|
"Welcome to {{applicationName}}": "Welcome to {{applicationName}}",
|
|
295
|
+
"When enabled, include items with missing values alongside items matching the selected values.": "When enabled, include items with missing values alongside items matching the selected values.",
|
|
296
|
+
"When enabled, select only items with missing values.": "When enabled, select only items with missing values.",
|
|
281
297
|
"Would you like to share your feedback?": "Would you like to share your feedback?",
|
|
282
298
|
"Yes": "Yes",
|
|
283
299
|
"You are not authorized to access this page or item.": "You are not authorized to access this page or item.",
|
package/dist/locale/nl.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"Active to": "Actief tot",
|
|
47
47
|
"ago": "geleden",
|
|
48
48
|
"All filters have been removed, but have not yet been applied.": "Alle filters zijn verwijderd, maar nog niet toegepast.",
|
|
49
|
+
"All rows": "Alle rijen",
|
|
49
50
|
"Anonymize": "Anonimiseren",
|
|
50
51
|
"Anonymize user": "Gebruiker anonimiseren",
|
|
51
52
|
"Anonymizing user: {{userName}}": "Gebruiker anonimiseren: {{userName}}",
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"Click the logout button to logout": "Klik op de uitlog knop om uit te loggen",
|
|
76
77
|
"Clone": "Klonen",
|
|
77
78
|
"Close": "Sluiten",
|
|
79
|
+
"Close download": "Download sluiten",
|
|
78
80
|
"Close filters": "Filters sluiten",
|
|
79
81
|
"Close notifications drawer": "Meldingenpaneel sluiten",
|
|
80
82
|
"Code": "Code",
|
|
@@ -106,6 +108,11 @@
|
|
|
106
108
|
"Delete item: {{itemName}}": "Verwijder item: {{itemName}}",
|
|
107
109
|
"Description": "Omschrijving",
|
|
108
110
|
"Details for our technicians": "Details voor onze technici",
|
|
111
|
+
"Download": "Downloaden",
|
|
112
|
+
"Download all rows as CSV": "Download alle rijen als CSV",
|
|
113
|
+
"Download all rows as Excel": "Download alle rijen als Excel",
|
|
114
|
+
"Download selected rows as CSV": "Download geselecteerde rijen als CSV",
|
|
115
|
+
"Download selected rows as Excel": "Download geselecteerde rijen als Excel",
|
|
109
116
|
"Drag handle for {{label}}": "Sleep handvat voor {{label}}",
|
|
110
117
|
"E-Mail": "E-mail",
|
|
111
118
|
"Edit": "Bewerken",
|
|
@@ -137,7 +144,9 @@
|
|
|
137
144
|
"Identifier issuers": "Identificatie uitgevers",
|
|
138
145
|
"Identifier Issuers": "Identificatie Uitgevers",
|
|
139
146
|
"If known, fill in the user's key. This is typically the user's email address, but can be any string depending on the Identity Provider. Filling in a key makes the invitation more secure. If left empty, the invitation can be consumed by anyone with the invite link.": "Vul indien bekend de sleutel van de gebruiker in. Dit is doorgaans het e-mailadres van de gebruiker, maar kan elke tekenreeks zijn afhankelijk van de identiteitsprovider. Het invullen van een sleutel maakt de uitnodiging veiliger. Als dit leeg wordt gelaten, kan de uitnodiging worden ingewisseld door iedereen met de uitnodigingslink.",
|
|
147
|
+
"Include missing values": "Ontbrekende waarden opnemen",
|
|
140
148
|
"Invitation": "Uitnodiging",
|
|
149
|
+
"Invitation details": "Uitnodigingsdetails",
|
|
141
150
|
"Invitation details for {{email}}": "Uitnodigingsdetails voor {{email}}",
|
|
142
151
|
"Invitation has been consumed by bearer token": "Uitnodiging is ingewisseld met bearer token",
|
|
143
152
|
"Invitation link: {{invitationLink}}": "Uitnodigingslink: {{invitationLink}}",
|
|
@@ -171,6 +180,7 @@
|
|
|
171
180
|
"Manage users": "Beheer gebruikers",
|
|
172
181
|
"Manage your organizations": "Beheer uw organisaties",
|
|
173
182
|
"Management": "Beheer",
|
|
183
|
+
"Missing": "Ontbrekende waarden",
|
|
174
184
|
"more than {{hours}} hours": "meer dan {{hours}} uur",
|
|
175
185
|
"My API permissions": "Mijn API rechten",
|
|
176
186
|
"My organization": "Mijn organisatie",
|
|
@@ -185,6 +195,7 @@
|
|
|
185
195
|
"No new notifications in this session": "Geen nieuwe meldingen in deze sessie",
|
|
186
196
|
"Not found.": "Niet gevonden.",
|
|
187
197
|
"Notifications": "Notificaties",
|
|
198
|
+
"Open download": "Download openen",
|
|
188
199
|
"Open filters": "Open filters",
|
|
189
200
|
"Open project homepage in new tab": "Open project homepage in nieuw tabblad",
|
|
190
201
|
"Organization": "Organisatie",
|
|
@@ -224,7 +235,9 @@
|
|
|
224
235
|
"Row actions": "Rij acties",
|
|
225
236
|
"Save": "Opslaan",
|
|
226
237
|
"Select all": "Alles selecteren",
|
|
238
|
+
"Select missing values": "Ontbrekende waarden selecteren",
|
|
227
239
|
"Select row": "Rij selecteren",
|
|
240
|
+
"Selected rows": "Geselecteerde rijen",
|
|
228
241
|
"Send": "Versturen",
|
|
229
242
|
"Send invitation": "Stuur uitnodiging",
|
|
230
243
|
"Show": "Tonen",
|
|
@@ -246,6 +259,7 @@
|
|
|
246
259
|
"System": "Systeem",
|
|
247
260
|
"Thank you for sharing your feedback with us": "Bedankt voor het delen van uw feedback met ons",
|
|
248
261
|
"The invitation for {{email}} will expire on {{expiryDate}}.": "De uitnodiging voor {{email}} vervalt op {{expiryDate}}.",
|
|
262
|
+
"The invitation will expire on {{expiryDate}}.": "De uitnodiging vervalt op {{expiryDate}}.",
|
|
249
263
|
"The item you requested can not be found. It may have been moved or deleted.": "Het gevraagde item kan niet worden gevonden. Het is mogelijk verplaatst of verwijderd.",
|
|
250
264
|
"There are scheduled outages. Our platform will be disrupted during these times.": "Er zijn geplande storingen. Ons platform wordt verstoord tijdens deze tijden.",
|
|
251
265
|
"There no current or scheduled outages.": "Er zijn geen huidige of geplande storingen.",
|
|
@@ -278,6 +292,8 @@
|
|
|
278
292
|
"We have encountered a problem. The error has been automatically logged. One of our staff will look into it shortly. Error message: {{message}}": "We hebben een probleem ondervonden. De fout is automatisch gelogd. Een van onze medewerkers zal er binnenkort naar kijken. Foutmelding: {{message}}",
|
|
279
293
|
"We were unable to process this page or item.": "We konden deze pagina of dit item niet verwerken.",
|
|
280
294
|
"Welcome to {{applicationName}}": "Welkom bij {{applicationName}}",
|
|
295
|
+
"When enabled, include items with missing values alongside items matching the selected values.": "Als dit is ingeschakeld, worden items met ontbrekende waarden ook opgenomen naast items die overeenkomen met de geselecteerde waarden.",
|
|
296
|
+
"When enabled, select only items with missing values.": "Als dit is ingeschakeld, worden alleen items met ontbrekende waarden geselecteerd.",
|
|
281
297
|
"Would you like to share your feedback?": "Wilt u uw feedback delen?",
|
|
282
298
|
"Yes": "Ja",
|
|
283
299
|
"You are not authorized to access this page or item.": "U bent niet gemachtigd om toegang te krijgen tot deze pagina of dit item.",
|
|
@@ -60,7 +60,7 @@ export interface TableColumnNumber<TRowData, TDataContext = null, TColumnContext
|
|
|
60
60
|
export interface TableColumnOptions<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string | string[], TDataContext, TColumnContext> {
|
|
61
61
|
comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnOptions<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;
|
|
62
62
|
maxNumOptionsExpanded?: number;
|
|
63
|
-
options: OptionBase<string>[];
|
|
63
|
+
options: OptionBase<number | string>[];
|
|
64
64
|
shouldFilterOptions?: boolean;
|
|
65
65
|
type: 'options';
|
|
66
66
|
}
|
|
@@ -132,6 +132,7 @@ interface TableColumnBase<TRowData, TValue, TDataContext = null, TColumnContext
|
|
|
132
132
|
frozen?: TABLE_COLUMN_FROZEN;
|
|
133
133
|
headerName?: string;
|
|
134
134
|
headerTooltipContent?: string;
|
|
135
|
+
hideInDownload?: boolean;
|
|
135
136
|
hideInFilter?: boolean;
|
|
136
137
|
id?: string;
|
|
137
138
|
isInitiallyVisible: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.models.js","names":["FIXED_COLUMN_ID","\"ACTIONS\"","\"READABLE_INDEX\"","\"ROW_SELECT\"","TABLE_COLUMN_FROZEN","\"LEFT\"","\"RIGHT\""],"sources":["../../src/models/table.models.ts"],"sourcesContent":["import type {\n SxProps,\n Theme,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport type { TFunction } from 'i18next';\nimport type { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\nimport type { OptionBase } from '@gen-epix/ui-core-form/models/form.models';\n\nexport enum FIXED_COLUMN_ID {\n ACTIONS = 'ACTIONS',\n READABLE_INDEX = 'READABLE_INDEX',\n ROW_SELECT = 'ROW_SELECT',\n}\n\nexport enum TABLE_COLUMN_FROZEN {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport interface GetTableCellRowComparatorProps<TColumn, TDataContext = null> {\n readonly column: TColumn;\n readonly dataContext: TDataContext;\n readonly direction: TableSortDirection;\n}\n\nexport interface GetTableCellValueProps<TRowData, TColumn, TDataContext = null> {\n readonly column: TColumn;\n readonly dataContext: TDataContext;\n readonly row: TRowData;\n readonly rowIndex: number;\n readonly t?: TFunction<'translation', undefined>;\n}\n\nexport type HasCellDataFn<TRowData, TDataContext = null> = (row: TRowData, column: TableColumn<TRowData, TDataContext>, rowIndex: number, dataContext: TDataContext) => boolean;\n\nexport type TableCellRowComparatorArgument<TRowData> = {\n row: TRowData;\n rowIndex: number;\n};\n\nexport type TableColumn<TRowData, TDataContext = null, TColumnContext = null> =\n TableColumnActions<TRowData, TDataContext, TColumnContext> |\n TableColumnBoolean<TRowData, TDataContext, TColumnContext> |\n TableColumnDate<TRowData, TDataContext, TColumnContext> |\n TableColumnNumber<TRowData, TDataContext, TColumnContext> |\n TableColumnOptions<TRowData, TDataContext, TColumnContext> |\n TableColumnReadableIndex<TRowData, TDataContext, TColumnContext> |\n TableColumnSelectable<TRowData, TDataContext, TColumnContext> |\n TableColumnText<TRowData, TDataContext, TColumnContext>;\n\nexport interface TableColumnActions<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnActions<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n frozen: TABLE_COLUMN_FROZEN.RIGHT;\n getActions: (params: TableRowParams<TRowData, TDataContext>) => ReactElement[];\n id: FIXED_COLUMN_ID.ACTIONS;\n isInitiallyVisible: true;\n resizable: false;\n type: 'actions';\n}\n\nexport interface TableColumnBoolean<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, boolean, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnBoolean<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n type: 'boolean';\n}\n\nexport interface TableColumnDate<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnDate<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n dateFormat: typeof DATE_FORMAT[keyof typeof DATE_FORMAT];\n type: 'date';\n}\n\nexport type TableColumnDimension = {\n columnIds: string[];\n id: string;\n label: string;\n};\n\nexport interface TableColumnNumber<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, number, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnNumber<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n type: 'number';\n}\n\nexport interface TableColumnOptions<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string | string[], TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnOptions<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n maxNumOptionsExpanded?: number;\n options: OptionBase<string>[];\n shouldFilterOptions?: boolean;\n type: 'options';\n}\n\nexport interface TableColumnParams<TRowData, TDataContext = null> {\n column: TableColumn<TRowData, TDataContext>;\n dataContext: TDataContext;\n}\n\nexport interface TableColumnReadableIndex<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, never, TDataContext, TColumnContext> {\n comparatorFactory?: never;\n disableEllipsis: true;\n frozen: TABLE_COLUMN_FROZEN.LEFT;\n getAriaLabel: (params: TableRowParams<TRowData, TDataContext>) => string;\n id: FIXED_COLUMN_ID.READABLE_INDEX;\n resizable: false;\n type: 'readableIndex';\n}\n\nexport interface TableColumnSelectable<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, never, TDataContext, TColumnContext> {\n comparatorFactory?: never;\n disableEllipsis: true;\n frozen: TABLE_COLUMN_FROZEN.LEFT;\n id: FIXED_COLUMN_ID.ROW_SELECT;\n isDisabled?: (params: TableRowParams<TRowData, TDataContext>) => boolean;\n resizable: false;\n type: 'selectable';\n}\n\nexport interface TableColumnText<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnText<TRowData, TDataContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n type: 'text';\n}\n\nexport type TableColumnVisualSettings = {\n calculatedWidth?: number;\n hasResized?: boolean;\n id: string;\n isVisible: boolean;\n offsetX?: number;\n widthFlex: number;\n widthPx: number;\n};\n\n\nexport type TableDragEvent = {\n clientX: number;\n clientY: number;\n deltaX: number;\n deltaY: number;\n elementOffsetX: number;\n elementWidth: number;\n target: HTMLDivElement;\n type: 'end' | 'move' | 'start';\n};\n\nexport type TableRowAndColumnParams<TRowData, TDataContext = null> = TableColumnParams<TRowData, TDataContext> & TableRowParams<TRowData, TDataContext>;\n\nexport interface TableRowParams<TRowData, TDataContext = null> {\n dataContext: TDataContext;\n id: string;\n row: TRowData;\n rowIndex: number;\n}\n\nexport type TableSortDirection = 'asc' | 'desc';\n\ninterface TableColumnBase<TRowData, TValue, TDataContext = null, TColumnContext = null> {\n cellColorGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => string;\n cellTitleGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => string;\n columnContext?: TColumnContext;\n customHeaderIcon?: {\n iconElement: ReactElement;\n label: string;\n onClick: (params: TableColumnParams<TRowData, TDataContext>) => void;\n };\n disableEllipsis?: boolean;\n displayValueGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => string;\n filterLabel?: string;\n frozen?: TABLE_COLUMN_FROZEN;\n headerName?: string;\n headerTooltipContent?: string;\n hideInFilter?: boolean;\n id?: string;\n isInitiallyVisible: boolean;\n renderCell?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => ReactElement;\n renderHeader?: (params: TableColumnParams<TRowData, TDataContext>) => ReactElement;\n renderHeaderContent?: (params: TableColumnParams<TRowData, TDataContext>) => ReactElement;\n resizable?: boolean;\n sx?: SxProps<Theme>;\n textAlign?: 'left' | 'right';\n valueGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => TValue;\n widthFlex?: number;\n widthPx?: number;\n widthPxFn?: (dataLength: number) => number;\n}\n"],"mappings":";AASA,IAAYA,IAAL,yBAAA,GAAA;C,OACL,EAAAC,UAAA,WACA,EAAAC,iBAAA,kBACA,EAAAC,aAAA,c;AACF,EAAA,CAAA,CAAA,GAEYC,IAAL,yBAAA,GAAA;C,OACL,EAAAC,OAAA,QACA,EAAAC,QAAA,S;AACF,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"table.models.js","names":["FIXED_COLUMN_ID","\"ACTIONS\"","\"READABLE_INDEX\"","\"ROW_SELECT\"","TABLE_COLUMN_FROZEN","\"LEFT\"","\"RIGHT\""],"sources":["../../src/models/table.models.ts"],"sourcesContent":["import type {\n SxProps,\n Theme,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport type { TFunction } from 'i18next';\nimport type { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\nimport type { OptionBase } from '@gen-epix/ui-core-form/models/form.models';\n\nexport enum FIXED_COLUMN_ID {\n ACTIONS = 'ACTIONS',\n READABLE_INDEX = 'READABLE_INDEX',\n ROW_SELECT = 'ROW_SELECT',\n}\n\nexport enum TABLE_COLUMN_FROZEN {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport interface GetTableCellRowComparatorProps<TColumn, TDataContext = null> {\n readonly column: TColumn;\n readonly dataContext: TDataContext;\n readonly direction: TableSortDirection;\n}\n\nexport interface GetTableCellValueProps<TRowData, TColumn, TDataContext = null> {\n readonly column: TColumn;\n readonly dataContext: TDataContext;\n readonly row: TRowData;\n readonly rowIndex: number;\n readonly t?: TFunction<'translation', undefined>;\n}\n\nexport type HasCellDataFn<TRowData, TDataContext = null> = (row: TRowData, column: TableColumn<TRowData, TDataContext>, rowIndex: number, dataContext: TDataContext) => boolean;\n\nexport type TableCellRowComparatorArgument<TRowData> = {\n row: TRowData;\n rowIndex: number;\n};\n\nexport type TableColumn<TRowData, TDataContext = null, TColumnContext = null> =\n TableColumnActions<TRowData, TDataContext, TColumnContext> |\n TableColumnBoolean<TRowData, TDataContext, TColumnContext> |\n TableColumnDate<TRowData, TDataContext, TColumnContext> |\n TableColumnNumber<TRowData, TDataContext, TColumnContext> |\n TableColumnOptions<TRowData, TDataContext, TColumnContext> |\n TableColumnReadableIndex<TRowData, TDataContext, TColumnContext> |\n TableColumnSelectable<TRowData, TDataContext, TColumnContext> |\n TableColumnText<TRowData, TDataContext, TColumnContext>;\n\nexport interface TableColumnActions<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnActions<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n frozen: TABLE_COLUMN_FROZEN.RIGHT;\n getActions: (params: TableRowParams<TRowData, TDataContext>) => ReactElement[];\n id: FIXED_COLUMN_ID.ACTIONS;\n isInitiallyVisible: true;\n resizable: false;\n type: 'actions';\n}\n\nexport interface TableColumnBoolean<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, boolean, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnBoolean<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n type: 'boolean';\n}\n\nexport interface TableColumnDate<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnDate<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n dateFormat: typeof DATE_FORMAT[keyof typeof DATE_FORMAT];\n type: 'date';\n}\n\nexport type TableColumnDimension = {\n columnIds: string[];\n id: string;\n label: string;\n};\n\nexport interface TableColumnNumber<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, number, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnNumber<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n type: 'number';\n}\n\nexport interface TableColumnOptions<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string | string[], TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnOptions<TRowData, TDataContext, TColumnContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n maxNumOptionsExpanded?: number;\n options: OptionBase<number | string>[];\n shouldFilterOptions?: boolean;\n type: 'options';\n}\n\nexport interface TableColumnParams<TRowData, TDataContext = null> {\n column: TableColumn<TRowData, TDataContext>;\n dataContext: TDataContext;\n}\n\nexport interface TableColumnReadableIndex<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, never, TDataContext, TColumnContext> {\n comparatorFactory?: never;\n disableEllipsis: true;\n frozen: TABLE_COLUMN_FROZEN.LEFT;\n getAriaLabel: (params: TableRowParams<TRowData, TDataContext>) => string;\n id: FIXED_COLUMN_ID.READABLE_INDEX;\n resizable: false;\n type: 'readableIndex';\n}\n\nexport interface TableColumnSelectable<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, never, TDataContext, TColumnContext> {\n comparatorFactory?: never;\n disableEllipsis: true;\n frozen: TABLE_COLUMN_FROZEN.LEFT;\n id: FIXED_COLUMN_ID.ROW_SELECT;\n isDisabled?: (params: TableRowParams<TRowData, TDataContext>) => boolean;\n resizable: false;\n type: 'selectable';\n}\n\nexport interface TableColumnText<TRowData, TDataContext = null, TColumnContext = null> extends TableColumnBase<TRowData, string, TDataContext, TColumnContext> {\n comparatorFactory?: (params: GetTableCellRowComparatorProps<TableColumnText<TRowData, TDataContext>, TDataContext>) => (a: TRowData, b: TRowData) => number;\n type: 'text';\n}\n\nexport type TableColumnVisualSettings = {\n calculatedWidth?: number;\n hasResized?: boolean;\n id: string;\n isVisible: boolean;\n offsetX?: number;\n widthFlex: number;\n widthPx: number;\n};\n\n\nexport type TableDragEvent = {\n clientX: number;\n clientY: number;\n deltaX: number;\n deltaY: number;\n elementOffsetX: number;\n elementWidth: number;\n target: HTMLDivElement;\n type: 'end' | 'move' | 'start';\n};\n\nexport type TableRowAndColumnParams<TRowData, TDataContext = null> = TableColumnParams<TRowData, TDataContext> & TableRowParams<TRowData, TDataContext>;\n\nexport interface TableRowParams<TRowData, TDataContext = null> {\n dataContext: TDataContext;\n id: string;\n row: TRowData;\n rowIndex: number;\n}\n\nexport type TableSortDirection = 'asc' | 'desc';\n\ninterface TableColumnBase<TRowData, TValue, TDataContext = null, TColumnContext = null> {\n cellColorGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => string;\n cellTitleGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => string;\n columnContext?: TColumnContext;\n customHeaderIcon?: {\n iconElement: ReactElement;\n label: string;\n onClick: (params: TableColumnParams<TRowData, TDataContext>) => void;\n };\n disableEllipsis?: boolean;\n displayValueGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => string;\n filterLabel?: string;\n frozen?: TABLE_COLUMN_FROZEN;\n headerName?: string;\n headerTooltipContent?: string;\n hideInDownload?: boolean;\n hideInFilter?: boolean;\n id?: string;\n isInitiallyVisible: boolean;\n renderCell?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => ReactElement;\n renderHeader?: (params: TableColumnParams<TRowData, TDataContext>) => ReactElement;\n renderHeaderContent?: (params: TableColumnParams<TRowData, TDataContext>) => ReactElement;\n resizable?: boolean;\n sx?: SxProps<Theme>;\n textAlign?: 'left' | 'right';\n valueGetter?: (params: TableRowAndColumnParams<TRowData, TDataContext>) => TValue;\n widthFlex?: number;\n widthPx?: number;\n widthPxFn?: (dataLength: number) => number;\n}\n"],"mappings":";AASA,IAAYA,IAAL,yBAAA,GAAA;C,OACL,EAAAC,UAAA,WACA,EAAAC,iBAAA,kBACA,EAAAC,aAAA,c;AACF,EAAA,CAAA,CAAA,GAEYC,IAAL,yBAAA,GAAA;C,OACL,EAAAC,OAAA,QACA,EAAAC,QAAA,S;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -37,7 +37,7 @@ export type CrudPageProps<TFormFields extends FieldValues, TData extends Generic
|
|
|
37
37
|
readonly extraUpdateOnePermissions?: TApiPermission[];
|
|
38
38
|
readonly fetchAll: (signal: AbortSignal) => Promise<TData[]>;
|
|
39
39
|
readonly fetchAllSelect?: (data: TData[]) => TData[];
|
|
40
|
-
readonly formFieldDefinitions: ((
|
|
40
|
+
readonly formFieldDefinitions: ((item: TData, values: TFormFields) => FormFieldDefinition<TFormFields>[]) | FormFieldDefinition<TFormFields>[];
|
|
41
41
|
readonly getFormValuesFromItem?: (item: TData) => Partial<TFormFields>;
|
|
42
42
|
readonly getName: (item: TData | TFormFields) => string;
|
|
43
43
|
readonly getOptimisticUpdateIntermediateItem?: (variables: TFormFields, previousItem: TData) => TData;
|
|
@@ -10,9 +10,10 @@ import { CommonDbCommandName as c } from "@gen-epix/api-commondb";
|
|
|
10
10
|
import { useCallback as l, useMemo as u } from "react";
|
|
11
11
|
import { jsx as d } from "react/jsx-runtime";
|
|
12
12
|
import { useTranslation as f } from "react-i18next";
|
|
13
|
-
import {
|
|
14
|
-
import { TestIdUtil as
|
|
15
|
-
import { FORM_FIELD_DEFINITION_TYPE as
|
|
13
|
+
import { object as p, string as m } from "yup";
|
|
14
|
+
import { TestIdUtil as h } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
15
|
+
import { FORM_FIELD_DEFINITION_TYPE as g } from "@gen-epix/ui-core-form/models/form.models";
|
|
16
|
+
import { SchemaUtil as _ } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
16
17
|
import { useArray as v } from "@gen-epix/ui-core/hooks/useArray";
|
|
17
18
|
// src/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.tsx
|
|
18
19
|
var y = () => {
|
|
@@ -23,27 +24,27 @@ var y = () => {
|
|
|
23
24
|
]), w = l(async (t) => (await s.resolve(e).organizationAdminPoliciesGetAll(null, null, { signal: t }))?.data, []), T = l(async (t) => await s.resolve(e).organizationAdminPoliciesDeleteOne(t.id), []), E = l(async (t, n) => (await s.resolve(e).organizationAdminPoliciesPutOne(n.id, {
|
|
24
25
|
id: n.id,
|
|
25
26
|
...t
|
|
26
|
-
})).data, []), D = l(async (t) => (await s.resolve(e).organizationAdminPoliciesPostOne(t)).data, []), O = l((e) => S.getName(e) ?? e.id, [S]), k = u(() =>
|
|
27
|
-
is_active:
|
|
28
|
-
organization_id:
|
|
29
|
-
user_id:
|
|
27
|
+
})).data, []), D = l(async (t) => (await s.resolve(e).organizationAdminPoliciesPostOne(t)).data, []), O = l((e) => S.getName(e) ?? e.id, [S]), k = u(() => p().shape({
|
|
28
|
+
is_active: _.boolean.nullable(),
|
|
29
|
+
organization_id: m().required().uuid4(),
|
|
30
|
+
user_id: m().required().uuid4()
|
|
30
31
|
}), []), A = u(() => [
|
|
31
32
|
{
|
|
32
|
-
definition:
|
|
33
|
+
definition: g.AUTOCOMPLETE,
|
|
33
34
|
label: y`Organization`,
|
|
34
35
|
loading: b.isLoading,
|
|
35
36
|
name: "organization_id",
|
|
36
37
|
options: b.options
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
|
-
definition:
|
|
40
|
+
definition: g.AUTOCOMPLETE,
|
|
40
41
|
label: y`User`,
|
|
41
42
|
loading: x.isLoading,
|
|
42
43
|
name: "user_id",
|
|
43
44
|
options: x.options
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
|
-
definition:
|
|
47
|
+
definition: g.BOOLEAN,
|
|
47
48
|
label: y`Active`,
|
|
48
49
|
name: "is_active"
|
|
49
50
|
}
|
|
@@ -88,7 +89,7 @@ var y = () => {
|
|
|
88
89
|
resourceQueryKeyBase: o.ORGANIZATION_ADMIN_POLICIES,
|
|
89
90
|
schema: k,
|
|
90
91
|
tableColumns: j,
|
|
91
|
-
testIdAttributes:
|
|
92
|
+
testIdAttributes: h.createAttributes("OrganizationAdminPoliciesAdminPage"),
|
|
92
93
|
title: y`Organization admin policies`,
|
|
93
94
|
updateOne: E
|
|
94
95
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TableUtil","CrudPage","OrganizationAdminPoliciesAdminPage","useTranslation","organizationOptionsQuery","useOrganizationOptionsQuery","userOptionsQuery","useUserOptionsQuery","organizationAdminPolicyNameFactory","useOrganizationAdminPolicyNameFactory","loadables","useArray","fetchAll","useCallback","container","API_ABAC_TOKEN","deleteOne","item","updateOne","variables","createOne","getName","schema","useMemo","object","
|
|
1
|
+
{"version":3,"file":"index.js","names":["TableUtil","CrudPage","OrganizationAdminPoliciesAdminPage","useTranslation","organizationOptionsQuery","useOrganizationOptionsQuery","userOptionsQuery","useUserOptionsQuery","organizationAdminPolicyNameFactory","useOrganizationAdminPolicyNameFactory","loadables","useArray","fetchAll","useCallback","container","API_ABAC_TOKEN","deleteOne","item","updateOne","variables","createOne","getName","schema","useMemo","object","SchemaUtil","string","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","t","tableColumns","CommonDbCommandName","COMMON_QUERY_KEY","TestIdUtil"],"sources":["../../../src/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n object,\n string,\n} from 'yup';\nimport type { CommonDbOrganizationAdminPolicy } from '@gen-epix/api-commondb';\nimport { CommonDbCommandName } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { API_ABAC_TOKEN } from '../../constants/api.constants';\nimport { useOrganizationAdminPolicyNameFactory } from '../../dataHooks/useOrganizationAdminPoliciesQuery';\nimport { useOrganizationOptionsQuery } from '../../dataHooks/useOrganizationsQuery';\nimport { useUserOptionsQuery } from '../../dataHooks/useUsersQuery';\nimport type { TableColumn } from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { CrudPage } from '../CrudPage';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\ntype FormFields = OmitWithMetaData<CommonDbOrganizationAdminPolicy, 'organization' | 'user'>;\n\nexport const OrganizationAdminPoliciesAdminPage = () => {\n const { t } = useTranslation();\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const userOptionsQuery = useUserOptionsQuery();\n const organizationAdminPolicyNameFactory = useOrganizationAdminPolicyNameFactory();\n\n const loadables = useArray([organizationOptionsQuery, userOptionsQuery, organizationAdminPolicyNameFactory]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbOrganizationAdminPolicy) => {\n return await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesDeleteOne(item.id);\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbOrganizationAdminPolicy) => {\n return (await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesPostOne(variables)).data;\n }, []);\n\n const getName = useCallback((item: CommonDbOrganizationAdminPolicy) => {\n return organizationAdminPolicyNameFactory.getName(item) ?? item.id;\n }, [organizationAdminPolicyNameFactory]);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n is_active: SchemaUtil.boolean.nullable(),\n organization_id: string().required().uuid4(),\n user_id: string().required().uuid4(),\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Organization`,\n loading: organizationOptionsQuery.isLoading,\n name: 'organization_id',\n options: organizationOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`User`,\n loading: userOptionsQuery.isLoading,\n name: 'user_id',\n options: userOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [organizationOptionsQuery.isLoading, organizationOptionsQuery.options, t, userOptionsQuery.isLoading, userOptionsQuery.options]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbOrganizationAdminPolicy>[] => {\n return [\n TableUtil.createOptionsColumn<CommonDbOrganizationAdminPolicy>({ id: 'organization_id', name: t`Organization`, options: organizationOptionsQuery.options }),\n TableUtil.createOptionsColumn<CommonDbOrganizationAdminPolicy>({ id: 'user_id', name: t`User`, options: userOptionsQuery.options }),\n TableUtil.createBooleanColumn<CommonDbOrganizationAdminPolicy>({ id: 'is_active', name: t`Is active` }),\n ];\n }, [organizationOptionsQuery.options, t, userOptionsQuery.options]);\n\n return (\n <CrudPage<FormFields, CommonDbOrganizationAdminPolicy>\n createItemDialogTitle={t`Create new organization admin policy`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.OrganizationAdminPolicyCrudCommand}\n defaultSortByField={'organization_id'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Organization admin policy`}\n loadables={loadables}\n resourceQueryKeyBase={COMMON_QUERY_KEY.ORGANIZATION_ADMIN_POLICIES}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OrganizationAdminPoliciesAdminPage')}\n title={t`Organization admin policies`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,IAAaE,UAA2C;CACtD,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAA2BC,EAA4B,GACvDC,IAAmBC,EAAoB,GACvCC,IAAqCC,EAAsC,GAE3EC,IAAYC,EAAS;EAACP;EAA0BE;EAAkBE;CAAkC,CAAC,GAErGI,IAAWC,EAAY,OAAO,OAC1B,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,gCAAgC,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,EAAI,MACzG,CAAC,CAAC,GAECC,IAAYH,EAAY,OAAO,MAC5B,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,mCAAmCE,EAAK,EAAE,GACxF,CAAC,CAAC,GAECC,IAAYL,EAAY,OAAO,GAAuB,OAClD,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,gCAAgCE,EAAK,IAAI;EAAE,IAAIA,EAAK;EAAI,GAAGE;CAAU,CAAC,EAAA,CAAG,MACxH,CAAC,CAAC,GAECC,IAAYP,EAAY,OAAO,OAC3B,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,iCAAiCI,CAAS,EAAA,CAAG,MAC5F,CAAC,CAAC,GAECE,IAAUR,GAAa,MACpBL,EAAmC,QAAQS,CAAI,KAAKA,EAAK,IAC/D,CAACT,CAAkC,CAAC,GAEjCc,IAASC,QACNC,EAAmB,CAAC,CAAC,MAAM;EAChC,WAAWC,EAAW,QAAQ,SAAS;EACvC,iBAAiBC,EAAO,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM;EAC3C,SAASA,EAAO,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM;CACrC,CAAC,GACA,CAAC,CAAC,GAECC,IAAuBJ,QACpB;EACL;GACE,YAAYK,EAA2B;GACvC,OAAO,CAAC;GACR,SAASxB,EAAyB;GAClC,MAAM;GACN,SAASA,EAAyB;EACpC;EACA;GACE,YAAYwB,EAA2B;GACvC,OAAO,CAAC;GACR,SAAStB,EAAiB;GAC1B,MAAM;GACN,SAASA,EAAiB;EAC5B;EACA;GACE,YAAYsB,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;CACF,GACC;EAACxB,EAAyB;EAAWA,EAAyB;EAASyB;EAAGvB,EAAiB;EAAWA,EAAiB;CAAO,CAAC,GAE5HwB,IAAeP,QACZ;EACLvB,EAAU,oBAAqD;GAAE,IAAI;GAAmB,MAAM,CAAC;GAAgB,SAASI,EAAyB;EAAQ,CAAC;EAC1JJ,EAAU,oBAAqD;GAAE,IAAI;GAAW,MAAM,CAAC;GAAQ,SAASM,EAAiB;EAAQ,CAAC;EAClIN,EAAU,oBAAqD;GAAE,IAAI;GAAa,MAAM,CAAC;EAAY,CAAC;CACxG,GACC;EAACI,EAAyB;EAASyB;EAAGvB,EAAiB;CAAO,CAAC;CAElE,OACE,kBAACL,GAAD;EACE,uBAAuB,CAAC;EACb;EACX,iBAAiB8B,EAAoB;EACrC,oBAAoB;EACpB,sBAAsB;EACX;EACD;EACY;EACb;EACT,UAAU,CAAC;EACA;EACX,sBAAsBC,EAAiB;EAC/B;EACM;EACd,kBAAkBC,EAAW,iBAAiB,oCAAoC;EAClF,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
|
|
@@ -8,126 +8,126 @@ import { CommonDbCommandName as o, CommonDbPermissionType as s } from "@gen-epix
|
|
|
8
8
|
import { useCallback as c, useMemo as l } from "react";
|
|
9
9
|
import { jsx as u } from "react/jsx-runtime";
|
|
10
10
|
import { useTranslation as d } from "react-i18next";
|
|
11
|
-
import {
|
|
12
|
-
import { TestIdUtil as
|
|
13
|
-
import { FORM_FIELD_DEFINITION_TYPE as
|
|
14
|
-
import { SchemaUtil as
|
|
11
|
+
import { object as f } from "yup";
|
|
12
|
+
import { TestIdUtil as p } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
13
|
+
import { FORM_FIELD_DEFINITION_TYPE as m } from "@gen-epix/ui-core-form/models/form.models";
|
|
14
|
+
import { SchemaUtil as h } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
15
15
|
// src/pages/OutagesAdminPage/OutagesAdminPage.tsx
|
|
16
|
-
var
|
|
17
|
-
let { t:
|
|
16
|
+
var g = () => {
|
|
17
|
+
let { t: g } = d(), _ = c(async (t) => (await i.resolve(e).outagesGetAll(null, null, { signal: t }))?.data, []), v = c(async (t) => await i.resolve(e).outagesDeleteOne(t.id), []), y = c(async (t, n) => (await i.resolve(e).outagesPutOne(n.id, {
|
|
18
18
|
id: n.id,
|
|
19
19
|
...t
|
|
20
|
-
})).data, []),
|
|
21
|
-
active_from:
|
|
22
|
-
active_to:
|
|
23
|
-
description:
|
|
24
|
-
is_active:
|
|
25
|
-
is_visible:
|
|
26
|
-
visible_from:
|
|
27
|
-
visible_to:
|
|
28
|
-
}), []),
|
|
20
|
+
})).data, []), b = c(async (t) => (await i.resolve(e).outagesPostOne(t)).data, []), x = c((e) => e.description, []), S = l(() => f().shape({
|
|
21
|
+
active_from: h.isoString,
|
|
22
|
+
active_to: h.isoString,
|
|
23
|
+
description: h.description.required(),
|
|
24
|
+
is_active: h.boolean.nullable(),
|
|
25
|
+
is_visible: h.boolean.nullable(),
|
|
26
|
+
visible_from: h.isoString,
|
|
27
|
+
visible_to: h.isoString
|
|
28
|
+
}), []), C = l(() => [
|
|
29
29
|
{
|
|
30
|
-
definition:
|
|
31
|
-
label:
|
|
30
|
+
definition: m.TEXTFIELD,
|
|
31
|
+
label: g`Description`,
|
|
32
32
|
multiline: !0,
|
|
33
33
|
name: "description",
|
|
34
34
|
rows: 5
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
dateFormat: a.DATE_TIME,
|
|
38
|
-
definition:
|
|
39
|
-
label:
|
|
38
|
+
definition: m.DATE,
|
|
39
|
+
label: g`Active from`,
|
|
40
40
|
name: "active_from"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
dateFormat: a.DATE_TIME,
|
|
44
|
-
definition:
|
|
45
|
-
label:
|
|
44
|
+
definition: m.DATE,
|
|
45
|
+
label: g`Active to`,
|
|
46
46
|
name: "active_to"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
dateFormat: a.DATE_TIME,
|
|
50
|
-
definition:
|
|
51
|
-
label:
|
|
50
|
+
definition: m.DATE,
|
|
51
|
+
label: g`Visible from`,
|
|
52
52
|
name: "visible_from"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
dateFormat: a.DATE_TIME,
|
|
56
|
-
definition:
|
|
57
|
-
label:
|
|
56
|
+
definition: m.DATE,
|
|
57
|
+
label: g`Visible to`,
|
|
58
58
|
name: "visible_to"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
definition:
|
|
62
|
-
label:
|
|
61
|
+
definition: m.BOOLEAN,
|
|
62
|
+
label: g`Is active`,
|
|
63
63
|
name: "is_active"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
definition:
|
|
67
|
-
label:
|
|
66
|
+
definition: m.BOOLEAN,
|
|
67
|
+
label: g`Is visible`,
|
|
68
68
|
name: "is_visible"
|
|
69
69
|
}
|
|
70
|
-
], [
|
|
70
|
+
], [g]), w = l(() => [
|
|
71
71
|
t.createDateColumn({
|
|
72
72
|
dateFormat: a.DATE_TIME,
|
|
73
73
|
id: "active_from",
|
|
74
|
-
name:
|
|
74
|
+
name: g`Active from`
|
|
75
75
|
}),
|
|
76
76
|
t.createDateColumn({
|
|
77
77
|
dateFormat: a.DATE_TIME,
|
|
78
78
|
id: "active_to",
|
|
79
|
-
name:
|
|
79
|
+
name: g`Active to`
|
|
80
80
|
}),
|
|
81
81
|
t.createDateColumn({
|
|
82
82
|
dateFormat: a.DATE_TIME,
|
|
83
83
|
id: "visible_from",
|
|
84
|
-
name:
|
|
84
|
+
name: g`Visible from`
|
|
85
85
|
}),
|
|
86
86
|
t.createDateColumn({
|
|
87
87
|
dateFormat: a.DATE_TIME,
|
|
88
88
|
id: "visible_to",
|
|
89
|
-
name:
|
|
89
|
+
name: g`Visible to`
|
|
90
90
|
}),
|
|
91
91
|
t.createBooleanColumn({
|
|
92
92
|
id: "is_active",
|
|
93
|
-
name:
|
|
93
|
+
name: g`Is active`
|
|
94
94
|
}),
|
|
95
95
|
t.createBooleanColumn({
|
|
96
96
|
id: "is_visible",
|
|
97
|
-
name:
|
|
97
|
+
name: g`Is visible`
|
|
98
98
|
})
|
|
99
|
-
], [
|
|
99
|
+
], [g]), T = l(() => [{
|
|
100
100
|
command_name: o.OutageCrudCommand,
|
|
101
101
|
permission_type: s.CREATE
|
|
102
|
-
}], []),
|
|
102
|
+
}], []), E = l(() => [{
|
|
103
103
|
command_name: o.OutageCrudCommand,
|
|
104
104
|
permission_type: s.DELETE
|
|
105
|
-
}], []),
|
|
105
|
+
}], []), D = l(() => [{
|
|
106
106
|
command_name: o.OutageCrudCommand,
|
|
107
107
|
permission_type: s.UPDATE
|
|
108
108
|
}], []);
|
|
109
109
|
return /* @__PURE__ */ u(n, {
|
|
110
|
-
createItemDialogTitle:
|
|
111
|
-
createOne:
|
|
110
|
+
createItemDialogTitle: g`Create new outage`,
|
|
111
|
+
createOne: b,
|
|
112
112
|
crudCommandType: o.OutageCrudCommand,
|
|
113
113
|
defaultSortByField: "active_from",
|
|
114
114
|
defaultSortDirection: "asc",
|
|
115
|
-
deleteOne:
|
|
116
|
-
extraCreateOnePermissions:
|
|
117
|
-
extraDeleteOnePermissions:
|
|
118
|
-
extraUpdateOnePermissions:
|
|
119
|
-
fetchAll:
|
|
120
|
-
formFieldDefinitions:
|
|
121
|
-
getName:
|
|
122
|
-
itemName:
|
|
115
|
+
deleteOne: v,
|
|
116
|
+
extraCreateOnePermissions: T,
|
|
117
|
+
extraDeleteOnePermissions: E,
|
|
118
|
+
extraUpdateOnePermissions: D,
|
|
119
|
+
fetchAll: _,
|
|
120
|
+
formFieldDefinitions: C,
|
|
121
|
+
getName: x,
|
|
122
|
+
itemName: g`Outage`,
|
|
123
123
|
resourceQueryKeyBase: r.OUTAGES,
|
|
124
|
-
schema:
|
|
125
|
-
tableColumns:
|
|
126
|
-
testIdAttributes:
|
|
127
|
-
title:
|
|
128
|
-
updateOne:
|
|
124
|
+
schema: S,
|
|
125
|
+
tableColumns: w,
|
|
126
|
+
testIdAttributes: p.createAttributes("OutagesAdminPage"),
|
|
127
|
+
title: g`Outages`,
|
|
128
|
+
updateOne: y
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
|
-
export {
|
|
131
|
+
export { g as OutagesAdminPage };
|
|
132
132
|
|
|
133
133
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CrudPage","OutagesAdminPage","useTranslation","fetchAll","useCallback","container","API_SYSTEM_TOKEN","deleteOne","item","updateOne","variables","createOne","getName","schema","useMemo","object","SchemaUtil","
|
|
1
|
+
{"version":3,"file":"index.js","names":["CrudPage","OutagesAdminPage","useTranslation","fetchAll","useCallback","container","API_SYSTEM_TOKEN","deleteOne","item","updateOne","variables","createOne","getName","schema","useMemo","object","SchemaUtil","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","DATE_FORMAT","t","tableColumns","TableUtil","extraCreateOnePermissions","CommonDbCommandName","CommonDbPermissionType","extraDeleteOnePermissions","extraUpdateOnePermissions","COMMON_QUERY_KEY","TestIdUtil"],"sources":["../../../src/pages/OutagesAdminPage/OutagesAdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { object } from 'yup';\nimport type {\n CommonDbApiPermission,\n CommonDbOutage,\n} from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\n\nimport { API_SYSTEM_TOKEN } from '../../constants/api.constants';\nimport type { TableColumn } from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport { CrudPage } from '../CrudPage';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\ntype FormFields = OmitWithMetaData<CommonDbOutage>;\n\nexport const OutagesAdminPage = () => {\n const { t } = useTranslation();\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_SYSTEM_TOKEN).outagesGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbOutage) => {\n return await container.resolve(API_SYSTEM_TOKEN).outagesDeleteOne(item.id);\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbOutage) => {\n return (await container.resolve(API_SYSTEM_TOKEN).outagesPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await container.resolve(API_SYSTEM_TOKEN).outagesPostOne(variables)).data;\n }, []);\n\n const getName = useCallback((item: CommonDbOutage) => {\n return item.description;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n active_from: SchemaUtil.isoString,\n active_to: SchemaUtil.isoString,\n description: SchemaUtil.description.required(),\n is_active: SchemaUtil.boolean.nullable(),\n is_visible: SchemaUtil.boolean.nullable(),\n visible_from: SchemaUtil.isoString,\n visible_to: SchemaUtil.isoString,\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n multiline: true,\n name: 'description',\n rows: 5,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n dateFormat: DATE_FORMAT.DATE_TIME,\n definition: FORM_FIELD_DEFINITION_TYPE.DATE,\n label: t`Active from`,\n name: 'active_from',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n dateFormat: DATE_FORMAT.DATE_TIME,\n definition: FORM_FIELD_DEFINITION_TYPE.DATE,\n label: t`Active to`,\n name: 'active_to',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n dateFormat: DATE_FORMAT.DATE_TIME,\n definition: FORM_FIELD_DEFINITION_TYPE.DATE,\n label: t`Visible from`,\n name: 'visible_from',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n dateFormat: DATE_FORMAT.DATE_TIME,\n definition: FORM_FIELD_DEFINITION_TYPE.DATE,\n label: t`Visible to`,\n name: 'visible_to',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is visible`,\n name: 'is_visible',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [t]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbOutage>[] => {\n return [\n TableUtil.createDateColumn<CommonDbOutage>({ dateFormat: DATE_FORMAT.DATE_TIME, id: 'active_from', name: t`Active from` }),\n TableUtil.createDateColumn<CommonDbOutage>({ dateFormat: DATE_FORMAT.DATE_TIME, id: 'active_to', name: t`Active to` }),\n TableUtil.createDateColumn<CommonDbOutage>({ dateFormat: DATE_FORMAT.DATE_TIME, id: 'visible_from', name: t`Visible from` }),\n TableUtil.createDateColumn<CommonDbOutage>({ dateFormat: DATE_FORMAT.DATE_TIME, id: 'visible_to', name: t`Visible to` }),\n TableUtil.createBooleanColumn<CommonDbOutage>({ id: 'is_active', name: t`Is active` }),\n TableUtil.createBooleanColumn<CommonDbOutage>({ id: 'is_visible', name: t`Is visible` }),\n ];\n }, [t]);\n\n\n const extraCreateOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.OutageCrudCommand, permission_type: CommonDbPermissionType.CREATE },\n ], []);\n const extraDeleteOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.OutageCrudCommand, permission_type: CommonDbPermissionType.DELETE },\n ], []);\n const extraUpdateOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.OutageCrudCommand, permission_type: CommonDbPermissionType.UPDATE },\n ], []);\n\n return (\n <CrudPage<FormFields, CommonDbOutage>\n createItemDialogTitle={t`Create new outage`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.OutageCrudCommand}\n defaultSortByField={'active_from'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraCreateOnePermissions={extraCreateOnePermissions}\n extraDeleteOnePermissions={extraDeleteOnePermissions}\n extraUpdateOnePermissions={extraUpdateOnePermissions}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Outage`}\n resourceQueryKeyBase={COMMON_QUERY_KEY.OUTAGES}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OutagesAdminPage')}\n title={t`Outages`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,IAAaC,UAAyB;CACpC,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IAAWC,EAAY,OAAO,OAC1B,MAAMC,EAAU,QAAQC,CAAgB,CAAC,CAAC,cAAc,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,EAAI,MACzF,CAAC,CAAC,GAECC,IAAYH,EAAY,OAAO,MAC5B,MAAMC,EAAU,QAAQC,CAAgB,CAAC,CAAC,iBAAiBE,EAAK,EAAE,GACxE,CAAC,CAAC,GAECC,IAAYL,EAAY,OAAO,GAAuB,OAClD,MAAMC,EAAU,QAAQC,CAAgB,CAAC,CAAC,cAAcE,EAAK,IAAI;EAAE,IAAIA,EAAK;EAAI,GAAGE;CAAU,CAAC,EAAA,CAAG,MACxG,CAAC,CAAC,GAECC,IAAYP,EAAY,OAAO,OAC3B,MAAMC,EAAU,QAAQC,CAAgB,CAAC,CAAC,eAAeI,CAAS,EAAA,CAAG,MAC5E,CAAC,CAAC,GAECE,IAAUR,GAAa,MACpBI,EAAK,aACX,CAAC,CAAC,GAECK,IAASC,QACNC,EAAmB,CAAC,CAAC,MAAM;EAChC,aAAaC,EAAW;EACxB,WAAWA,EAAW;EACtB,aAAaA,EAAW,YAAY,SAAS;EAC7C,WAAWA,EAAW,QAAQ,SAAS;EACvC,YAAYA,EAAW,QAAQ,SAAS;EACxC,cAAcA,EAAW;EACzB,YAAYA,EAAW;CACzB,CAAC,GACA,CAAC,CAAC,GAECC,IAAuBH,QACpB;EACL;GACE,YAAYI,EAA2B;GACvC,OAAO,CAAC;GACR,WAAW;GACX,MAAM;GACN,MAAM;EACR;EACA;GACE,YAAYC,EAAY;GACxB,YAAYD,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;EACA;GACE,YAAYC,EAAY;GACxB,YAAYD,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;EACA;GACE,YAAYC,EAAY;GACxB,YAAYD,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;EACA;GACE,YAAYC,EAAY;GACxB,YAAYD,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;EACA;GACE,YAAYA,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;EACA;GACE,YAAYA,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;CACF,GACC,CAACE,CAAC,CAAC,GAEAC,IAAeP,QACZ;EACLQ,EAAU,iBAAiC;GAAE,YAAYH,EAAY;GAAW,IAAI;GAAe,MAAM,CAAC;EAAc,CAAC;EACzHG,EAAU,iBAAiC;GAAE,YAAYH,EAAY;GAAW,IAAI;GAAa,MAAM,CAAC;EAAY,CAAC;EACrHG,EAAU,iBAAiC;GAAE,YAAYH,EAAY;GAAW,IAAI;GAAgB,MAAM,CAAC;EAAe,CAAC;EAC3HG,EAAU,iBAAiC;GAAE,YAAYH,EAAY;GAAW,IAAI;GAAc,MAAM,CAAC;EAAa,CAAC;EACvHG,EAAU,oBAAoC;GAAE,IAAI;GAAa,MAAM,CAAC;EAAY,CAAC;EACrFA,EAAU,oBAAoC;GAAE,IAAI;GAAc,MAAM,CAAC;EAAa,CAAC;CACzF,GACC,CAACF,CAAC,CAAC,GAGAG,IAA4BT,QAAuC,CACvE;EAAE,cAAcU,EAAoB;EAAmB,iBAAiBC,EAAuB;CAAO,CACxG,GAAG,CAAC,CAAC,GACCC,IAA4BZ,QAAuC,CACvE;EAAE,cAAcU,EAAoB;EAAmB,iBAAiBC,EAAuB;CAAO,CACxG,GAAG,CAAC,CAAC,GACCE,IAA4Bb,QAAuC,CACvE;EAAE,cAAcU,EAAoB;EAAmB,iBAAiBC,EAAuB;CAAO,CACxG,GAAG,CAAC,CAAC;CAEL,OACE,kBAACzB,GAAD;EACE,uBAAuB,CAAC;EACb;EACX,iBAAiBwB,EAAoB;EACrC,oBAAoB;EACpB,sBAAsB;EACX;EACgB;EACA;EACA;EACjB;EACY;EACb;EACT,UAAU,CAAC;EACX,sBAAsBI,EAAiB;EAC/B;EACM;EACd,kBAAkBC,EAAW,iBAAiB,kBAAkB;EAChE,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
|