@fluxo-dev/shell 0.0.51 → 0.0.53
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/index.esm.js +417 -146
- package/package.json +12 -12
- package/src/lib/app.d.ts +7 -0
- package/src/lib/pages/settings/security/components/domani-role/domain-role-form.d.ts +1 -0
- package/src/lib/pages/settings/security/components/domani-role/frontend-domain-role.d.ts +1 -0
- package/src/lib/pages/settings/security/components/user/user-form.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -10,7 +10,7 @@ import { MinimalStateViewer, RavifyProvider, JobsViewer } from '@fluxo-dev/shell
|
|
|
10
10
|
import { useAppSelector, store as store$4 } from '@fluxo-dev/state';
|
|
11
11
|
import { useHotkeys, useOs, useIdle, useWindowEvent, useResizeObserver, useMediaQuery, useTimeout } from '@mantine/hooks';
|
|
12
12
|
import { openSpotlight, Spotlight } from '@mantine/spotlight';
|
|
13
|
-
import { AppType, AppState, FluxoStateDispatcher, FluxoClientSys, UserService, AppMenuContextType, ApiKeyService, DomainRoleService, EmailServerProviderType, RavifyInstanceProtocol, RavifyInstanceVersion } from '@fluxo-dev/api-client-base';
|
|
13
|
+
import { AppType, AppState, FluxoStateDispatcher, FluxoClientSys, UserService, AppMenuContextType, ApiKeyService, DomainRoleService, FluxoACLMode, EmailServerProviderType, RavifyInstanceProtocol, RavifyInstanceVersion } from '@fluxo-dev/api-client-base';
|
|
14
14
|
import { showNotification, Notifications } from '@mantine/notifications';
|
|
15
15
|
import { unstable_batchedUpdates, flushSync as flushSync$1, createPortal } from 'react-dom';
|
|
16
16
|
import { useForm } from '@mantine/form';
|
|
@@ -36882,7 +36882,8 @@ function DomainRoleForm(props) {
|
|
|
36882
36882
|
initialValues: {
|
|
36883
36883
|
name: (_b = (_a = props.domainRole) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '',
|
|
36884
36884
|
description: (_d = (_c = props.domainRole) === null || _c === void 0 ? void 0 : _c.description) !== null && _d !== void 0 ? _d : '',
|
|
36885
|
-
identifier: (_f = (_e = props.domainRole) === null || _e === void 0 ? void 0 : _e.identifier) !== null && _f !== void 0 ? _f : ''
|
|
36885
|
+
identifier: (_f = (_e = props.domainRole) === null || _e === void 0 ? void 0 : _e.identifier) !== null && _f !== void 0 ? _f : '',
|
|
36886
|
+
external: props.external
|
|
36886
36887
|
}
|
|
36887
36888
|
});
|
|
36888
36889
|
const save = value => {
|
|
@@ -36967,7 +36968,7 @@ function FrontendDomainRole(props) {
|
|
|
36967
36968
|
useEffect(() => {
|
|
36968
36969
|
if (!frontends) return;
|
|
36969
36970
|
FluxoClientSys.Instance.configuration.getFrontendByDomainRole(props.domainRoleId).then(a => {
|
|
36970
|
-
setFrontendDomainRole(frontends.map(b => {
|
|
36971
|
+
setFrontendDomainRole(frontends.filter(a => a.external === props.external).map(b => {
|
|
36971
36972
|
return {
|
|
36972
36973
|
id: b.id,
|
|
36973
36974
|
name: b.name,
|
|
@@ -37053,6 +37054,11 @@ function DomainRoleGrid() {
|
|
|
37053
37054
|
const [updateDomainRolePermissionsModal, setUpdateDomainRolePermissionsModal] = useState(false);
|
|
37054
37055
|
const [allDomainRolesFrontends, setAllDomainRolesFrontends] = useState();
|
|
37055
37056
|
const [loading, setLoading] = useState(true);
|
|
37057
|
+
const [createUpdateExternal, setCreateUpdateExternal] = useState(false);
|
|
37058
|
+
const {
|
|
37059
|
+
allowExternalUsers,
|
|
37060
|
+
aclMode
|
|
37061
|
+
} = useAppSelector(state => state.layout.systemSettings);
|
|
37056
37062
|
useEffect(() => {
|
|
37057
37063
|
refreshDomainRoles();
|
|
37058
37064
|
}, []);
|
|
@@ -37098,144 +37104,286 @@ function DomainRoleGrid() {
|
|
|
37098
37104
|
});
|
|
37099
37105
|
});
|
|
37100
37106
|
};
|
|
37101
|
-
const checkIfExistDomainRoleWithoutFrontend =
|
|
37107
|
+
const checkIfExistDomainRoleWithoutFrontend = type => {
|
|
37102
37108
|
return (allDomainRolesFrontends === null || allDomainRolesFrontends === void 0 ? void 0 : allDomainRolesFrontends.some(a => a.frontends.length === 0)) || false;
|
|
37103
37109
|
};
|
|
37104
|
-
return jsxs(
|
|
37105
|
-
|
|
37106
|
-
|
|
37107
|
-
|
|
37108
|
-
|
|
37109
|
-
|
|
37110
|
-
|
|
37111
|
-
|
|
37112
|
-
|
|
37113
|
-
|
|
37114
|
-
|
|
37115
|
-
|
|
37116
|
-
|
|
37117
|
-
|
|
37118
|
-
|
|
37119
|
-
|
|
37120
|
-
|
|
37121
|
-
|
|
37122
|
-
|
|
37123
|
-
|
|
37124
|
-
|
|
37125
|
-
|
|
37126
|
-
|
|
37127
|
-
|
|
37128
|
-
|
|
37129
|
-
|
|
37130
|
-
|
|
37131
|
-
|
|
37132
|
-
|
|
37133
|
-
children:
|
|
37134
|
-
|
|
37135
|
-
|
|
37136
|
-
|
|
37137
|
-
children:
|
|
37138
|
-
}), jsx(Table.Th, {
|
|
37139
|
-
w: 150,
|
|
37140
|
-
children: "Identificatore"
|
|
37141
|
-
}), jsx(Table.Th, {
|
|
37142
|
-
w: 150,
|
|
37143
|
-
children: "Nome"
|
|
37144
|
-
}), jsx(Table.Th, {
|
|
37145
|
-
children: "Descrizione"
|
|
37146
|
-
}), jsx(Table.Th, {
|
|
37147
|
-
w: 100,
|
|
37148
|
-
children: "Permessi"
|
|
37149
|
-
}), jsx(Table.Th, {
|
|
37150
|
-
w: 100,
|
|
37151
|
-
children: "Aree"
|
|
37152
|
-
}), jsx(Table.Th, {
|
|
37153
|
-
w: 100
|
|
37154
|
-
})]
|
|
37155
|
-
})
|
|
37156
|
-
}), jsx(Table.Tbody, {
|
|
37157
|
-
children: domainRoles.map((element, i) => {
|
|
37158
|
-
var _a;
|
|
37159
|
-
return jsxs(Table.Tr, {
|
|
37160
|
-
children: [jsx(Table.Td, {
|
|
37110
|
+
return jsxs(Stack, {
|
|
37111
|
+
children: [checkIfExistDomainRoleWithoutFrontend() && jsx(Alert, {
|
|
37112
|
+
color: 'yellow',
|
|
37113
|
+
title: 'Attenzione',
|
|
37114
|
+
children: "Esistono ruoli utente senza aree funzionali assegnate"
|
|
37115
|
+
}), jsx(DataCard, {
|
|
37116
|
+
title: 'Ruoli utente (Organizzazione)',
|
|
37117
|
+
actions: aclMode === FluxoACLMode.Permission ? [{
|
|
37118
|
+
icon: jsx(IconPlus, {
|
|
37119
|
+
size: 18
|
|
37120
|
+
}),
|
|
37121
|
+
label: 'Nuovo ruolo organizzazione',
|
|
37122
|
+
disabled: loading,
|
|
37123
|
+
onClick: () => {
|
|
37124
|
+
setCreateUpdateExternal(false);
|
|
37125
|
+
setCurrentDomainRole(undefined);
|
|
37126
|
+
setDomainRoleModalOpen(true);
|
|
37127
|
+
}
|
|
37128
|
+
}] : [],
|
|
37129
|
+
children: jsxs(Box, {
|
|
37130
|
+
pos: "relative",
|
|
37131
|
+
children: [jsx(LoadingOverlay, {
|
|
37132
|
+
visible: loading,
|
|
37133
|
+
zIndex: 1000,
|
|
37134
|
+
overlayProps: {
|
|
37135
|
+
radius: "sm",
|
|
37136
|
+
blur: 2
|
|
37137
|
+
}
|
|
37138
|
+
}), jsx(Stack, {
|
|
37139
|
+
children: jsxs(Table, {
|
|
37140
|
+
highlightOnHover: true,
|
|
37141
|
+
children: [jsx(Table.Thead, {
|
|
37142
|
+
children: jsxs(Table.Tr, {
|
|
37143
|
+
children: [jsx(Table.Th, {
|
|
37161
37144
|
w: 50,
|
|
37162
|
-
children:
|
|
37163
|
-
}), jsx(Table.
|
|
37145
|
+
children: "Id"
|
|
37146
|
+
}), jsx(Table.Th, {
|
|
37164
37147
|
w: 150,
|
|
37165
|
-
children:
|
|
37166
|
-
}), jsx(Table.
|
|
37148
|
+
children: "Identificatore"
|
|
37149
|
+
}), jsx(Table.Th, {
|
|
37167
37150
|
w: 150,
|
|
37168
|
-
children:
|
|
37169
|
-
}), jsx(Table.
|
|
37170
|
-
children:
|
|
37171
|
-
}), jsx(Table.
|
|
37151
|
+
children: "Nome"
|
|
37152
|
+
}), jsx(Table.Th, {
|
|
37153
|
+
children: "Descrizione"
|
|
37154
|
+
}), aclMode === FluxoACLMode.Permission && jsx(Table.Th, {
|
|
37172
37155
|
w: 100,
|
|
37173
|
-
children:
|
|
37174
|
-
}), jsx(Table.
|
|
37156
|
+
children: "Permessi"
|
|
37157
|
+
}), jsx(Table.Th, {
|
|
37175
37158
|
w: 100,
|
|
37176
|
-
children:
|
|
37177
|
-
|
|
37178
|
-
|
|
37179
|
-
|
|
37180
|
-
|
|
37181
|
-
|
|
37182
|
-
|
|
37183
|
-
|
|
37184
|
-
|
|
37185
|
-
children:
|
|
37186
|
-
|
|
37187
|
-
|
|
37188
|
-
|
|
37189
|
-
|
|
37190
|
-
|
|
37191
|
-
|
|
37159
|
+
children: "Aree"
|
|
37160
|
+
}), jsx(Table.Th, {
|
|
37161
|
+
w: 100
|
|
37162
|
+
})]
|
|
37163
|
+
})
|
|
37164
|
+
}), jsx(Table.Tbody, {
|
|
37165
|
+
children: domainRoles === null || domainRoles === void 0 ? void 0 : domainRoles.filter(a => !a.external).map((element, i) => {
|
|
37166
|
+
var _a;
|
|
37167
|
+
return jsxs(Table.Tr, {
|
|
37168
|
+
children: [jsx(Table.Td, {
|
|
37169
|
+
w: 50,
|
|
37170
|
+
children: element.id
|
|
37171
|
+
}), jsx(Table.Td, {
|
|
37172
|
+
w: 150,
|
|
37173
|
+
children: element.identifier
|
|
37174
|
+
}), jsx(Table.Td, {
|
|
37175
|
+
w: 150,
|
|
37176
|
+
children: element.name
|
|
37177
|
+
}), jsx(Table.Td, {
|
|
37178
|
+
children: element.description
|
|
37179
|
+
}), aclMode === FluxoACLMode.Permission && jsx(Table.Td, {
|
|
37180
|
+
w: 100,
|
|
37181
|
+
children: element.permissionCount
|
|
37182
|
+
}), jsx(Table.Td, {
|
|
37183
|
+
w: 100,
|
|
37184
|
+
children: (_a = allDomainRolesFrontends === null || allDomainRolesFrontends === void 0 ? void 0 : allDomainRolesFrontends.find(a => a.domainRoleId === element.id)) === null || _a === void 0 ? void 0 : _a.frontends.map(f => {
|
|
37185
|
+
return jsx(Badge, {
|
|
37186
|
+
color: 'blue',
|
|
37187
|
+
children: f
|
|
37188
|
+
});
|
|
37189
|
+
})
|
|
37190
|
+
}), jsx(Table.Td, {
|
|
37191
|
+
w: 100,
|
|
37192
|
+
align: "right",
|
|
37193
|
+
children: jsxs(Menu$1, {
|
|
37194
|
+
shadow: "md",
|
|
37195
|
+
width: 200,
|
|
37196
|
+
children: [jsx(Menu$1.Target, {
|
|
37197
|
+
children: jsx(ActionIcon, {
|
|
37198
|
+
children: jsx(IconDotsVertical, {
|
|
37199
|
+
size: 18
|
|
37200
|
+
})
|
|
37192
37201
|
})
|
|
37193
|
-
})
|
|
37194
|
-
|
|
37195
|
-
|
|
37196
|
-
|
|
37197
|
-
|
|
37198
|
-
|
|
37199
|
-
|
|
37200
|
-
|
|
37201
|
-
|
|
37202
|
-
|
|
37203
|
-
|
|
37204
|
-
|
|
37205
|
-
|
|
37206
|
-
|
|
37207
|
-
|
|
37208
|
-
|
|
37209
|
-
|
|
37210
|
-
|
|
37211
|
-
|
|
37212
|
-
|
|
37213
|
-
|
|
37214
|
-
|
|
37215
|
-
|
|
37216
|
-
|
|
37217
|
-
|
|
37218
|
-
|
|
37219
|
-
|
|
37220
|
-
|
|
37221
|
-
|
|
37222
|
-
|
|
37223
|
-
|
|
37224
|
-
|
|
37225
|
-
|
|
37226
|
-
|
|
37227
|
-
|
|
37228
|
-
|
|
37229
|
-
|
|
37202
|
+
}), jsxs(Menu$1.Dropdown, {
|
|
37203
|
+
children: [jsx(Menu$1.Item, {
|
|
37204
|
+
leftSection: jsx(IconGridDots, {
|
|
37205
|
+
size: 14
|
|
37206
|
+
}),
|
|
37207
|
+
onClick: () => {
|
|
37208
|
+
setCurrentDomainRole(element);
|
|
37209
|
+
setCreateUpdateExternal(false);
|
|
37210
|
+
setUpdateDomainFrontendsModal(true);
|
|
37211
|
+
},
|
|
37212
|
+
children: "Aree funzionali"
|
|
37213
|
+
}), aclMode === FluxoACLMode.Permission && jsxs(Fragment, {
|
|
37214
|
+
children: [jsx(Menu$1.Item, {
|
|
37215
|
+
leftSection: jsx(IconLock, {
|
|
37216
|
+
size: 14
|
|
37217
|
+
}),
|
|
37218
|
+
onClick: () => {
|
|
37219
|
+
setCurrentDomainRole(element);
|
|
37220
|
+
setUpdateDomainRolePermissionsModal(true);
|
|
37221
|
+
},
|
|
37222
|
+
children: "Permessi"
|
|
37223
|
+
}), jsx(Menu$1.Item, {
|
|
37224
|
+
onClick: () => {
|
|
37225
|
+
setCurrentDomainRole(element);
|
|
37226
|
+
setDomainRoleModalOpen(true);
|
|
37227
|
+
},
|
|
37228
|
+
leftSection: jsx(IconEdit, {
|
|
37229
|
+
size: 14
|
|
37230
|
+
}),
|
|
37231
|
+
children: "Modifica"
|
|
37232
|
+
}), jsx(Menu$1.Divider, {}), jsx(Menu$1.Item, {
|
|
37233
|
+
color: 'red',
|
|
37234
|
+
onClick: () => deleteDomainRole(element.id),
|
|
37235
|
+
leftSection: jsx(IconTrash, {
|
|
37236
|
+
color: 'red',
|
|
37237
|
+
size: 14
|
|
37238
|
+
}),
|
|
37239
|
+
children: "Elimina"
|
|
37240
|
+
})]
|
|
37241
|
+
})]
|
|
37230
37242
|
})]
|
|
37231
|
-
})
|
|
37232
|
-
})
|
|
37243
|
+
})
|
|
37244
|
+
})]
|
|
37245
|
+
}, i);
|
|
37246
|
+
})
|
|
37247
|
+
})]
|
|
37248
|
+
})
|
|
37249
|
+
})]
|
|
37250
|
+
})
|
|
37251
|
+
}), allowExternalUsers && jsx(DataCard, {
|
|
37252
|
+
title: 'Ruoli utente (Esterni)',
|
|
37253
|
+
actions: aclMode === FluxoACLMode.Permission ? [{
|
|
37254
|
+
icon: jsx(IconPlus, {
|
|
37255
|
+
size: 18
|
|
37256
|
+
}),
|
|
37257
|
+
label: 'Nuovo ruolo esterno',
|
|
37258
|
+
disabled: loading,
|
|
37259
|
+
onClick: () => {
|
|
37260
|
+
setCreateUpdateExternal(true);
|
|
37261
|
+
setCurrentDomainRole(undefined);
|
|
37262
|
+
setDomainRoleModalOpen(true);
|
|
37263
|
+
}
|
|
37264
|
+
}] : [],
|
|
37265
|
+
children: jsxs(Box, {
|
|
37266
|
+
pos: "relative",
|
|
37267
|
+
children: [jsx(LoadingOverlay, {
|
|
37268
|
+
visible: loading,
|
|
37269
|
+
zIndex: 1000,
|
|
37270
|
+
overlayProps: {
|
|
37271
|
+
radius: "sm",
|
|
37272
|
+
blur: 2
|
|
37273
|
+
}
|
|
37274
|
+
}), jsx(Stack, {
|
|
37275
|
+
children: jsxs(Table, {
|
|
37276
|
+
highlightOnHover: true,
|
|
37277
|
+
children: [jsx(Table.Thead, {
|
|
37278
|
+
children: jsxs(Table.Tr, {
|
|
37279
|
+
children: [jsx(Table.Th, {
|
|
37280
|
+
w: 50,
|
|
37281
|
+
children: "Id"
|
|
37282
|
+
}), jsx(Table.Th, {
|
|
37283
|
+
w: 150,
|
|
37284
|
+
children: "Identificatore"
|
|
37285
|
+
}), jsx(Table.Th, {
|
|
37286
|
+
w: 150,
|
|
37287
|
+
children: "Nome"
|
|
37288
|
+
}), jsx(Table.Th, {
|
|
37289
|
+
children: "Descrizione"
|
|
37290
|
+
}), aclMode === FluxoACLMode.Permission && jsx(Table.Th, {
|
|
37291
|
+
w: 100,
|
|
37292
|
+
children: "Permessi"
|
|
37293
|
+
}), jsx(Table.Th, {
|
|
37294
|
+
w: 100,
|
|
37295
|
+
children: "Aree"
|
|
37296
|
+
}), jsx(Table.Th, {
|
|
37297
|
+
w: 100
|
|
37233
37298
|
})]
|
|
37234
|
-
}
|
|
37235
|
-
})
|
|
37236
|
-
|
|
37299
|
+
})
|
|
37300
|
+
}), jsx(Table.Tbody, {
|
|
37301
|
+
children: domainRoles === null || domainRoles === void 0 ? void 0 : domainRoles.filter(a => a.external).map((element, i) => {
|
|
37302
|
+
var _a;
|
|
37303
|
+
return jsxs(Table.Tr, {
|
|
37304
|
+
children: [jsx(Table.Td, {
|
|
37305
|
+
w: 50,
|
|
37306
|
+
children: element.id
|
|
37307
|
+
}), jsx(Table.Td, {
|
|
37308
|
+
w: 150,
|
|
37309
|
+
children: element.identifier
|
|
37310
|
+
}), jsx(Table.Td, {
|
|
37311
|
+
w: 150,
|
|
37312
|
+
children: element.name
|
|
37313
|
+
}), jsx(Table.Td, {
|
|
37314
|
+
children: element.description
|
|
37315
|
+
}), aclMode === FluxoACLMode.Permission && jsx(Table.Td, {
|
|
37316
|
+
w: 100,
|
|
37317
|
+
children: element.permissionCount
|
|
37318
|
+
}), jsx(Table.Td, {
|
|
37319
|
+
w: 100,
|
|
37320
|
+
children: (_a = allDomainRolesFrontends === null || allDomainRolesFrontends === void 0 ? void 0 : allDomainRolesFrontends.find(a => a.domainRoleId === element.id)) === null || _a === void 0 ? void 0 : _a.frontends.map(f => {
|
|
37321
|
+
return jsx(Badge, {
|
|
37322
|
+
color: 'blue',
|
|
37323
|
+
children: f
|
|
37324
|
+
});
|
|
37325
|
+
})
|
|
37326
|
+
}), jsx(Table.Td, {
|
|
37327
|
+
w: 100,
|
|
37328
|
+
align: "right",
|
|
37329
|
+
children: jsxs(Menu$1, {
|
|
37330
|
+
shadow: "md",
|
|
37331
|
+
width: 200,
|
|
37332
|
+
children: [jsx(Menu$1.Target, {
|
|
37333
|
+
children: jsx(ActionIcon, {
|
|
37334
|
+
children: jsx(IconDotsVertical, {
|
|
37335
|
+
size: 18
|
|
37336
|
+
})
|
|
37337
|
+
})
|
|
37338
|
+
}), jsxs(Menu$1.Dropdown, {
|
|
37339
|
+
children: [jsx(Menu$1.Item, {
|
|
37340
|
+
leftSection: jsx(IconGridDots, {
|
|
37341
|
+
size: 14
|
|
37342
|
+
}),
|
|
37343
|
+
onClick: () => {
|
|
37344
|
+
setCreateUpdateExternal(true);
|
|
37345
|
+
setCurrentDomainRole(element);
|
|
37346
|
+
setUpdateDomainFrontendsModal(true);
|
|
37347
|
+
},
|
|
37348
|
+
children: "Aree funzionali"
|
|
37349
|
+
}), aclMode === FluxoACLMode.Permission && jsxs(Fragment, {
|
|
37350
|
+
children: [jsx(Menu$1.Item, {
|
|
37351
|
+
leftSection: jsx(IconLock, {
|
|
37352
|
+
size: 14
|
|
37353
|
+
}),
|
|
37354
|
+
onClick: () => {
|
|
37355
|
+
setCurrentDomainRole(element);
|
|
37356
|
+
setUpdateDomainRolePermissionsModal(true);
|
|
37357
|
+
},
|
|
37358
|
+
children: "Permessi"
|
|
37359
|
+
}), jsx(Menu$1.Item, {
|
|
37360
|
+
onClick: () => {
|
|
37361
|
+
setCurrentDomainRole(element);
|
|
37362
|
+
setDomainRoleModalOpen(true);
|
|
37363
|
+
},
|
|
37364
|
+
leftSection: jsx(IconEdit, {
|
|
37365
|
+
size: 14
|
|
37366
|
+
}),
|
|
37367
|
+
children: "Modifica"
|
|
37368
|
+
}), jsx(Menu$1.Divider, {}), jsx(Menu$1.Item, {
|
|
37369
|
+
color: 'red',
|
|
37370
|
+
onClick: () => deleteDomainRole(element.id),
|
|
37371
|
+
leftSection: jsx(IconTrash, {
|
|
37372
|
+
color: 'red',
|
|
37373
|
+
size: 14
|
|
37374
|
+
}),
|
|
37375
|
+
children: "Elimina"
|
|
37376
|
+
})]
|
|
37377
|
+
})]
|
|
37378
|
+
})]
|
|
37379
|
+
})
|
|
37380
|
+
})]
|
|
37381
|
+
}, i);
|
|
37382
|
+
})
|
|
37383
|
+
})]
|
|
37384
|
+
})
|
|
37237
37385
|
})]
|
|
37238
|
-
})
|
|
37386
|
+
})
|
|
37239
37387
|
}), jsx(Modal, {
|
|
37240
37388
|
centered: true,
|
|
37241
37389
|
opened: domainRoleModalOpen,
|
|
@@ -37243,14 +37391,15 @@ function DomainRoleGrid() {
|
|
|
37243
37391
|
setDomainRoleModalOpen(false);
|
|
37244
37392
|
setCurrentDomainRole(undefined);
|
|
37245
37393
|
},
|
|
37246
|
-
title: `${currentDomainRole ?
|
|
37394
|
+
title: `${currentDomainRole ? `Modifica ruolo ${createUpdateExternal ? 'esterno' : 'organizzazione'}` : `Crea ruolo ${createUpdateExternal ? 'esterno' : 'organizzazione'}`}`,
|
|
37247
37395
|
children: jsx(DomainRoleForm, {
|
|
37248
37396
|
onCreate: () => {
|
|
37249
37397
|
setDomainRoleModalOpen(false);
|
|
37250
37398
|
getAllDomainRoles();
|
|
37251
37399
|
setCurrentDomainRole(undefined);
|
|
37252
37400
|
},
|
|
37253
|
-
domainRole: currentDomainRole
|
|
37401
|
+
domainRole: currentDomainRole,
|
|
37402
|
+
external: createUpdateExternal
|
|
37254
37403
|
})
|
|
37255
37404
|
}), currentDomainRole && jsxs(Fragment, {
|
|
37256
37405
|
children: [jsx(Modal, {
|
|
@@ -37279,6 +37428,7 @@ function DomainRoleGrid() {
|
|
|
37279
37428
|
centered: true,
|
|
37280
37429
|
title: `Gestione aree funzionali ${currentDomainRole.name}`,
|
|
37281
37430
|
children: jsx(FrontendDomainRole, {
|
|
37431
|
+
external: createUpdateExternal,
|
|
37282
37432
|
domainRoleId: currentDomainRole.id,
|
|
37283
37433
|
onClosed: () => {
|
|
37284
37434
|
setUpdateDomainFrontendsModal(false);
|
|
@@ -37375,7 +37525,7 @@ function UserForm(props) {
|
|
|
37375
37525
|
const [domainRoles, setDomainRoles] = useState([]);
|
|
37376
37526
|
useEffect(() => {
|
|
37377
37527
|
FluxoClientSys.Instance.security.domainRole.find(999, 0).then(res => {
|
|
37378
|
-
setDomainRoles(res.results);
|
|
37528
|
+
setDomainRoles(res.results.filter(a => a.external === props.external));
|
|
37379
37529
|
});
|
|
37380
37530
|
}, []);
|
|
37381
37531
|
const generalForm = useForm({
|
|
@@ -37387,7 +37537,8 @@ function UserForm(props) {
|
|
|
37387
37537
|
userName: ''
|
|
37388
37538
|
},
|
|
37389
37539
|
assignToRoles: (_k = (_j = props.user) === null || _j === void 0 ? void 0 : _j.roles) !== null && _k !== void 0 ? _k : [],
|
|
37390
|
-
assignToDomainRoles: (_m = (_l = props.user) === null || _l === void 0 ? void 0 : _l.domainRoles.map(a => a.id.toString())) !== null && _m !== void 0 ? _m : []
|
|
37540
|
+
assignToDomainRoles: (_m = (_l = props.user) === null || _l === void 0 ? void 0 : _l.domainRoles.map(a => a.id.toString())) !== null && _m !== void 0 ? _m : [],
|
|
37541
|
+
external: props.external
|
|
37391
37542
|
},
|
|
37392
37543
|
clearInputErrorOnChange: true,
|
|
37393
37544
|
validateInputOnChange: true,
|
|
@@ -37403,8 +37554,9 @@ function UserForm(props) {
|
|
|
37403
37554
|
value.user.userName = value.user.email;
|
|
37404
37555
|
const newUser = {
|
|
37405
37556
|
user: value.user,
|
|
37406
|
-
assignToRoles: value.assignToRoles,
|
|
37407
|
-
assignToDomainRoles: value.assignToDomainRoles.map(a => parseInt(a))
|
|
37557
|
+
assignToRoles: props.external ? ['external'] : value.assignToRoles,
|
|
37558
|
+
assignToDomainRoles: value.assignToDomainRoles.map(a => parseInt(a)),
|
|
37559
|
+
external: value.external
|
|
37408
37560
|
};
|
|
37409
37561
|
(props.user ? FluxoClientSys.Instance.security.user.updateUser(props.user.id, newUser) : FluxoClientSys.Instance.security.user.createUser(newUser)).then(res => {
|
|
37410
37562
|
if (res.success) {
|
|
@@ -37448,7 +37600,7 @@ function UserForm(props) {
|
|
|
37448
37600
|
}, generalForm.getInputProps('user.lastName'))), jsx(TextInput, Object.assign({
|
|
37449
37601
|
label: 'Email',
|
|
37450
37602
|
disabled: !!props.user
|
|
37451
|
-
}, generalForm.getInputProps('user.email'))), jsx(MultiSelect, Object.assign({
|
|
37603
|
+
}, generalForm.getInputProps('user.email'))), !props.external && jsx(MultiSelect, Object.assign({
|
|
37452
37604
|
description: jsxs(Stack, {
|
|
37453
37605
|
gap: 0,
|
|
37454
37606
|
children: [jsx(Text, {
|
|
@@ -37505,19 +37657,32 @@ function UserForm(props) {
|
|
|
37505
37657
|
|
|
37506
37658
|
function UsersGrid() {
|
|
37507
37659
|
const [users, setUsers] = useState([]);
|
|
37660
|
+
const [externalUsers, setExternalUser] = useState([]);
|
|
37508
37661
|
const [currentUser, setCurrentUser] = useState();
|
|
37509
37662
|
const [newUserModalOpen, setNewUserModalOpen] = useState(false);
|
|
37663
|
+
const [createUpdateExternal, setCreateUpdateExternal] = useState(false);
|
|
37664
|
+
const {
|
|
37665
|
+
allowExternalUsers
|
|
37666
|
+
} = useAppSelector(state => state.layout.systemSettings);
|
|
37510
37667
|
useEffect(() => {
|
|
37511
37668
|
getAllUsers();
|
|
37669
|
+
getAllExternalUsers();
|
|
37512
37670
|
}, []);
|
|
37513
37671
|
const getAllUsers = () => {
|
|
37514
37672
|
FluxoClientSys.Instance.security.user.getAllUsers().then(res => {
|
|
37515
37673
|
setUsers(res);
|
|
37516
37674
|
});
|
|
37517
37675
|
};
|
|
37676
|
+
const getAllExternalUsers = () => {
|
|
37677
|
+
FluxoClientSys.Instance.security.user.getAllExternalUsers().then(res => {
|
|
37678
|
+
setExternalUser(res);
|
|
37679
|
+
});
|
|
37680
|
+
};
|
|
37518
37681
|
const deletion = id => {
|
|
37519
37682
|
FluxoClientSys.Instance.security.user.deleteUser(id).then(res => {
|
|
37520
37683
|
if (res.success) {
|
|
37684
|
+
getAllExternalUsers();
|
|
37685
|
+
getAllUsers();
|
|
37521
37686
|
showNotification({
|
|
37522
37687
|
title: 'Cancellazione completata',
|
|
37523
37688
|
message: `L'utente è stato cancellato con successo`,
|
|
@@ -37535,13 +37700,16 @@ function UsersGrid() {
|
|
|
37535
37700
|
};
|
|
37536
37701
|
return jsxs(Stack, {
|
|
37537
37702
|
children: [jsx(DataCard, {
|
|
37538
|
-
title: 'Utenti',
|
|
37703
|
+
title: 'Utenti (Organizzazione)',
|
|
37539
37704
|
actions: [{
|
|
37540
37705
|
icon: jsx(IconPlus, {
|
|
37541
37706
|
size: 18
|
|
37542
37707
|
}),
|
|
37543
37708
|
label: 'Nuovo utente',
|
|
37544
|
-
onClick: () =>
|
|
37709
|
+
onClick: () => {
|
|
37710
|
+
setCreateUpdateExternal(false);
|
|
37711
|
+
setNewUserModalOpen(true);
|
|
37712
|
+
}
|
|
37545
37713
|
}],
|
|
37546
37714
|
children: jsxs(Table, {
|
|
37547
37715
|
highlightOnHover: true,
|
|
@@ -37600,6 +37768,99 @@ function UsersGrid() {
|
|
|
37600
37768
|
}), jsxs(Menu$1.Dropdown, {
|
|
37601
37769
|
children: [jsx(Menu$1.Item, {
|
|
37602
37770
|
onClick: () => {
|
|
37771
|
+
setCreateUpdateExternal(false);
|
|
37772
|
+
setCurrentUser(element);
|
|
37773
|
+
setNewUserModalOpen(true);
|
|
37774
|
+
},
|
|
37775
|
+
leftSection: jsx(IconEdit, {
|
|
37776
|
+
size: 14
|
|
37777
|
+
}),
|
|
37778
|
+
children: "Modifica"
|
|
37779
|
+
}), jsx(Menu$1.Item, {
|
|
37780
|
+
color: 'red',
|
|
37781
|
+
onClick: () => deletion(element.id),
|
|
37782
|
+
leftSection: jsx(IconTrash, {
|
|
37783
|
+
color: 'red',
|
|
37784
|
+
size: 14
|
|
37785
|
+
}),
|
|
37786
|
+
children: "Elimina"
|
|
37787
|
+
})]
|
|
37788
|
+
})]
|
|
37789
|
+
})
|
|
37790
|
+
})]
|
|
37791
|
+
}, i))
|
|
37792
|
+
})]
|
|
37793
|
+
})
|
|
37794
|
+
}), allowExternalUsers && jsx(DataCard, {
|
|
37795
|
+
title: 'Utenti (Esterni)',
|
|
37796
|
+
actions: [{
|
|
37797
|
+
icon: jsx(IconPlus, {
|
|
37798
|
+
size: 18
|
|
37799
|
+
}),
|
|
37800
|
+
label: 'Nuovo utente esterno',
|
|
37801
|
+
onClick: () => {
|
|
37802
|
+
setCreateUpdateExternal(true);
|
|
37803
|
+
setNewUserModalOpen(true);
|
|
37804
|
+
}
|
|
37805
|
+
}],
|
|
37806
|
+
children: jsxs(Table, {
|
|
37807
|
+
highlightOnHover: true,
|
|
37808
|
+
children: [jsx(Table.Thead, {
|
|
37809
|
+
children: jsxs(Table.Tr, {
|
|
37810
|
+
children: [jsx(Table.Th, {
|
|
37811
|
+
children: "Nome"
|
|
37812
|
+
}), jsx(Table.Th, {
|
|
37813
|
+
children: "Cognome"
|
|
37814
|
+
}), jsx(Table.Th, {
|
|
37815
|
+
children: "Email"
|
|
37816
|
+
}), jsx(Table.Th, {
|
|
37817
|
+
children: "Tipo di accesso"
|
|
37818
|
+
}), jsx(Table.Th, {
|
|
37819
|
+
children: "Ruoli"
|
|
37820
|
+
}), jsx(Table.Th, {})]
|
|
37821
|
+
})
|
|
37822
|
+
}), jsx(Table.Tbody, {
|
|
37823
|
+
children: externalUsers.map((element, i) => jsxs(Table.Tr, {
|
|
37824
|
+
children: [jsx(Table.Td, {
|
|
37825
|
+
children: element.userData.FirstName
|
|
37826
|
+
}), jsx(Table.Td, {
|
|
37827
|
+
children: element.userData.LastName
|
|
37828
|
+
}), jsx(Table.Td, {
|
|
37829
|
+
children: element.email
|
|
37830
|
+
}), jsx(Table.Td, {
|
|
37831
|
+
children: jsx(Stack, {
|
|
37832
|
+
gap: 8,
|
|
37833
|
+
children: element.roles.map(d => {
|
|
37834
|
+
return jsx(Badge, {
|
|
37835
|
+
color: 'orange',
|
|
37836
|
+
children: d
|
|
37837
|
+
}, d);
|
|
37838
|
+
})
|
|
37839
|
+
})
|
|
37840
|
+
}), jsx(Table.Td, {
|
|
37841
|
+
children: jsx(Stack, {
|
|
37842
|
+
gap: 8,
|
|
37843
|
+
children: element.domainRoles.map(d => {
|
|
37844
|
+
return jsx(Badge, {
|
|
37845
|
+
children: d.name
|
|
37846
|
+
}, d.id);
|
|
37847
|
+
})
|
|
37848
|
+
})
|
|
37849
|
+
}), jsx(Table.Td, {
|
|
37850
|
+
align: "right",
|
|
37851
|
+
children: jsxs(Menu$1, {
|
|
37852
|
+
shadow: "md",
|
|
37853
|
+
width: 200,
|
|
37854
|
+
children: [jsx(Menu$1.Target, {
|
|
37855
|
+
children: jsx(ActionIcon, {
|
|
37856
|
+
children: jsx(IconDotsVertical, {
|
|
37857
|
+
size: 18
|
|
37858
|
+
})
|
|
37859
|
+
})
|
|
37860
|
+
}), jsxs(Menu$1.Dropdown, {
|
|
37861
|
+
children: [jsx(Menu$1.Item, {
|
|
37862
|
+
onClick: () => {
|
|
37863
|
+
setCreateUpdateExternal(true);
|
|
37603
37864
|
setCurrentUser(element);
|
|
37604
37865
|
setNewUserModalOpen(true);
|
|
37605
37866
|
},
|
|
@@ -37636,7 +37897,8 @@ function UsersGrid() {
|
|
|
37636
37897
|
getAllUsers();
|
|
37637
37898
|
setCurrentUser(undefined);
|
|
37638
37899
|
},
|
|
37639
|
-
user: currentUser
|
|
37900
|
+
user: currentUser,
|
|
37901
|
+
external: createUpdateExternal
|
|
37640
37902
|
})
|
|
37641
37903
|
})]
|
|
37642
37904
|
});
|
|
@@ -40231,6 +40493,10 @@ function Settings(props) {
|
|
|
40231
40493
|
hasDeveloperAccess,
|
|
40232
40494
|
hasDataAnalystAccess
|
|
40233
40495
|
} = useSelector(state => state.layout);
|
|
40496
|
+
const {
|
|
40497
|
+
allowExternalUsers,
|
|
40498
|
+
aclMode
|
|
40499
|
+
} = useAppSelector(state => state.layout.systemSettings);
|
|
40234
40500
|
useEffect(() => {
|
|
40235
40501
|
const hash = window.location.hash.slice(1);
|
|
40236
40502
|
if (hash) {
|
|
@@ -40243,7 +40509,7 @@ function Settings(props) {
|
|
|
40243
40509
|
});
|
|
40244
40510
|
}, []);
|
|
40245
40511
|
const getSideMenuGroups = () => {
|
|
40246
|
-
|
|
40512
|
+
const sidebarItems = [{
|
|
40247
40513
|
name: "Interfaccia",
|
|
40248
40514
|
hide: !hasAdminAccess,
|
|
40249
40515
|
items: [{
|
|
@@ -40426,10 +40692,8 @@ function Settings(props) {
|
|
|
40426
40692
|
hide: !hasAdminAccess && !hasDeveloperAccess,
|
|
40427
40693
|
items: [{
|
|
40428
40694
|
key: 'tokens',
|
|
40429
|
-
title:
|
|
40430
|
-
children:
|
|
40431
|
-
children: "(account)"
|
|
40432
|
-
})]
|
|
40695
|
+
title: jsx(Text, {
|
|
40696
|
+
children: "Personal Access token"
|
|
40433
40697
|
}),
|
|
40434
40698
|
onClick: () => {
|
|
40435
40699
|
window.location.hash = 'tokens';
|
|
@@ -40503,6 +40767,11 @@ function Settings(props) {
|
|
|
40503
40767
|
description: 'Accedi all\'ambiente di sviluppo'
|
|
40504
40768
|
}]
|
|
40505
40769
|
}];
|
|
40770
|
+
// I need to remove "permission" from the sidebarItems array if aclMode is DomainRole
|
|
40771
|
+
if (aclMode === FluxoACLMode.DomainRole) {
|
|
40772
|
+
sidebarItems[1].items = sidebarItems[1].items.filter(item => item.key !== 'permissions');
|
|
40773
|
+
}
|
|
40774
|
+
return sidebarItems;
|
|
40506
40775
|
};
|
|
40507
40776
|
const renderCurrentSection = tab => {
|
|
40508
40777
|
switch (tab) {
|
|
@@ -43964,13 +44233,15 @@ function FluxoShell(props) {
|
|
|
43964
44233
|
const flxFrontend = frontendByRender;
|
|
43965
44234
|
// Write the initial configuration to the state
|
|
43966
44235
|
FluxoStateDispatcher.dispatchSetConfiguration(res.ui);
|
|
44236
|
+
FluxoStateDispatcher.dispatchSetSystemSettings(res.systemSettings);
|
|
43967
44237
|
FluxoStateDispatcher.dispatchSetAppMenu(res.menu);
|
|
43968
44238
|
FluxoStateDispatcher.dispatchSetSysFeatures(res.features);
|
|
43969
44239
|
FluxoStateDispatcher.dispatchSetUserPermissions(res.permissions.map(a => a.fullIdentifier));
|
|
43970
44240
|
FluxoStateDispatcher.dispatchSetUserDomainRoles(res.domainRoles);
|
|
43971
44241
|
FluxoStateDispatcher.dispatchSetFrontends(props.frontends.map(a => ({
|
|
43972
44242
|
id: a.id,
|
|
43973
|
-
name: a.name
|
|
44243
|
+
name: a.name,
|
|
44244
|
+
external: a.external
|
|
43974
44245
|
})));
|
|
43975
44246
|
FluxoStateDispatcher.dispatchSetCurrentFrontend(res.currentFrontend);
|
|
43976
44247
|
FluxoStateDispatcher.dispatchAllowedFrontends(res.frontends);
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluxo-dev/shell",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^18.3.1",
|
|
6
6
|
"@mantine/core": "^7.12.2",
|
|
7
7
|
"react-router-dom": "^6.11.2",
|
|
8
8
|
"react-redux": "^8.0.5",
|
|
9
9
|
"@reduxjs/toolkit": "^1.9.1",
|
|
10
|
-
"@fluxo-dev/api-client-base": "^0.0.
|
|
11
|
-
"@fluxo-dev/shell-bi": "^0.0.
|
|
12
|
-
"@fluxo-dev/shell-hub": "^0.0.
|
|
13
|
-
"@fluxo-dev/shell-korebi": "^0.0.
|
|
14
|
-
"@fluxo-dev/shell-mfe": "^0.0.
|
|
15
|
-
"@fluxo-dev/shell-printing": "^0.0.
|
|
16
|
-
"@fluxo-dev/shell-reporting": "^0.0.
|
|
17
|
-
"@fluxo-dev/shell-workflow": "^0.0.
|
|
18
|
-
"@fluxo-dev/shell-ravify": "^0.0.
|
|
19
|
-
"@fluxo-dev/state": "^0.0.
|
|
20
|
-
"@fluxo-dev/ui-components": "^0.0.
|
|
10
|
+
"@fluxo-dev/api-client-base": "^0.0.53",
|
|
11
|
+
"@fluxo-dev/shell-bi": "^0.0.53",
|
|
12
|
+
"@fluxo-dev/shell-hub": "^0.0.53",
|
|
13
|
+
"@fluxo-dev/shell-korebi": "^0.0.53",
|
|
14
|
+
"@fluxo-dev/shell-mfe": "^0.0.53",
|
|
15
|
+
"@fluxo-dev/shell-printing": "^0.0.53",
|
|
16
|
+
"@fluxo-dev/shell-reporting": "^0.0.53",
|
|
17
|
+
"@fluxo-dev/shell-workflow": "^0.0.53",
|
|
18
|
+
"@fluxo-dev/shell-ravify": "^0.0.53",
|
|
19
|
+
"@fluxo-dev/state": "^0.0.53",
|
|
20
|
+
"@fluxo-dev/ui-components": "^0.0.53",
|
|
21
21
|
"@scalar/api-reference-react": "^0.3.142",
|
|
22
22
|
"@devexpress/analytics-core": "23.1.3",
|
|
23
23
|
"devexpress-dashboard": "23.1.3",
|
package/src/lib/app.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { EmbeddedModule, InitialConfiguration } from "@fluxo-dev/api-client-base";
|
|
3
3
|
import './app.module.css';
|
|
4
4
|
import 'dayjs/locale/it';
|
|
5
|
+
/**
|
|
6
|
+
* The ShellFrontend interface represents a frontend that can be rendered by the FluxoShell component.
|
|
7
|
+
*/
|
|
5
8
|
export type ShellFrontend = {
|
|
6
9
|
id: string | 'admin';
|
|
7
10
|
name: string;
|
|
@@ -10,6 +13,10 @@ export type ShellFrontend = {
|
|
|
10
13
|
modules: EmbeddedModule[];
|
|
11
14
|
renderWhen?: (configuration: InitialConfiguration) => boolean;
|
|
12
15
|
icon?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* If true, the frontend will be rendered only if the user is an external user.
|
|
18
|
+
*/
|
|
19
|
+
external: boolean;
|
|
13
20
|
};
|
|
14
21
|
export declare enum ShellUINavigation {
|
|
15
22
|
Sidebar = 1,
|
|
@@ -2,5 +2,6 @@ import { DomainRole } from "@fluxo-dev/api-client-base";
|
|
|
2
2
|
export interface DomainRoleFormProps {
|
|
3
3
|
domainRole: DomainRole | undefined;
|
|
4
4
|
onCreate: () => void;
|
|
5
|
+
external: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare function DomainRoleForm(props: DomainRoleFormProps): import("react/jsx-runtime").JSX.Element;
|