@hortiview/shared-components 2.12.2 → 2.14.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +9 -1
  3. package/dist/assets/BaseView.css +1 -1
  4. package/dist/components/Allowed/Allowed.d.ts +5 -5
  5. package/dist/components/Allowed/Allowed.js +2 -2
  6. package/dist/components/Allowed/Allowed.test.js +3 -3
  7. package/dist/components/AllowedButton/AllowedButton.d.ts +3 -3
  8. package/dist/components/AllowedButton/AllowedButton.js +1 -1
  9. package/dist/components/AllowedButton/AllowedButton.test.js +32 -32
  10. package/dist/components/AllowedIconButton/AllowedIconButton.d.ts +3 -3
  11. package/dist/components/AllowedIconButton/AllowedIconButton.js +1 -1
  12. package/dist/components/AllowedIconButton/AllowedIconButton.test.js +17 -17
  13. package/dist/components/BaseView/BaseView.d.ts +1 -0
  14. package/dist/components/BaseView/BaseView.js +79 -79
  15. package/dist/components/BaseView/BaseView.test.js +58 -18
  16. package/dist/components/ContextMenu/ContextMenu.d.ts +5 -1
  17. package/dist/components/ContextMenu/ContextMenu.js +40 -35
  18. package/dist/components/ContextMenu/ContextMenu.test.js +74 -23
  19. package/dist/components/DeleteModal/DeleteModal.d.ts +6 -1
  20. package/dist/components/DeleteModal/DeleteModal.js +73 -58
  21. package/dist/components/DeleteModal/DeleteModal.test.js +42 -19
  22. package/dist/components/PermissionChecks/PermissionService.d.ts +15 -8
  23. package/dist/components/PermissionChecks/PermissionService.js +18 -20
  24. package/dist/components/PermissionChecks/PermissionService.test.js +27 -19
  25. package/dist/main.d.ts +1 -0
  26. package/dist/types/ListElement.d.ts +5 -0
  27. package/dist/types/Permission.d.ts +2 -2
  28. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [2.14.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.13.0...v2.14.0) (2026-02-10)
2
+
3
+ ### Features
4
+
5
+ * add isAllowed prop to baseView elements to remove them from list when user is not allowed to access them ([ac7449e](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/ac7449e5ae0e39302f48e9178d72ee0dab725544))
6
+ * add isAllowed prop to contextMenu to remove items from menu when user is not allowed to trigger the action ([b071931](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/b0719310a495f68adfef9424572efa467aa519a1))
7
+
8
+ ### Bug Fixes
9
+
10
+ * removed max width from base view header ([259c732](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/259c7321406cd47e5ca19e2f8bee7ed9600740ac))
11
+
12
+ ### Code Refactoring
13
+
14
+ * add permission handling to BaseView and ContextMenu stories ([26b4ae5](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/26b4ae503a76c33ad57e683b5861eb2a95fa3cd6))
15
+ * useIsAllowed hook to check multiple entities for permissions ([f168ef5](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/f168ef56c58e8cbc536a9a7451019b5c262266e1))
16
+
17
+ ## [2.13.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.12.2...v2.13.0) (2026-02-06)
18
+
19
+ ### Features
20
+
21
+ * add isDeletePending prop to DeleteModal for loading state ([d513159](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/d51315909b7de18462ca79da88fd36260f621780))
22
+
1
23
  ## [2.12.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.12.1...v2.12.2) (2026-02-03)
2
24
 
3
25
  ### Code Refactoring
