@fluxo-dev/shell 0.0.47 → 0.0.49

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 CHANGED
@@ -10393,10 +10393,13 @@ function FooterBar(props) {
10393
10393
  userInfo
10394
10394
  } = useAppSelector(state => state.user);
10395
10395
  const {
10396
- userIdle
10396
+ userIdle,
10397
+ currentFrontend
10397
10398
  } = useAppSelector(state => state.layout);
10398
10399
  const {
10399
- hasAdminAccess
10400
+ hasAdminAccess,
10401
+ hasDeveloperAccess,
10402
+ hasDataAnalystAccess
10400
10403
  } = useAppSelector(state => state.layout);
10401
10404
  const idle = useIdle(5000000000);
10402
10405
  useEffect(() => {
@@ -10463,7 +10466,7 @@ function FooterBar(props) {
10463
10466
  }), jsx(Space, {
10464
10467
  h: 'md'
10465
10468
  }), jsxs(Group, {
10466
- children: [hasAdminAccess && jsxs(Fragment, {
10469
+ children: [(hasAdminAccess || hasDeveloperAccess || hasDataAnalystAccess) && currentFrontend === 'admin' && jsxs(Fragment, {
10467
10470
  children: [jsx(MinimalStateViewer, {}), jsx(Divider, {
10468
10471
  orientation: 'vertical'
10469
10472
  }), jsx(Link, {
@@ -29113,6 +29116,18 @@ function MenuItemEdit(props) {
29113
29116
  setRouterLinkError(isExternalLink ? 'Link non valido' : 'Link non valido, es: registries/product/create');
29114
29117
  }
29115
29118
  };
29119
+ const renderIconSelectOption = item => {
29120
+ return jsxs(Group, {
29121
+ flex: "1",
29122
+ gap: "xs",
29123
+ children: [IconFactory.getIcon(item.option.value), item.option.label, item.checked && jsx(IconCheck, {
29124
+ style: {
29125
+ marginInlineStart: 'auto'
29126
+ },
29127
+ size: 18
29128
+ })]
29129
+ });
29130
+ };
29116
29131
  return jsxs(Stack, {
29117
29132
  children: [jsx(TextInput, {
29118
29133
  label: 'Etichetta',
@@ -29125,6 +29140,7 @@ function MenuItemEdit(props) {
29125
29140
  onLabel: 'SI',
29126
29141
  onChange: e => setHasIndex(e.currentTarget.checked)
29127
29142
  }), jsx(Select, {
29143
+ limit: 256,
29128
29144
  leftSection: IconFactory.getIcon(icon !== null && icon !== void 0 ? icon : ''),
29129
29145
  data: IconFactory.getIconIdentifiers().map(e => {
29130
29146
  return {
@@ -29135,7 +29151,8 @@ function MenuItemEdit(props) {
29135
29151
  searchable: true,
29136
29152
  label: 'Icona',
29137
29153
  value: icon,
29138
- onChange: v => setIcon(v)
29154
+ onChange: v => setIcon(v),
29155
+ renderOption: renderIconSelectOption
29139
29156
  }), !props.menuItem.isGroup && jsx(TextInput, {
29140
29157
  label: 'Route',
29141
29158
  disabled: true,
@@ -37345,6 +37362,12 @@ function UserForm(props) {
37345
37362
  const roles = [{
37346
37363
  value: 'administrator',
37347
37364
  label: 'Amministratore'
37365
+ }, {
37366
+ value: 'developer',
37367
+ label: 'Sviluppatore'
37368
+ }, {
37369
+ value: 'data-analyst',
37370
+ label: 'Analista dati'
37348
37371
  }, {
37349
37372
  value: 'user',
37350
37373
  label: 'Utente'
@@ -37426,6 +37449,35 @@ function UserForm(props) {
37426
37449
  label: 'Email',
37427
37450
  disabled: !!props.user
37428
37451
  }, generalForm.getInputProps('user.email'))), jsx(MultiSelect, Object.assign({
37452
+ description: jsxs(Stack, {
37453
+ gap: 0,
37454
+ children: [jsx(Text, {
37455
+ size: 'xs',
37456
+ mb: 8,
37457
+ children: "Permessi console di amministrazione"
37458
+ }), jsxs(Text, {
37459
+ size: 'xs',
37460
+ children: [jsx("b", {
37461
+ children: "Amministratore:"
37462
+ }), " accede a tutte le funzioni"]
37463
+ }), jsxs(Text, {
37464
+ size: 'xs',
37465
+ children: [jsx("b", {
37466
+ children: "Sviluppatore:"
37467
+ }), " ravify, bi, comunicazioni, sviluppo"]
37468
+ }), jsxs(Text, {
37469
+ size: 'xs',
37470
+ children: [jsx("b", {
37471
+ children: "Analista dati:"
37472
+ }), " bi, ravify"]
37473
+ }), jsxs(Text, {
37474
+ size: 'xs',
37475
+ mb: 16,
37476
+ children: [jsx("b", {
37477
+ children: "Utente:"
37478
+ }), " nessun accesso alla console di amministrazione"]
37479
+ })]
37480
+ }),
37429
37481
  data: roles,
37430
37482
  label: "Tipo di accesso",
37431
37483
  placeholder: "Seleziona uno o pi\u00F9 tipi di accesso"
@@ -40174,6 +40226,11 @@ function Settings(props) {
40174
40226
  const [currentTab, setCurrentTab] = useState('ui');
40175
40227
  const [apiRestDoc, setApiRestDoc] = useState();
40176
40228
  const navigate = useNavigate();
40229
+ const {
40230
+ hasAdminAccess,
40231
+ hasDeveloperAccess,
40232
+ hasDataAnalystAccess
40233
+ } = useSelector(state => state.layout);
40177
40234
  useEffect(() => {
40178
40235
  const hash = window.location.hash.slice(1);
40179
40236
  if (hash) {
@@ -40188,6 +40245,7 @@ function Settings(props) {
40188
40245
  const getSideMenuGroups = () => {
40189
40246
  return [{
40190
40247
  name: "Interfaccia",
40248
+ hide: !hasAdminAccess,
40191
40249
  items: [{
40192
40250
  key: 'ui',
40193
40251
  title: jsx(Text, {
@@ -40219,6 +40277,7 @@ function Settings(props) {
40219
40277
  }]
40220
40278
  }, {
40221
40279
  name: 'Sicurezza',
40280
+ hide: !hasAdminAccess,
40222
40281
  items: [{
40223
40282
  key: 'users',
40224
40283
  title: jsx(Text, {
@@ -40264,6 +40323,7 @@ function Settings(props) {
40264
40323
  }]
40265
40324
  }, {
40266
40325
  name: 'Comunicazioni',
40326
+ hide: !hasAdminAccess && !hasDeveloperAccess,
40267
40327
  items: [{
40268
40328
  key: 'email-configuration',
40269
40329
  title: jsx(Text, {
@@ -40281,6 +40341,7 @@ function Settings(props) {
40281
40341
  }]
40282
40342
  }, {
40283
40343
  name: 'Integrazione',
40344
+ hide: !hasAdminAccess && !hasDeveloperAccess && !hasDataAnalystAccess,
40284
40345
  items: [{
40285
40346
  key: 'ravify',
40286
40347
  title: jsx(Text, {
@@ -40298,6 +40359,7 @@ function Settings(props) {
40298
40359
  }]
40299
40360
  }, {
40300
40361
  name: 'Business Intelligence',
40362
+ hide: !hasAdminAccess && !hasDeveloperAccess && !hasDataAnalystAccess,
40301
40363
  items: [{
40302
40364
  key: 'bi',
40303
40365
  title: jsx(Text, {
@@ -40343,6 +40405,7 @@ function Settings(props) {
40343
40405
  }]
40344
40406
  }, {
40345
40407
  name: 'Stampe',
40408
+ hide: !hasAdminAccess,
40346
40409
  items: [{
40347
40410
  key: 'print-server',
40348
40411
  title: jsx(Text, {
@@ -40360,6 +40423,7 @@ function Settings(props) {
40360
40423
  }]
40361
40424
  }, {
40362
40425
  name: 'Sviluppatori',
40426
+ hide: !hasAdminAccess && !hasDeveloperAccess,
40363
40427
  items: [{
40364
40428
  key: 'tokens',
40365
40429
  title: jsxs(Text, {
@@ -40443,25 +40507,25 @@ function Settings(props) {
40443
40507
  const renderCurrentSection = tab => {
40444
40508
  switch (tab) {
40445
40509
  case 'ui':
40446
- return jsx(Ui, {});
40510
+ return hasAdminAccess ? jsx(Ui, {}) : jsx(ErrorPage$1, {});
40447
40511
  case 'menu':
40448
- return jsx(MenuDesigner, {
40512
+ return hasAdminAccess ? jsx(MenuDesigner, {
40449
40513
  frontends: props.frontends
40450
- });
40514
+ }) : jsx(ErrorPage$1, {});
40451
40515
  case 'tokens':
40452
- return jsx(Tokens, {});
40516
+ return hasAdminAccess || hasDeveloperAccess ? jsx(Tokens, {}) : jsx(ErrorPage$1, {});
40453
40517
  case 'users':
40454
- return jsx(UsersGrid, {});
40518
+ return hasAdminAccess ? jsx(UsersGrid, {}) : jsx(ErrorPage$1, {});
40455
40519
  case 'roles':
40456
- return jsx(DomainRoleGrid, {});
40520
+ return hasAdminAccess ? jsx(DomainRoleGrid, {}) : jsx(ErrorPage$1, {});
40457
40521
  case 'permissions':
40458
- return jsx(PermissionGrid, {});
40522
+ return hasAdminAccess ? jsx(PermissionGrid, {}) : jsx(ErrorPage$1, {});
40459
40523
  case 'print-server':
40460
- return jsx(PrintServerList, {});
40524
+ return hasAdminAccess ? jsx(PrintServerList, {}) : jsx(ErrorPage$1, {});
40461
40525
  case 'email-configuration':
40462
- return jsx(EmailServerConfiguration, {});
40526
+ return hasAdminAccess || hasDeveloperAccess ? jsx(EmailServerConfiguration, {}) : jsx(ErrorPage$1, {});
40463
40527
  case 'apidoc':
40464
- return jsx(ScrollArea, {
40528
+ return hasAdminAccess || hasDeveloperAccess ? jsx(ScrollArea, {
40465
40529
  style: {
40466
40530
  height: 'calc(100vh - 132px)'
40467
40531
  },
@@ -40487,7 +40551,7 @@ function Settings(props) {
40487
40551
  }
40488
40552
  }
40489
40553
  })
40490
- });
40554
+ }) : jsx(ErrorPage$1, {});
40491
40555
  /*return apiRestDoc ? (
40492
40556
  <DataCard title={'Documentazione API REST'}>
40493
40557
  <RestApiDocumentation documentation={apiRestDoc} />
@@ -40496,20 +40560,20 @@ function Settings(props) {
40496
40560
  <WaitData />
40497
40561
  );*/
40498
40562
  case 'plugin':
40499
- return jsx(AppsList, {
40563
+ return hasAdminAccess || hasDeveloperAccess ? jsx(AppsList, {
40500
40564
  pluginEndpoint: props.pluginEndpoint,
40501
40565
  modules: props.frontends.map(f => f.modules).flat()
40502
- });
40566
+ }) : jsx(ErrorPage$1, {});
40503
40567
  case 'ravify':
40504
- return jsx(RavifyInstances, {});
40568
+ return hasAdminAccess || hasDeveloperAccess || hasDataAnalystAccess ? jsx(RavifyInstances, {}) : jsx(ErrorPage$1, {});
40505
40569
  case 'bi':
40506
- return jsx(DashboardEditor, {
40570
+ return hasAdminAccess || hasDeveloperAccess || hasDataAnalystAccess ? jsx(DashboardEditor, {
40507
40571
  mode: 'editor'
40508
- });
40572
+ }) : jsx(ErrorPage$1, {});
40509
40573
  case 'bi-dc':
40510
- return jsx(DataConnections, {});
40574
+ return hasAdminAccess || hasDeveloperAccess || hasDataAnalystAccess ? jsx(DataConnections, {}) : jsx(ErrorPage$1, {});
40511
40575
  case 'bi-dashboard-category':
40512
- return jsx(DashboardCategoryPage, {});
40576
+ return hasAdminAccess || hasDeveloperAccess || hasDataAnalystAccess ? jsx(DashboardCategoryPage, {}) : jsx(ErrorPage$1, {});
40513
40577
  default:
40514
40578
  return jsx(ErrorPage$1, {});
40515
40579
  }
@@ -40529,13 +40593,18 @@ function Settings(props) {
40529
40593
  }
40530
40594
 
40531
40595
  function MainRoutes(props) {
40596
+ const {
40597
+ hasAdminAccess,
40598
+ hasDeveloperAccess,
40599
+ hasDataAnalystAccess
40600
+ } = useSelector(state => state.layout);
40532
40601
  const KIde = /*#__PURE__*/lazy(() => import('@fluxo-dev/shell-korebi').then(({
40533
40602
  KorebiIde
40534
40603
  }) => ({
40535
40604
  default: KorebiIde
40536
40605
  })));
40537
40606
  return jsxs(FlxRoutes, {
40538
- children: [props.isAdminFrontend && props.hasAdminAccess && jsxs(Fragment, {
40607
+ children: [props.isAdminFrontend && (hasDeveloperAccess || hasDataAnalystAccess || hasAdminAccess) && jsxs(Fragment, {
40539
40608
  children: [jsx(Route, {
40540
40609
  path: 'settings',
40541
40610
  element: jsx(Settings, {
@@ -40903,13 +40972,13 @@ var classes = {"box":"frontend-switcher-module_box__uas-n"};
40903
40972
  function FrontendSwitcher(props) {
40904
40973
  const {
40905
40974
  frontends,
40906
- currentFrontend,
40907
40975
  allowedFrontends
40908
40976
  } = useAppSelector(a => a.layout);
40909
40977
  const [loading, setLoading] = React__default.useState(false);
40910
40978
  const navigateTo = useNavigate();
40911
40979
  return jsx(Center, {
40912
40980
  h: '100vh',
40981
+ bg: 'rgb(250, 251, 255)',
40913
40982
  children: loading ? jsx(Center, {
40914
40983
  w: '100vw',
40915
40984
  h: '100vh',
@@ -40924,7 +40993,7 @@ function FrontendSwitcher(props) {
40924
40993
  style: {
40925
40994
  textAlign: 'center'
40926
40995
  },
40927
- children: "Scegli l'applicazione"
40996
+ children: "Aree funzionali"
40928
40997
  }), jsx(Group, {
40929
40998
  wrap: 'wrap',
40930
40999
  children: allowedFrontends.map(f => {
@@ -40955,7 +41024,9 @@ function FrontendSwitcher(props) {
40955
41024
  children: jsxs(Stack, {
40956
41025
  justify: 'center',
40957
41026
  align: 'center',
40958
- children: [jsx(IconApps, {
41027
+ children: [props.availableFrontends.filter(a => a.id === f)[0].icon ? jsx(Fragment, {
41028
+ children: props.availableFrontends.filter(a => a.id === f)[0].icon
41029
+ }) : jsx(IconApps, {
40959
41030
  size: 48
40960
41031
  }), jsx(Text, {
40961
41032
  size: 'lg',
@@ -43903,12 +43974,18 @@ function FluxoShell(props) {
43903
43974
  })));
43904
43975
  FluxoStateDispatcher.dispatchSetCurrentFrontend(res.currentFrontend);
43905
43976
  FluxoStateDispatcher.dispatchAllowedFrontends(res.frontends);
43906
- FluxoStateDispatcher.dispatchHasAdminAccess(res.hasAdminAccess);
43977
+ FluxoStateDispatcher.dispatchSysRoleAccess(res.hasAdminAccess, res.hasDeveloperAccess, res.hasDataAnalystAccess);
43907
43978
  if (props.withMultipleSessions) FluxoStateDispatcher.dispatchSetSessionMode('multi-session');else FluxoStateDispatcher.dispatchSetSessionMode('single-session');
43908
43979
  const rObjs = [generateAuthRoutes(), {
43909
43980
  path: 'frontend-switcher',
43910
43981
  element: jsx(ProtectedRoute, {
43911
- children: jsx(FrontendSwitcher, {})
43982
+ children: jsx(FrontendSwitcher, {
43983
+ availableFrontends: props.frontends.map(a => ({
43984
+ id: a.id,
43985
+ name: a.name,
43986
+ icon: a.icon
43987
+ }))
43988
+ })
43912
43989
  })
43913
43990
  }, /* Public routes */
43914
43991
  {
@@ -43926,7 +44003,6 @@ function FluxoShell(props) {
43926
44003
  }, {
43927
44004
  path: '/*',
43928
44005
  element: jsx(MainRoutes, {
43929
- hasAdminAccess: res.hasAdminAccess,
43930
44006
  isAdminFrontend: flxFrontend.id === 'admin',
43931
44007
  pluginEndpoint: props.pluginEndpoint,
43932
44008
  frontends: props.frontends
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@fluxo-dev/shell",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
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.47",
11
- "@fluxo-dev/shell-bi": "^0.0.47",
12
- "@fluxo-dev/shell-hub": "^0.0.47",
13
- "@fluxo-dev/shell-korebi": "^0.0.47",
14
- "@fluxo-dev/shell-mfe": "^0.0.47",
15
- "@fluxo-dev/shell-printing": "^0.0.47",
16
- "@fluxo-dev/shell-reporting": "^0.0.47",
17
- "@fluxo-dev/shell-workflow": "^0.0.47",
18
- "@fluxo-dev/shell-ravify": "^0.0.47",
19
- "@fluxo-dev/state": "^0.0.47",
20
- "@fluxo-dev/ui-components": "^0.0.47",
10
+ "@fluxo-dev/api-client-base": "^0.0.49",
11
+ "@fluxo-dev/shell-bi": "^0.0.49",
12
+ "@fluxo-dev/shell-hub": "^0.0.49",
13
+ "@fluxo-dev/shell-korebi": "^0.0.49",
14
+ "@fluxo-dev/shell-mfe": "^0.0.49",
15
+ "@fluxo-dev/shell-printing": "^0.0.49",
16
+ "@fluxo-dev/shell-reporting": "^0.0.49",
17
+ "@fluxo-dev/shell-workflow": "^0.0.49",
18
+ "@fluxo-dev/shell-ravify": "^0.0.49",
19
+ "@fluxo-dev/state": "^0.0.49",
20
+ "@fluxo-dev/ui-components": "^0.0.49",
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
@@ -9,6 +9,7 @@ export type ShellFrontend = {
9
9
  dashboardComponent: React.ReactNode | React.ReactElement;
10
10
  modules: EmbeddedModule[];
11
11
  renderWhen?: (configuration: InitialConfiguration) => boolean;
12
+ icon?: React.ReactNode;
12
13
  };
13
14
  export declare enum ShellUINavigation {
14
15
  Sidebar = 1,
@@ -3,6 +3,5 @@ export interface MainRoutesProps {
3
3
  pluginEndpoint: string;
4
4
  frontends: ShellFrontend[];
5
5
  isAdminFrontend: boolean;
6
- hasAdminAccess: boolean;
7
6
  }
8
7
  export declare function MainRoutes(props: MainRoutesProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,9 @@
1
+ import React from "react";
1
2
  export interface FrontendSwitcherProps {
3
+ availableFrontends: {
4
+ id: string;
5
+ name: string;
6
+ icon?: React.ReactNode;
7
+ }[];
2
8
  }
3
9
  export declare function FrontendSwitcher(props: FrontendSwitcherProps): import("react/jsx-runtime").JSX.Element;