@fluxo-dev/shell 0.0.27 → 0.0.29

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
@@ -5,7 +5,7 @@ import { useSelector, Provider } from 'react-redux';
5
5
  import { useLocation, Navigate, Outlet, useNavigate, Link, useOutlet, Route, useSearchParams, createBrowserRouter, RouterProvider } from 'react-router-dom';
6
6
  import { DataCard, useFlxNavigate, NoData, ConfirmModal, ShellPage, ErrorPage as ErrorPage$1, WaitData, FlxRoutes } from '@fluxo-dev/ui-components';
7
7
  import { ModuleLoader } from '@fluxo-dev/shell-mfe';
8
- import { Text, TextInput, ActionIcon, useMantineTheme, AppShell, Stack, Group, Burger, Badge, Drawer, NavLink, Popover, Avatar, Center, Divider, Button, Tabs, Anchor, Tooltip, Space, useMantineColorScheme, UnstyledButton, Box, ThemeIcon, Collapse, ScrollArea, rem, Loader, Grid, PasswordInput, ColorSwatch, FileButton, NumberInput, Alert, ColorInput, Checkbox, Modal, Switch, Select, Chip, LoadingOverlay, Image as Image$1, Menu, Textarea, Table, MultiSelect, Card, MantineProvider } from '@mantine/core';
8
+ import { Text, TextInput, ActionIcon, useMantineTheme, AppShell, Stack, Group, Burger, Badge, Drawer, NavLink, Popover, Avatar, Center, Divider, Button, Tabs, Anchor, Tooltip, Space, useMantineColorScheme, UnstyledButton, Box, ThemeIcon, Collapse, ScrollArea, rem, Loader, Grid, PasswordInput, ColorSwatch, FileButton, NumberInput, Alert, ColorInput, Checkbox, Modal, Switch, Select, Chip, LoadingOverlay, Image as Image$1, Menu, Table, MultiSelect, Card, MantineProvider } from '@mantine/core';
9
9
  import { openSpotlight, Spotlight } from '@mantine/spotlight';
10
10
  import { useOs, useHotkeys, useIdle } from '@mantine/hooks';
11
11
  import { AppType, AppState, FluxoStateDispatcher, FluxoClientSys, UserService, AppMenuContextType, ApiKeyService, DomainRoleService, EmailServerProviderType } from '@fluxo-dev/api-client-base';
@@ -4344,7 +4344,8 @@ class AppJitManager {
4344
4344
  }
4345
4345
  }
4346
4346
 
4347
- function FrontendSwitch() {
4347
+ function FrontendSwitch(props) {
4348
+ var _a;
4348
4349
  const {
4349
4350
  allowedFrontends
4350
4351
  } = useAppSelector(a => a.layout);
@@ -4353,7 +4354,7 @@ function FrontendSwitch() {
4353
4354
  children: allowedFrontends.length > 1 && jsx(ActionIcon, {
4354
4355
  children: jsx(IconGridDots, {
4355
4356
  size: 24,
4356
- color: '#fff',
4357
+ color: (_a = props.iconColor) !== null && _a !== void 0 ? _a : '#fff',
4357
4358
  onClick: () => navigate('frontend-switcher')
4358
4359
  })
4359
4360
  })
@@ -21188,8 +21189,14 @@ function MenuCreateForm(props) {
21188
21189
  }, [context, role, user, name]);
21189
21190
  const onSubmit = () => {
21190
21191
  if (saveButtonIsDisabled()) return;
21192
+ let ctx = AppMenuContextType.Default;
21193
+ if (context === '1') {
21194
+ ctx = AppMenuContextType.DomainRole;
21195
+ } else if (context === '2') {
21196
+ ctx = AppMenuContextType.User;
21197
+ }
21191
21198
  FluxoClientSys.Instance.configuration.createAppMenu({
21192
- contextType: context === '1' ? AppMenuContextType.DomainRole : AppMenuContextType.User,
21199
+ contextType: ctx,
21193
21200
  name: name,
21194
21201
  domainRoleId: context === '1' ? +role : 0,
21195
21202
  copyItemsFromWebMenuId: 0,
@@ -21206,7 +21213,7 @@ function MenuCreateForm(props) {
21206
21213
  }).catch(err => {
21207
21214
  showNotification({
21208
21215
  title: 'Errore',
21209
- message: 'Si è verificato un errore durante la creazione del menu',
21216
+ message: `Si è verificato un errore durante la creazione del menu: ${err.message}`,
21210
21217
  color: 'red',
21211
21218
  autoClose: 5000
21212
21219
  });
@@ -21489,6 +21496,9 @@ function MenuDesigner(props) {
21489
21496
  });
21490
21497
  };
21491
21498
  const isModuleAttachedToFrontend = (module, frontend) => {
21499
+ // workaround momentaneo. Bisogna capire come eventualmente
21500
+ // abbinare le app dinamiche ai frontend. Per ora, tutte quelle che non sono fluxo, vengono abbinate
21501
+ if (module.key !== 'fluxo') return true;
21492
21502
  const shellFrontend = props.frontends.find(a => a.id === (currentWebMenu === null || currentWebMenu === void 0 ? void 0 : currentWebMenu.frontend));
21493
21503
  if ((shellFrontend === null || shellFrontend === void 0 ? void 0 : shellFrontend.modules.filter(a => a.scope === module.key).length) === 0) return false;
21494
21504
  return true;
@@ -28124,6 +28134,31 @@ function EmbeddedModuleItem(props) {
28124
28134
  });
28125
28135
  }
28126
28136
 
28137
+ function EmbeddedBackendModuleItem(props) {
28138
+ React__default.useState(false);
28139
+ return jsx(Group, {
28140
+ justify: 'space-between',
28141
+ style: {
28142
+ border: '1px solid #dedede',
28143
+ padding: 15
28144
+ },
28145
+ children: jsx(Group, {
28146
+ children: jsxs(Stack, {
28147
+ gap: 0,
28148
+ children: [jsxs("span", {
28149
+ children: [props.app.description, " ", jsxs("small", {
28150
+ children: ["(", props.app.version, ")"]
28151
+ })]
28152
+ }), jsxs("small", {
28153
+ children: [props.app.name, " - ", jsx("b", {
28154
+ children: props.app.author
28155
+ })]
28156
+ })]
28157
+ })
28158
+ })
28159
+ });
28160
+ }
28161
+
28127
28162
  function AppsList(props) {
28128
28163
  const [apps, setApps] = useState([]);
28129
28164
  const [showInstallComponent, setShowInstallComponent] = useState(false);
@@ -28202,7 +28237,7 @@ function AppsList(props) {
28202
28237
  }, app.id))]
28203
28238
  })]