package/README.md CHANGED
@@ -205,6 +205,12 @@ const actions = [
205
205
 
206
206
  A modal to confirm a deletion.
207
207
 
208
+ It provides a loading state for the delete button to prevent multiple deletion attempts in a row. In this case, the button is disabled and a spinner is shown in the button.
209
+
210
+ If a deletion is not possible, the button is also disabled and the specified `impossibleDeleteHeader` is shown.
211
+
212
+ The button is also disabled when the user is offline, indicated by the `isOnline` prop. In this case, the [OfflineView](#offlineview) is shown.
213
+
208
214
  ```jsx
209
215
  import { DeleteModal } from '@hortiview/shared-components';
210
216
 
@@ -222,9 +228,11 @@ const onDelete = () => {
222
228
  confirmButtonLabel={'Remove'}
223
229
  cancelButtonLabel={'Cancel'}
224
230
  deleteHeader={'Delete my block'}
225
- impossibleDeleteHeader={'block cant be deleted'}
231
+ impossibleDeleteHeader={'Block cannot be deleted'}
226
232
  deleteBody={['block 1', 'block 2', 'block 3']}
227
233
  isDeletePossible
234
+ isDeletePending={isDeleteRequestPending}
235
+ isOnline={isOnline}
228
236
  />;
229
237
  ```
230
238
 
@@ -1 +1 @@
1
- ._fullHeight_1a5ww_1{height:100%}._fullWidth_1a5ww_5{width:100%}._maxWidth_1a5ww_9{max-width:55vw;background-color:var(--lmnt-theme-background)}._list_1a5ww_14{box-shadow:0 8px 24px #959da533;background-color:var(--lmnt-theme-background);border-radius:.5rem;overflow-y:auto;width:100%;height:100%}._desktopList_1a5ww_23{width:30%;align-self:stretch}._noRoundedCorners_1a5ww_28 [class*="lmnt mdc-list-item"]{border-radius:0rem!important}._detail_1a5ww_32{height:100%;box-shadow:0 8px 24px #959da533;border-radius:.5rem;background-color:var(--lmnt-theme-background);width:100%}._desktopDetail_1a5ww_40{width:70%;overflow-y:auto;scrollbar-width:thin}
1
+ ._fullHeight_71rfc_1{height:100%}._fullWidth_71rfc_5{width:100%}._maxWidth_71rfc_9{background-color:var(--lmnt-theme-background)}._list_71rfc_13{box-shadow:0 8px 24px #959da533;background-color:var(--lmnt-theme-background);border-radius:.5rem;overflow-y:auto;width:100%;height:100%}._desktopList_71rfc_22{width:30%;align-self:stretch}._noRoundedCorners_71rfc_27 [class*="lmnt mdc-list-item"]{border-radius:0rem!important}._detail_71rfc_31{height:100%;box-shadow:0 8px 24px #959da533;border-radius:.5rem;background-color:var(--lmnt-theme-background);width:100%}._desktopDetail_71rfc_39{width:70%;overflow-y:auto;scrollbar-width:thin}
@@ -1,9 +1,9 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { HVPermissions } from '../../types/Permission';
2
+ import { IsAllowedProps } from '../PermissionChecks/PermissionService';
3
3
 
4
4
  type AllowedProps = {
5
- neededPermissions: HVPermissions[];
6
- entityId: string | undefined;
5
+ neededPermissions: IsAllowedProps['neededPermissions'];
6
+ entityIds: IsAllowedProps['entityIds'];
7
7
  disclaimer?: boolean;
8
8
  disclaimerText?: string;
9
9
  };
@@ -11,11 +11,11 @@ type AllowedProps = {
11
11
  * A component wrapper which takes permissions and an entity id (as a fallback the activeOrganization id is used) the permission is for.
12
12
  * Returns the children if the user has the permission for the entity, nothing otherwise (or an optional disclaimer)
13
13
  * @param children - the children to return if allowed to see it
14
- * @param entityId - the entity id, the permission is for (FarmOrganizationId, VendorOrganizationId or FarmId)
14
+ * @param entityIds - the entity ids, the permission is for (FarmOrganizationId, VendorOrganizationId or FarmId)
15
15
  * @param neededPermissions - the permissions needed to see the children
16
16
  * @param disclaimer - if true a disclaimer is shown, otherwise not. (default: false)
17
17
  * @param disclaimerText - the text to show in the disclaimer (default: 'You are not allowed to see the content of this section.')
18
18
  * @returns
19
19
  */
20
- export declare const Allowed: ({ children, neededPermissions, entityId, disclaimer, disclaimerText, }: PropsWithChildren<AllowedProps>) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | null | undefined;
20
+ export declare const Allowed: ({ children, neededPermissions, entityIds, disclaimer, disclaimerText, }: PropsWithChildren<AllowedProps>) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | null | undefined;
21
21
  export {};
@@ -4,10 +4,10 @@ import { useIsAllowed as n } from "../PermissionChecks/PermissionService.js";
4
4
  const d = ({
5
5
  children: o,
6
6
  neededPermissions: e,
7
- entityId: t,
7
+ entityIds: t,
8
8
  disclaimer: r = !1,
9
9
  disclaimerText: l = "You are not allowed to see the content of this section."
10
- }) => n()(e, t) ? o : r ? /* @__PURE__ */ s(i, { text: l }) : null;
10
+ }) => n()({ neededPermissions: e, entityIds: t }) ? o : r ? /* @__PURE__ */ s(i, { text: l }) : null;
11
11
  export {
12
12
  d as Allowed
13
13
  };
@@ -8,7 +8,7 @@ l("Test Allowed", () => {
8
8
  d("should return the children if allowed to see them", () => {
9
9
  const r = /* @__PURE__ */ e("div", { children: "Allowed to see children" });
10
10
  s(
11
- /* @__PURE__ */ e(i, { neededPermissions: [o.CurrentUserRead], entityId: "General", children: r }),
11
+ /* @__PURE__ */ e(i, { neededPermissions: [o.CurrentUserRead], entityIds: "General", children: r }),
12
12
  {
13
13
  userPermissions: {
14
14
  General: [o.CurrentUserRead]
@@ -18,7 +18,7 @@ l("Test Allowed", () => {
18
18
  }), d("should return empty wrapper when not allowed to see children", () => {
19
19
  const r = /* @__PURE__ */ e("div", { children: "Allowed to see children" });
20
20
  s(
21
- /* @__PURE__ */ e(i, { neededPermissions: [o.CurrentUserRead], entityId: "General", children: r }),
21
+ /* @__PURE__ */ e(i, { neededPermissions: [o.CurrentUserRead], entityIds: "General", children: r }),
22
22
  {
23
23
  userPermissions: {
24
24
  General: []
@@ -33,7 +33,7 @@ l("Test Allowed", () => {
33
33
  {
34
34
  disclaimer: !0,
35
35
  neededPermissions: [o.CurrentUserRead],
36
- entityId: "General",
36
+ entityIds: "General",
37
37
  children: r
38
38
  }
39
39
  ),
@@ -1,5 +1,5 @@
1
1
  import { ButtonProps } from '@element-public/react-button';
2
- import { HVPermissions } from '../../types/Permission';
2
+ import { IsAllowedProps } from '../PermissionChecks/PermissionService';
3
3
 
4
4
  export type AllowedButtonProps = Omit<ButtonProps, 'buttonSize' | 'variant' | 'type' | 'label'> & {
5
5
  /**
@@ -19,7 +19,7 @@ export type AllowedButtonProps = Omit<ButtonProps, 'buttonSize' | 'variant' | 't
19
19
  /**
20
20
  * The entity id, the permission is for (FarmOrganizationId, VendorOrganizationId or FarmLocationId).
21
21
  */
22
- entityId?: string;
22
+ entityIds: IsAllowedProps['entityIds'];
23
23
  /**
24
24
  * Id used for linking the button to a form.
25
25
  */
@@ -36,7 +36,7 @@ export type AllowedButtonProps = Omit<ButtonProps, 'buttonSize' | 'variant' | 't
36
36
  /**
37
37
  * The permissions needed to enable the button. If the array is empty, the button is always enabled.
38
38
  */
39
- permissions: HVPermissions[];
39
+ permissions: IsAllowedProps['neededPermissions'];
40
40
  /**
41
41
  * Changes the the size of the button.
42
42
  * Default: 'medium'
@@ -10,7 +10,7 @@ const c = ({
10
10
  size: l = "medium",
11
11
  isLoading: i = !1,
12
12
  ...t
13
- }) => /* @__PURE__ */ e(s, { neededPermissions: t.permissions, entityId: t.entityId, children: /* @__PURE__ */ e(
13
+ }) => /* @__PURE__ */ e(s, { neededPermissions: t.permissions, entityIds: t.entityIds, children: /* @__PURE__ */ e(
14
14
  r,
15
15
  {
16
16
  buttonSize: l,
@@ -1,10 +1,10 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { s as t, f as u } from "../../react.esm-Bm0cAgpZ.js";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { s as e, f as u } from "../../react.esm-Bm0cAgpZ.js";
3
3
  import { renderWithPermissions as n } from "../../test-utils.js";
4
4
  import { HVMainPermissions as i } from "../../types/Permission.js";
5
5
  import { AllowedButton as d } from "./AllowedButton.js";
6
6
  import { u as b } from "../../useBreakpoints-MzTZ0tCT.js";
7
- import { v as l, d as m, b as c, t as r, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
7
+ import { v as l, d as m, b as c, t as r, g as t } from "../../vi.bdSIJ99Y-B308Q-4w.js";
8
8
  l.mock("../../hooks/useBreakpoints", () => ({
9
9
  useBreakpoints: l.fn()
10
10
  }));
@@ -18,63 +18,63 @@ m("AllowedButton Test", () => {
18
18
  });
19
19
  }), r("renders button with no permissions required", () => {
20
20
  n(
21
- /* @__PURE__ */ s(d, { "data-testid": "test", label: "Add", permissions: [], entityId: void 0 })
22
- ), e(t.getByText("Add")).toBeInTheDocument();
21
+ /* @__PURE__ */ o(d, { "data-testid": "test", label: "Add", permissions: [], entityIds: "General" })
22
+ ), t(e.getByText("Add")).toBeInTheDocument();
23
23
  }), r("renders outlined button variant", () => {
24
24
  n(
25
- /* @__PURE__ */ s(
25
+ /* @__PURE__ */ o(
26
26
  d,
27
27
  {
28
28
  "data-testid": "regular-outlined-button",
29
29
  label: "Add",
30
30
  variant: "outlined",
31
31
  permissions: [],
32
- entityId: void 0
32
+ entityIds: "General"
33
33
  }
34
34
  )
35
35
  );
36
- const o = t.getAllByRole("button")[0];
37
- e(o).toHaveClass("mdc-button--outlined"), e(t.getByTestId("allowed-button-regular-outlined-button")).toBeInTheDocument();
36
+ const s = e.getAllByRole("button")[0];
37
+ t(s).toHaveClass("mdc-button--outlined"), t(e.getByTestId("allowed-button-regular-outlined-button")).toBeInTheDocument();
38
38
  }), r("renders full-width button", () => {
39
39
  n(
40
- /* @__PURE__ */ s(
40
+ /* @__PURE__ */ o(
41
41
  d,
42
42
  {
43
43
  "data-testid": "regular-button",
44
44
  label: "Add",
45
45
  fullWidth: !0,
46
46
  permissions: [],
47
- entityId: void 0
47
+ entityIds: "General"
48
48
  }
49
49
  )
50
50
  );
51
- const o = t.getAllByRole("button")[0];
52
- e(o).toHaveClass("lmnt-button--full-width"), e(t.getByTestId("allowed-button-regular-button")).toBeInTheDocument();
51
+ const s = e.getAllByRole("button")[0];
52
+ t(s).toHaveClass("lmnt-button--full-width"), t(e.getByTestId("allowed-button-regular-button")).toBeInTheDocument();
53
53
  }), r("calls onClick when clicked", () => {
54
- const o = l.fn();
54
+ const s = l.fn();
55
55
  n(
56
- /* @__PURE__ */ s(
56
+ /* @__PURE__ */ o(
57
57
  d,
58
58
  {
59
59
  "data-testid": "test-onclick-button",
60
60
  label: "Add",
61
- onClick: o,
61
+ onClick: s,
62
62
  permissions: [],
63
- entityId: void 0
63
+ entityIds: "General"
64
64
  }
65
65
  )
66
66
  );
67
- const a = t.getAllByRole("button")[0];
68
- u.click(a), e(o).toHaveBeenCalled(), e(t.getByTestId("allowed-button-test-onclick-button")).toBeInTheDocument();
67
+ const a = e.getAllByRole("button")[0];
68
+ u.click(a), t(s).toHaveBeenCalled(), t(e.getByTestId("allowed-button-test-onclick-button")).toBeInTheDocument();
69
69
  }), r("renders disabled button when prop is used", () => {
70
70
  n(
71
- /* @__PURE__ */ s(
71
+ /* @__PURE__ */ o(
72
72
  d,
73
73
  {
74
74
  "data-testid": "disabled-button",
75
75
  label: "Add",
76
76
  permissions: [i.SuperUser],
77
- entityId: "farm-123",
77
+ entityIds: "farm-123",
78
78
  disabled: !0
79
79
  }
80
80
  ),
@@ -83,18 +83,18 @@ m("AllowedButton Test", () => {
83
83
  "farm-123": [i.SuperUser]
84
84
  }
85
85
  }
86
- ), e(t.getByText("Add")).toBeInTheDocument(), e(t.getByTestId("allowed-button-disabled-button")).toBeInTheDocument();
87
- const o = t.getAllByRole("button")[0];
88
- e(o).toHaveAttribute("disabled");
86
+ ), t(e.getByText("Add")).toBeInTheDocument(), t(e.getByTestId("allowed-button-disabled-button")).toBeInTheDocument();
87
+ const s = e.getAllByRole("button")[0];
88
+ t(s).toHaveAttribute("disabled");
89
89
  }), r("hides button when permission is missing", () => {
90
90
  n(
91
- /* @__PURE__ */ s(
91
+ /* @__PURE__ */ o(
92
92
  d,
93
93
  {
94
94
  "data-testid": "missing",
95
95
  label: "Add",
96
96
  permissions: [i.SuperUser],
97
- entityId: "farm-123"
97
+ entityIds: "farm-123"
98
98
  }
99
99
  ),
100
100
  {
@@ -102,16 +102,16 @@ m("AllowedButton Test", () => {
102
102
  "farm-123": [i.FarmsUpdate, i.FarmsRead]
103
103
  }
104
104
  }
105
- ), e(t.queryByText("Add")).not.toBeInTheDocument(), e(t.queryByTestId("allowed-button-missing")).not.toBeInTheDocument();
105
+ ), t(e.queryByText("Add")).not.toBeInTheDocument(), t(e.queryByTestId("allowed-button-missing")).not.toBeInTheDocument();
106
106
  }), r("renders button when permission exists", () => {
107
107
  n(
108
- /* @__PURE__ */ s(
108
+ /* @__PURE__ */ o(
109
109
  d,
110
110
  {
111
111
  "data-testid": "enabled",
112
112
  label: "Add",
113
113
  permissions: [i.SuperUser],
114
- entityId: "farm-123"
114
+ entityIds: "farm-123"
115
115
  }
116
116
  ),
117
117
  {
@@ -119,8 +119,8 @@ m("AllowedButton Test", () => {
119
119
  "farm-123": [i.SuperUser]
120
120
  }
121
121
  }
122
- ), e(t.getByText("Add")).toBeInTheDocument(), e(t.getByTestId("allowed-button-enabled")).toBeInTheDocument();
123
- const o = t.getAllByRole("button")[0];
124
- e(o).not.toHaveAttribute("disabled");
122
+ ), t(e.getByText("Add")).toBeInTheDocument(), t(e.getByTestId("allowed-button-enabled")).toBeInTheDocument();
123
+ const s = e.getAllByRole("button")[0];
124
+ t(s).not.toHaveAttribute("disabled");
125
125
  });
126
126
  });
@@ -1,5 +1,5 @@
1
1
  import { IconButtonProps } from '@element-public/react-icon-button';
2
- import { HVPermissions } from '../../types/Permission';
2
+ import { IsAllowedProps } from '../PermissionChecks/PermissionService';
3
3
 
4
4
  export type AllowedIconButtonProps = Omit<IconButtonProps, 'variant' | 'iconType' | 'iconSize'> & {
5
5
  /**
@@ -9,7 +9,7 @@ export type AllowedIconButtonProps = Omit<IconButtonProps, 'variant' | 'iconType
9
9
  /**
10
10
  * The entity id, the permission is for (FarmOrganizationId, VendorOrganizationId or FarmLocationId).
11
11
  */
12
- entityId?: string;
12
+ entityIds: IsAllowedProps['entityIds'];
13
13
  /**
14
14
  * Id used for linking the button to a form.
15
15
  */
@@ -28,7 +28,7 @@ export type AllowedIconButtonProps = Omit<IconButtonProps, 'variant' | 'iconType
28
28
  /**
29
29
  * The permissions needed to enable the button. If the array is empty, the button is always enabled.
30
30
  */
31
- permissions: HVPermissions[];
31
+ permissions: IsAllowedProps['neededPermissions'];
32
32
  /**
33
33
  * Changes the the size of the icon button.
34
34
  * Default: 'medium'
@@ -7,7 +7,7 @@ const f = ({
7
7
  iconType: d = "filled",
8
8
  size: n = "medium",
9
9
  ...t
10
- }) => /* @__PURE__ */ i(l, { neededPermissions: t.permissions, entityId: t.entityId, children: /* @__PURE__ */ i(
10
+ }) => /* @__PURE__ */ i(l, { neededPermissions: t.permissions, entityIds: t.entityIds, children: /* @__PURE__ */ i(
11
11
  m,
12
12
  {
13
13
  "data-testid": `allowed-icon-button-${o}`,
@@ -4,19 +4,19 @@ import { renderWithPermissions as i } from "../../test-utils.js";
4
4
  import { HVMainPermissions as n } from "../../types/Permission.js";
5
5
  import { AllowedIconButton as r } from "./AllowedIconButton.js";
6
6
  import { u as c } from "../../useBreakpoints-MzTZ0tCT.js";
7
- import { v as a, d as m, b, t as d, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
8
- a.mock("../../hooks/useBreakpoints", () => ({
9
- useBreakpoints: a.fn()
7
+ import { v as d, d as m, b, t as a, g as e } from "../../vi.bdSIJ99Y-B308Q-4w.js";
8
+ d.mock("../../hooks/useBreakpoints", () => ({
9
+ useBreakpoints: d.fn()
10
10
  }));
11
11
  m("AllowedIconButton Test", () => {
12
12
  b(() => {
13
- a.mocked(c).mockReturnValue({
13
+ d.mocked(c).mockReturnValue({
14
14
  isDesktop: !0,
15
15
  isMobile: !1,
16
16
  isTablet: !1,
17
17
  isDesktopNavbar: !0
18
18
  });
19
- }), d("renders icon button with no permissions required", () => {
19
+ }), a("renders icon button with no permissions required", () => {
20
20
  i(
21
21
  /* @__PURE__ */ s(
22
22
  r,
@@ -24,13 +24,13 @@ m("AllowedIconButton Test", () => {
24
24
  "data-testid": "icon-button",
25
25
  icon: "add",
26
26
  permissions: [],
27
- entityId: void 0
27
+ entityIds: "General"
28
28
  }
29
29
  )
30
30
  );
31
31
  const o = t.getAllByRole("button")[0];
32
32
  e(o).toHaveClass("lmnt-icon-button"), e(t.getByTestId("allowed-icon-button-icon-button")).toBeInTheDocument();
33
- }), d("renders secondary variant icon button", () => {
33
+ }), a("renders secondary variant icon button", () => {
34
34
  i(
35
35
  /* @__PURE__ */ s(
36
36
  r,
@@ -39,14 +39,14 @@ m("AllowedIconButton Test", () => {
39
39
  icon: "add",
40
40
  variant: "filled-secondary",
41
41
  permissions: [],
42
- entityId: void 0
42
+ entityIds: "General"
43
43
  }
44
44
  )
45
45
  );
46
46
  const o = t.getAllByRole("button")[0];
47
47
  e(o).toHaveClass("lmnt-icon-button--fill-secondary"), e(t.getByTestId("allowed-icon-button-secondary-button")).toBeInTheDocument();
48
- }), d("calls onClick when clicked", () => {
49
- const o = a.fn();
48
+ }), a("calls onClick when clicked", () => {
49
+ const o = d.fn();
50
50
  i(
51
51
  /* @__PURE__ */ s(
52
52
  r,
@@ -55,13 +55,13 @@ m("AllowedIconButton Test", () => {
55
55
  icon: "add",
56
56
  onClick: o,
57
57
  permissions: [],
58
- entityId: void 0
58
+ entityIds: "General"
59
59
  }
60
60
  )
61
61
  );
62
62
  const l = t.getAllByRole("button")[0];
63
63
  u.click(l), e(o).toHaveBeenCalled(), e(t.getByTestId("allowed-icon-button-test-onclick-button")).toBeInTheDocument();
64
- }), d("renders disabled icon button when prop is used", () => {
64
+ }), a("renders disabled icon button when prop is used", () => {
65
65
  i(
66
66
  /* @__PURE__ */ s(
67
67
  r,
@@ -69,7 +69,7 @@ m("AllowedIconButton Test", () => {
69
69
  "data-testid": "disabled-button",
70
70
  icon: "add",
71
71
  permissions: [n.SuperUser],
72
- entityId: "farm-123",
72
+ entityIds: "farm-123",
73
73
  disabled: !0
74
74
  }
75
75
  ),
@@ -81,7 +81,7 @@ m("AllowedIconButton Test", () => {
81
81
  ), e(t.getByTestId("allowed-icon-button-disabled-button")).toBeInTheDocument();
82
82
  const o = t.getAllByRole("button")[0];
83
83
  e(o).toHaveAttribute("disabled");
84
- }), d("hides icon button when permission is missing", () => {
84
+ }), a("hides icon button when permission is missing", () => {
85
85
  i(
86
86
  /* @__PURE__ */ s(
87
87
  r,
@@ -89,7 +89,7 @@ m("AllowedIconButton Test", () => {
89
89
  "data-testid": "missing",
90
90
  icon: "add",
91
91
  permissions: [n.SuperUser],
92
- entityId: "farm-123"
92
+ entityIds: "farm-123"
93
93
  }
94
94
  ),
95
95
  {
@@ -98,7 +98,7 @@ m("AllowedIconButton Test", () => {
98
98
  }
99
99
  }
100
100
  ), e(t.queryByTestId("allowed-icon-button-missing")).not.toBeInTheDocument();
101
- }), d("renders icon button when permission exists", () => {
101
+ }), a("renders icon button when permission exists", () => {
102
102
  i(
103
103
  /* @__PURE__ */ s(
104
104
  r,
@@ -106,7 +106,7 @@ m("AllowedIconButton Test", () => {
106
106
  "data-testid": "enabled",
107
107
  icon: "add",
108
108
  permissions: [n.SuperUser],
109
- entityId: "farm-123"
109
+ entityIds: "farm-123"
110
110
  }
111
111
  ),
112
112
  {
@@ -17,6 +17,7 @@ type BaseViewProps = {
17
17
  emptyText: string;
18
18
  /**
19
19
  * pathname of the current route, use react-router to have the best experience (use useLocation and its pathname property)
20
+ * Should be used as a fallback if the user has no permissions to access any of the elements.
20
21
  */
21
22
  pathname: string;
22
23
  /**