28204
28239
  }), jsx(DataCard, {
28205
- title: 'Apps di sistema',
28240
+ title: 'Apps di sistema (frontend)',
28206
28241
  children: jsxs(Stack, {
28207
28242
  gap: 16,
28208
28243
  children: [embeddedModules.length === 0 && jsx(NoData, {
@@ -28215,6 +28250,18 @@ function AppsList(props) {
28215
28250
  }, i))
28216
28251
  }) : jsx(Loader, {})]
28217
28252
  })
28253
+ }), jsx(DataCard, {
28254
+ title: 'Apps di sistema (server)',
28255
+ children: jsxs(Stack, {
28256
+ gap: 16,
28257
+ children: [apps.length === 0 && jsx(NoData, {
28258
+ message: 'Nessun modulo di sistema trovato'
28259
+ }), !loading ? jsx(Fragment, {
28260
+ children: apps.filter(a => a.type === AppType.Backend).map((app, i) => jsx(EmbeddedBackendModuleItem, {
28261
+ app: app
28262
+ }, i))
28263
+ }) : jsx(Loader, {})]
28264
+ })
28218
28265
  }), jsxs(DataCard, {
28219
28266
  title: 'Apps JIT (Sviluppo)',
28220
28267
  actions: [{
@@ -28271,52 +28318,6 @@ function AppsList(props) {
28271
28318
  });
28272
28319
  }
28273
28320
 
28274
- function UpdatePermission(props) {
28275
- const [permissionsJson, setPermissionsJson] = React__default.useState('');
28276
- const updatePermissions = () => {
28277
- try {
28278
- const data = JSON.parse(permissionsJson);
28279
- FluxoClientSys.Instance.security.permission.installPermissions(data).then(() => {
28280
- showNotification({
28281
- title: 'Operazione completata',
28282
- color: 'green',
28283
- message: `I permessi sono stati aggiornati con successo`
28284
- });
28285
- props.onUpdated();
28286
- }, err => {
28287
- showNotification({
28288
- title: 'Operazione fallita',
28289
- color: 'red',
28290
- message: `Non è stato possibile aggiornare i permessi: ${err.message}`
28291
- });
28292
- });
28293
- } catch (err) {
28294
- showNotification({
28295
- title: 'Operazione fallita',
28296
- color: 'red',
28297
- message: `Il file non è valido.`
28298
- });
28299
- }
28300
- };
28301
- return jsxs(Stack, {
28302
- children: [jsx(Textarea, {
28303
- minRows: 20,
28304
- value: permissionsJson,
28305
- onChange: v => setPermissionsJson(v.target.value)
28306
- }), jsxs(Group, {
28307
- justify: 'right',
28308
- children: [jsx(Button, {
28309
- onClick: props.onCanceled,
28310
- children: "Annulla"
28311
- }), jsx(Button, {
28312
- onClick: updatePermissions,
28313
- disabled: !permissionsJson,
28314
- children: "Aggiorna"
28315
- })]
28316
- })]
28317
- });
28318
- }
28319
-
28320
28321
  function CreateScopeForm(props) {
28321
28322
  const [permissionScopes] = useState(props.permissionScopes);
28322
28323
  const [createdScopes, setCreatedScopes] = useState([]);
@@ -28477,7 +28478,6 @@ function CreateCustomPermissionForm(props) {
28477
28478
 
28478
28479
  function PermissionGrid() {
28479
28480
  const [permissions, setPermissions] = useState([]);
28480
- const [updatePermissionModal, setUpdatePermissionModal] = useState(false);
28481
28481
  const [permissionScopes, setPermissionScopes] = useState([]);
28482
28482
  const [permissionScopesLoaded, setPermissionScopesLoaded] = useState(false);
28483
28483
  const [currentScope, setCurrentScope] = useState(null);
@@ -28562,14 +28562,6 @@ function PermissionGrid() {
28562
28562
  return jsx(DataCard, {
28563
28563
  title: 'Permessi',
28564
28564
  actions: [{
28565
- icon: jsx(IconArrowDown, {
28566
- size: 18
28567
- }),
28568
- label: 'Installa permessi',
28569
- onClick: () => {
28570
- setUpdatePermissionModal(true);
28571
- }
28572
- }, {
28573
28565
  icon: jsx(IconPlus, {
28574
28566
  size: 18
28575
28567
  }),
@@ -28745,19 +28737,6 @@ function PermissionGrid() {
28745
28737
  })
28746
28738
  })]
28747
28739
  })]
28748
- }), jsx(Modal, {
28749
- centered: true,
28750
- opened: updatePermissionModal,
28751
- onClose: () => {
28752
- setUpdatePermissionModal(false);
28753
- },
28754
- title: "Aggiorna permessi",
28755
- children: jsx(UpdatePermission, {
28756
- onUpdated: () => {
28757
- setUpdatePermissionModal(false);
28758
- },
28759
- onCanceled: () => setUpdatePermissionModal(false)
28760
- })
28761
28740
  }), jsx(Modal, {
28762
28741
  centered: true,
28763
28742
  opened: createPermissionScopeModalOpened,
@@ -29751,7 +29730,7 @@ function EmailServerConfiguration() {
29751
29730
  })]
29752
29731
  })]
29753
29732
  })
29754
- }), !configExists && jsx(DataCard, {
29733
+ }), configExists && jsx(DataCard, {
29755
29734
  title: "Test invio email",
29756
29735
  children: jsxs(Stack, {
29757
29736
  children: [jsx(Alert, {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fluxo-dev/shell",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "peerDependencies": {
5
- "@fluxo-dev/shell-hub": "0.0.27",
6
- "@fluxo-dev/shell-korebi": "0.0.27",
7
- "@fluxo-dev/shell-mfe": "0.0.27",
8
- "@fluxo-dev/shell-printing": "0.0.27",
9
- "@fluxo-dev/shell-reporting": "0.0.27",
10
- "@fluxo-dev/shell-workflow": "0.0.27"
5
+ "@fluxo-dev/shell-hub": "0.0.29",
6
+ "@fluxo-dev/shell-korebi": "0.0.29",
7
+ "@fluxo-dev/shell-mfe": "0.0.29",
8
+ "@fluxo-dev/shell-printing": "0.0.29",
9
+ "@fluxo-dev/shell-reporting": "0.0.29",
10
+ "@fluxo-dev/shell-workflow": "0.0.29"
11
11
  },
12
12
  "module": "./index.esm.js",
13
13
  "type": "module",
@@ -1 +1,4 @@
1
- export declare function FrontendSwitch(): import("react/jsx-runtime").JSX.Element;
1
+ export interface FrontendSwitchProps {
2
+ iconColor?: string;
3
+ }
4
+ export declare function FrontendSwitch(props: FrontendSwitchProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { FluxoApp } from "@fluxo-dev/api-client-base";
2
+ export interface EmbeddedBackendModuleItemProps {
3
+ app: FluxoApp;
4
+ }
5
+ export declare function EmbeddedBackendModuleItem(props: EmbeddedBackendModuleItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- export interface UpdatePermissionProps {
2
- onUpdated: () => void;
3
- onCanceled: () => void;
4
- }
5
- export declare function UpdatePermission(props: UpdatePermissionProps): import("react/jsx-runtime").JSX.Element;