@hortiview/shared-components 2.28.3 → 2.29.0-alpha.df46fcc5.1
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/CHANGELOG.md +807 -0
- package/README.md +1387 -0
- package/components/AllowedButton/AllowedButton.d.ts +1 -1
- package/components/AllowedButton/AllowedButton.js +24 -21
- package/components/AllowedIconButton/AllowedIconButton.d.ts +1 -1
- package/components/AllowedIconButton/AllowedIconButton.js +20 -17
- package/components/ContextMenu/ContextMenu.d.ts +3 -11
- package/components/ContextMenu/ContextMenu.js +87 -97
- package/components/FormComponents/FormNumber/CustomTextField.js +1 -1
- package/components/FormComponents/FormText/FormText.js +101 -109
- package/components/GenericTable/GenericTableService.js +22 -22
- package/main.d.ts +0 -1
- package/main.js +33 -35
- package/package.json +1 -1
- package/types/Permission.d.ts +1 -147
- package/types/Permission.js +1 -4
- package/components/ContextMenu/ContextMenuService.d.ts +0 -8
- package/components/ContextMenu/ContextMenuService.js +0 -19
- package/components/PermissionChecks/mockedPermissions.d.ts +0 -24
- package/components/PermissionChecks/mockedPermissions.js +0 -299
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as d } from "react";
|
|
3
3
|
import { ContextMenu as l } from "../ContextMenu/ContextMenu.js";
|
|
4
4
|
const P = ({
|
|
5
5
|
data: n = [],
|
|
6
6
|
order: e = [],
|
|
7
7
|
cellTemplates: r = void 0,
|
|
8
|
-
headerTranslation: t = (
|
|
8
|
+
headerTranslation: t = (f) => f,
|
|
9
9
|
getRowActions: c = void 0,
|
|
10
|
-
customColumnWidth:
|
|
10
|
+
customColumnWidth: o,
|
|
11
11
|
cardTitleColumn: u,
|
|
12
12
|
cardSubTitleColumn: s
|
|
13
|
-
}) =>
|
|
13
|
+
}) => d(() => {
|
|
14
14
|
if (n?.length === 0) return [];
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const f = v(n[0], e).map((i) => {
|
|
16
|
+
const a = o ? o[i] : void 0;
|
|
17
17
|
return {
|
|
18
|
-
id:
|
|
19
|
-
header: t(
|
|
20
|
-
accessor:
|
|
21
|
-
cellTemplate: r ? r[
|
|
22
|
-
cellProps:
|
|
23
|
-
headerCellProps:
|
|
24
|
-
asCardTitle:
|
|
25
|
-
asCardSubtitle:
|
|
18
|
+
id: i,
|
|
19
|
+
header: t(i),
|
|
20
|
+
accessor: i,
|
|
21
|
+
cellTemplate: r ? r[i] : void 0,
|
|
22
|
+
cellProps: a ? { width: a } : void 0,
|
|
23
|
+
headerCellProps: a ? { width: a } : void 0,
|
|
24
|
+
asCardTitle: i === u,
|
|
25
|
+
asCardSubtitle: i === s
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
return c ? [
|
|
29
|
-
...
|
|
29
|
+
...f,
|
|
30
30
|
{
|
|
31
31
|
id: "actions",
|
|
32
32
|
header: " ",
|
|
@@ -34,28 +34,28 @@ const P = ({
|
|
|
34
34
|
cellProps: { id: "actions" },
|
|
35
35
|
headerCellProps: { id: "actions" }
|
|
36
36
|
}
|
|
37
|
-
] :
|
|
37
|
+
] : f;
|
|
38
38
|
}, [
|
|
39
39
|
n,
|
|
40
40
|
r,
|
|
41
41
|
e,
|
|
42
42
|
t,
|
|
43
43
|
c,
|
|
44
|
-
|
|
44
|
+
o,
|
|
45
45
|
u,
|
|
46
46
|
s
|
|
47
47
|
]), C = ({
|
|
48
48
|
data: n = [],
|
|
49
49
|
getRowActions: e = void 0
|
|
50
|
-
}) =>
|
|
50
|
+
}) => d(() => e ? n.map((r) => {
|
|
51
51
|
const t = e(r);
|
|
52
|
-
return !t || t.length === 0 ? r : { ...r, actions: /* @__PURE__ */ p(l, {
|
|
53
|
-
}) : n, [n, e]),
|
|
52
|
+
return !t || t.length === 0 ? r : { ...r, actions: /* @__PURE__ */ p(l, { actions: t, iconOrientation: "horizontal" }) };
|
|
53
|
+
}) : n, [n, e]), v = (n, e) => {
|
|
54
54
|
if (!n) return [];
|
|
55
55
|
let r = Object.keys(n).map((t) => t);
|
|
56
56
|
return e?.length > 0 && (r = r.sort((t, c) => {
|
|
57
|
-
const
|
|
58
|
-
return
|
|
57
|
+
const o = e.findIndex((s) => s === t), u = e.findIndex((s) => s === c);
|
|
58
|
+
return o === -1 ? 1 : u === -1 ? -1 : o - u;
|
|
59
59
|
})), r;
|
|
60
60
|
};
|
|
61
61
|
export {
|
package/main.d.ts
CHANGED
|
@@ -75,5 +75,4 @@ export { getPermissionsFromModulePermissionToken, useIsAllowed } from './compone
|
|
|
75
75
|
export type { IsAllowedProps } from './components/PermissionChecks/PermissionService';
|
|
76
76
|
export { SharedComponentsPermissionProvider } from './components/SharedComponentsPermissionProvider/SharedComponentsPermissionProvider';
|
|
77
77
|
export { createPermissionWrapper, renderWithPermissions } from './test-utils';
|
|
78
|
-
export { HVMainPermissions } from './types/Permission';
|
|
79
78
|
export type { HVPermissions, ModulePermissionTokenParsed, PermissionsByEntity } from './types/Permission';
|
package/main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { A as e } from "./AlertBanner-2rv7mRmR.js";
|
|
2
2
|
import { LinkBanner as m } from "./components/AlertBanner/LinkBanner.js";
|
|
3
3
|
import { BaseView as f } from "./components/BaseView/BaseView.js";
|
|
4
|
-
import { BasicHeading as
|
|
4
|
+
import { BasicHeading as i } from "./components/BasicHeading/BasicHeading.js";
|
|
5
5
|
import { BlockView as n } from "./components/BlockView/BlockView.js";
|
|
6
|
-
import { ButtonCard as
|
|
6
|
+
import { ButtonCard as A } from "./components/ButtonCard/ButtonCard.js";
|
|
7
7
|
import { ChipCard as d } from "./components/ChipCard/ChipCard.js";
|
|
8
8
|
import { ConfirmationModal as c } from "./components/ConfirmationModal/ConfirmationModal.js";
|
|
9
9
|
import { ContextMenu as T } from "./components/ContextMenu/ContextMenu.js";
|
|
@@ -11,13 +11,13 @@ import { DeleteModal as L } from "./components/DeleteModal/DeleteModal.js";
|
|
|
11
11
|
import { DetailContentWrapper as B } from "./components/DetailContentWrapper/DetailContentWrapper.js";
|
|
12
12
|
import { Disclaimer as u } from "./components/Disclaimer/Disclaimer.js";
|
|
13
13
|
import { EmptyView as G } from "./components/EmptyView/EmptyView.js";
|
|
14
|
-
import { Filter as
|
|
15
|
-
import { FloatingActionButton as
|
|
14
|
+
import { Filter as g } from "./components/Filter/Filter.js";
|
|
15
|
+
import { FloatingActionButton as N } from "./components/FloatingActionButton/FloatingActionButton.js";
|
|
16
16
|
import { FormattedNumberDisplay as b } from "./components/FormattedNumberDisplay/FormattedNumberDisplay.js";
|
|
17
17
|
import { GenericTable as O } from "./components/GenericTable/GenericTable.js";
|
|
18
|
-
import { HashTabView as
|
|
19
|
-
import { HeaderFilter as
|
|
20
|
-
import { Iconify as
|
|
18
|
+
import { HashTabView as h } from "./components/HashTabView/HashTabView.js";
|
|
19
|
+
import { HeaderFilter as U } from "./components/HeaderFilter/HeaderFilter.js";
|
|
20
|
+
import { Iconify as H } from "./components/Iconify/Iconify.js";
|
|
21
21
|
import { InfoCard as y } from "./components/InfoCard/InfoCard.js";
|
|
22
22
|
import { InfoGroup as Y } from "./components/InfoGroup/InfoGroup.js";
|
|
23
23
|
import { ListArea as j } from "./components/ListArea/ListArea.js";
|
|
@@ -27,10 +27,10 @@ import { ModulePadding as Z } from "./components/ModulePadding/ModulePadding.js"
|
|
|
27
27
|
import { OfflineView as rr } from "./components/OfflineView/OfflineView.js";
|
|
28
28
|
import { OnboardingBanner as er } from "./components/OnboardingBanner/OnboardingBanner.js";
|
|
29
29
|
import { OverflowTooltip as mr } from "./components/OverflowTooltip/OverflowTooltip.js";
|
|
30
|
-
import { ScrollbarX as fr, ScrollbarY as
|
|
30
|
+
import { ScrollbarX as fr, ScrollbarY as xr } from "./components/Scrollbar/Scrollbar.js";
|
|
31
31
|
import { SearchBar as ar } from "./components/SearchBar/SearchBar.js";
|
|
32
32
|
import { Select as lr } from "./components/Select/Select.js";
|
|
33
|
-
import { StepperHeader as
|
|
33
|
+
import { StepperHeader as sr } from "./components/Stepper/components/StepperHeader.js";
|
|
34
34
|
import { Stepper as Sr } from "./components/Stepper/Stepper.js";
|
|
35
35
|
import { TopBarBanner as Er } from "./components/TopBarBanner/TopBarBanner.js";
|
|
36
36
|
import { VerticalDivider as Fr } from "./components/VerticalDivider/VerticalDivider.js";
|
|
@@ -38,38 +38,37 @@ import { FormCheckBox as _r } from "./components/FormComponents/FormCheckBox/For
|
|
|
38
38
|
import { FormDatePicker as Ir } from "./components/FormComponents/FormDatePicker/FormDatePicker.js";
|
|
39
39
|
import { FormNumber as Dr } from "./components/FormComponents/FormNumber/FormNumber.js";
|
|
40
40
|
import { FormRadio as Cr } from "./components/FormComponents/FormRadio/FormRadio.js";
|
|
41
|
-
import { FormSelect as
|
|
42
|
-
import { FormSlider as
|
|
41
|
+
import { FormSelect as Mr } from "./components/FormComponents/FormSelect/FormSelect.js";
|
|
42
|
+
import { FormSlider as Pr } from "./components/FormComponents/FormSlider/FormSlider.js";
|
|
43
43
|
import { FormText as wr } from "./components/FormComponents/FormText/FormText.js";
|
|
44
44
|
import { FormToggle as Rr } from "./components/FormComponents/FormToggle/FormToggle.js";
|
|
45
|
-
import { SafeForm as
|
|
46
|
-
import { AvailableCustomIcons as
|
|
45
|
+
import { SafeForm as kr } from "./components/SafeForm/SafeForm.js";
|
|
46
|
+
import { AvailableCustomIcons as Vr } from "./enums/AvailableCustomIcons.js";
|
|
47
47
|
import { ThemeColor as vr } from "./enums/ThemeColor.js";
|
|
48
48
|
import { u as Wr, a as Yr } from "./useBreakpoints-DDrM9Cfx.js";
|
|
49
49
|
import { useContainerWidth as jr } from "./hooks/useContainerWidth.js";
|
|
50
50
|
import { capitalizeFirstLetters as Xr, flattenObjectToString as qr, getFormattedDateTime as Jr, getNumberAsLocaleString as Qr, trimLeadingAndTrailingSpaces as Zr } from "./services/UtilService.js";
|
|
51
51
|
import { StepperStyle as ro } from "./components/Stepper/stepperStyles.js";
|
|
52
52
|
import { DATE_FORMAT as eo, DATE_TIME_FORMAT as to, TIME_FORMAT as mo } from "./types/Time.js";
|
|
53
|
-
import { AVAILABLE_COUNTRY_KEYS as fo, AVAILABLE_LOCALES as
|
|
53
|
+
import { AVAILABLE_COUNTRY_KEYS as fo, AVAILABLE_LOCALES as xo, ENGLISH_LANGUAGE_ID as io, GERMAN_LANGUAGE_ID as ao, LANGUAGE_CODES_MAPPER as no, LANGUAGE_ID_MAPPER as lo, SPANISH_LANGUAGE_ID as Ao, TURKISH_LANGUAGE_ID as so } from "./types/Languages.js";
|
|
54
54
|
import { Allowed as co } from "./components/Allowed/Allowed.js";
|
|
55
55
|
import { AllowedButton as To } from "./components/AllowedButton/AllowedButton.js";
|
|
56
56
|
import { AllowedIconButton as Lo } from "./components/AllowedIconButton/AllowedIconButton.js";
|
|
57
57
|
import { getPermissionsFromModulePermissionToken as Bo, useIsAllowed as Io } from "./components/PermissionChecks/PermissionService.js";
|
|
58
58
|
import { SharedComponentsPermissionProvider as Do } from "./components/SharedComponentsPermissionProvider/SharedComponentsPermissionProvider.js";
|
|
59
|
-
import { createPermissionWrapper as Co, renderWithPermissions as
|
|
60
|
-
import { HVMainPermissions as Po } from "./types/Permission.js";
|
|
59
|
+
import { createPermissionWrapper as Co, renderWithPermissions as go } from "./test-utils.js";
|
|
61
60
|
export {
|
|
62
61
|
fo as AVAILABLE_COUNTRY_KEYS,
|
|
63
|
-
|
|
62
|
+
xo as AVAILABLE_LOCALES,
|
|
64
63
|
e as AlertBanner,
|
|
65
64
|
co as Allowed,
|
|
66
65
|
To as AllowedButton,
|
|
67
66
|
Lo as AllowedIconButton,
|
|
68
|
-
|
|
67
|
+
Vr as AvailableCustomIcons,
|
|
69
68
|
f as BaseView,
|
|
70
|
-
|
|
69
|
+
i as BasicHeading,
|
|
71
70
|
n as BlockView,
|
|
72
|
-
|
|
71
|
+
A as ButtonCard,
|
|
73
72
|
d as ChipCard,
|
|
74
73
|
c as ConfirmationModal,
|
|
75
74
|
T as ContextMenu,
|
|
@@ -78,25 +77,24 @@ export {
|
|
|
78
77
|
L as DeleteModal,
|
|
79
78
|
B as DetailContentWrapper,
|
|
80
79
|
u as Disclaimer,
|
|
81
|
-
|
|
80
|
+
io as ENGLISH_LANGUAGE_ID,
|
|
82
81
|
G as EmptyView,
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
g as Filter,
|
|
83
|
+
N as FloatingActionButton,
|
|
85
84
|
_r as FormCheckBox,
|
|
86
85
|
Ir as FormDatePicker,
|
|
87
86
|
Dr as FormNumber,
|
|
88
87
|
Cr as FormRadio,
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
Mr as FormSelect,
|
|
89
|
+
Pr as FormSlider,
|
|
91
90
|
wr as FormText,
|
|
92
91
|
Rr as FormToggle,
|
|
93
92
|
b as FormattedNumberDisplay,
|
|
94
93
|
ao as GERMAN_LANGUAGE_ID,
|
|
95
94
|
O as GenericTable,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
U as Iconify,
|
|
95
|
+
h as HashTabView,
|
|
96
|
+
U as HeaderFilter,
|
|
97
|
+
H as Iconify,
|
|
100
98
|
y as InfoCard,
|
|
101
99
|
Y as InfoGroup,
|
|
102
100
|
no as LANGUAGE_CODES_MAPPER,
|
|
@@ -109,18 +107,18 @@ export {
|
|
|
109
107
|
rr as OfflineView,
|
|
110
108
|
er as OnboardingBanner,
|
|
111
109
|
mr as OverflowTooltip,
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
Ao as SPANISH_LANGUAGE_ID,
|
|
111
|
+
kr as SafeForm,
|
|
114
112
|
fr as ScrollbarX,
|
|
115
|
-
|
|
113
|
+
xr as ScrollbarY,
|
|
116
114
|
ar as SearchBar,
|
|
117
115
|
lr as Select,
|
|
118
116
|
Do as SharedComponentsPermissionProvider,
|
|
119
117
|
Sr as Stepper,
|
|
120
|
-
|
|
118
|
+
sr as StepperHeader,
|
|
121
119
|
ro as StepperStyle,
|
|
122
120
|
mo as TIME_FORMAT,
|
|
123
|
-
|
|
121
|
+
so as TURKISH_LANGUAGE_ID,
|
|
124
122
|
vr as ThemeColor,
|
|
125
123
|
Er as TopBarBanner,
|
|
126
124
|
Fr as VerticalDivider,
|
|
@@ -130,7 +128,7 @@ export {
|
|
|
130
128
|
Jr as getFormattedDateTime,
|
|
131
129
|
Qr as getNumberAsLocaleString,
|
|
132
130
|
Bo as getPermissionsFromModulePermissionToken,
|
|
133
|
-
|
|
131
|
+
go as renderWithPermissions,
|
|
134
132
|
Zr as trimLeadingAndTrailingSpaces,
|
|
135
133
|
Wr as useBreakpoints,
|
|
136
134
|
jr as useContainerWidth,
|
package/package.json
CHANGED
package/types/Permission.d.ts
CHANGED
|
@@ -27,150 +27,4 @@ export type ModulePermissionTokenParsed = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Type representing all possible permissions in the system.p
|
|
29
29
|
*/
|
|
30
|
-
export type HVPermissions =
|
|
31
|
-
/**
|
|
32
|
-
* Enum for all main permissions available in the HortiView platform.
|
|
33
|
-
*/
|
|
34
|
-
export declare enum HVMainPermissions {
|
|
35
|
-
RoleUserDefault = "UserDefault",
|
|
36
|
-
RoleUnassignedHV = "UnassignedHV",
|
|
37
|
-
RoleHVFinancialAdmin = "HVFinancialAdmin",
|
|
38
|
-
RoleHVAdmin = "HVAdmin",
|
|
39
|
-
RoleHVDeveloper = "HVDeveloper",
|
|
40
|
-
RoleHVManager = "HVManager",
|
|
41
|
-
RoleHVLeadDeveloper = "HVLeadDeveloper",
|
|
42
|
-
FarmManager = "Farm Manager",
|
|
43
|
-
FarmWorker = "Farm Worker",
|
|
44
|
-
Agronomist = "Agronomist",
|
|
45
|
-
Advisor = "Advisor",
|
|
46
|
-
FarmOrganizationMember = "Farm Organization Member",
|
|
47
|
-
FarmOrganizationAdmin = "Organization Administrator",
|
|
48
|
-
Developer = "Developer",
|
|
49
|
-
LeadDeveloper = "Lead Developer",
|
|
50
|
-
BusinessManager = "Business Manager",
|
|
51
|
-
BusinessOwner = "Business Owner",
|
|
52
|
-
VendorOrganizationMember = "Vendor Organization Member",
|
|
53
|
-
ExternalConnectorAdvisor = "External Connector Advisor",
|
|
54
|
-
ExternalConnectorFarmManager = "External Connector Farm Manager",
|
|
55
|
-
ExternalConnectorOrganizationAdministrator = "External Connector Organization Administrator",
|
|
56
|
-
ExternalConnectorAgronomist = "External Connector Agronomist",
|
|
57
|
-
ExternalConnectorFarmWorker = "External Connector Farm Worker",
|
|
58
|
-
BlocksCreate = "blocks-create",
|
|
59
|
-
BlocksDelete = "blocks-delete",
|
|
60
|
-
BlocksRead = "blocks-read",
|
|
61
|
-
BlocksUpdate = "blocks-update",
|
|
62
|
-
CurrentUserRead = "current-user-read",
|
|
63
|
-
CurrentUserUpdate = "current-user-update",
|
|
64
|
-
FarmAlertRulesCreate = "farmalertrules-create",
|
|
65
|
-
FarmAlertRulesDelete = "farmalertrules-delete",
|
|
66
|
-
FarmAlertRulesRead = "farmalertrules-read",
|
|
67
|
-
FarmAlertRulesUpdate = "farmalertrules-update",
|
|
68
|
-
FarmAlertsCreate = "farmalerts-create",
|
|
69
|
-
FarmAlertsDelete = "farmalerts-delete",
|
|
70
|
-
FarmAlertsRead = "farmalerts-read",
|
|
71
|
-
FarmAlertsUpdate = "farmalerts-update",
|
|
72
|
-
FarmBillingInformationsCreate = "farm_billing_informations-create",
|
|
73
|
-
FarmBillingInformationsDelete = "farm_billing_informations-delete",
|
|
74
|
-
FarmBillingInformationsRead = "farm_billing_informations-read",
|
|
75
|
-
FarmBillingInformationsUpdate = "farm_billing_informations-update",
|
|
76
|
-
FarmMembersCreate = "farmmembers-create",
|
|
77
|
-
FarmMembersDelete = "farmmembers-delete",
|
|
78
|
-
FarmMembersRead = "farmmembers-read",
|
|
79
|
-
FarmMembersUpdate = "farmmembers-update",
|
|
80
|
-
FarmOrganizationMembersCreate = "farmorganizationmembers-create",
|
|
81
|
-
FarmOrganizationMembersDelete = "farmorganizationmembers-delete",
|
|
82
|
-
FarmOrganizationMembersRead = "farmorganizationmembers-read",
|
|
83
|
-
FarmOrganizationMembersUpdate = "farmorganizationmembers-update",
|
|
84
|
-
FarmOrganizationModuleRead = "farm_organization_module-read",
|
|
85
|
-
FarmOrganizationsCreate = "farm_organizations-create",
|
|
86
|
-
FarmOrganizationsDelete = "farm_organizations-delete",
|
|
87
|
-
FarmOrganizationsMulticreate = "farm_organizations-multicreate",
|
|
88
|
-
FarmOrganizationsRead = "farm_organizations-read",
|
|
89
|
-
FarmOrganizationsUpdate = "farm_organizations-update",
|
|
90
|
-
FarmRolesRead = "farm_roles-read",
|
|
91
|
-
FarmTagsCreate = "farmtags-create",
|
|
92
|
-
FarmTagsDelete = "farmtags-delete",
|
|
93
|
-
FarmTagsRead = "farmtags-read",
|
|
94
|
-
FarmTagsUpdate = "farmtags-update",
|
|
95
|
-
FarmsCreate = "farms-create",
|
|
96
|
-
FarmsDelete = "farms-delete",
|
|
97
|
-
FarmsRead = "farms-read",
|
|
98
|
-
FarmsUpdate = "farms-update",
|
|
99
|
-
FieldMembersCreate = "fieldmembers-create",
|
|
100
|
-
FieldMembersDelete = "fieldmembers-delete",
|
|
101
|
-
FieldMembersRead = "fieldmembers-read",
|
|
102
|
-
FieldMembersUpdate = "fieldmembers-update",
|
|
103
|
-
FieldsCreate = "fields-create",
|
|
104
|
-
FieldsDelete = "fields-delete",
|
|
105
|
-
FieldsRead = "fields-read",
|
|
106
|
-
FieldsUpdate = "fields-update",
|
|
107
|
-
InviteUserToOrganization = "invite-user-to-organization",
|
|
108
|
-
InvitedUsersCreate = "invitedusers-create",
|
|
109
|
-
InvitedUsersDelete = "invitedusers-delete",
|
|
110
|
-
InvitedUsersRead = "invitedusers-read",
|
|
111
|
-
InvitedUsersUpdate = "invitedusers-update",
|
|
112
|
-
InvoiceRead = "invoice-read",
|
|
113
|
-
IrrigationStationsCreate = "irrigationstations-create",
|
|
114
|
-
IrrigationStationsDelete = "irrigationstations-delete",
|
|
115
|
-
IrrigationStationsRead = "irrigationstations-read",
|
|
116
|
-
IrrigationStationsUpdate = "irrigationstations-update",
|
|
117
|
-
LegalAddressCreate = "legal_address-create",
|
|
118
|
-
LegalAddressDelete = "legal_address-delete",
|
|
119
|
-
LegalAddressRead = "legal_address-read",
|
|
120
|
-
LegalAddressUpdate = "legal_address-update",
|
|
121
|
-
LinkedUsersCreate = "linked_users-create",
|
|
122
|
-
LinkedUsersDelete = "linked_users-delete",
|
|
123
|
-
LinkedUsersRead = "linked_users-read",
|
|
124
|
-
LinkedUsersSwitch = "linked_users-switch",
|
|
125
|
-
LoginUser = "login-user",
|
|
126
|
-
MapProxyRead = "mapproxy-read",
|
|
127
|
-
ModuleMetricsRead = "module_metrics-read",
|
|
128
|
-
ModuleRatingsCreate = "module_ratings-create",
|
|
129
|
-
ModuleRatingsDelete = "module_ratings-delete",
|
|
130
|
-
ModuleRatingsRead = "module_ratings-read",
|
|
131
|
-
ModuleRatingsUpdate = "module_ratings-update",
|
|
132
|
-
ModuleReviewRequestsRead = "module_review_requests-read",
|
|
133
|
-
ModulesCreate = "modules-create",
|
|
134
|
-
ModulesDelete = "modules-delete",
|
|
135
|
-
ModulesPublish = "modules-publish",
|
|
136
|
-
ModulesRead = "modules-read",
|
|
137
|
-
ModulesRequestReview = "modules-request_review",
|
|
138
|
-
ModulesSearch = "modules-search",
|
|
139
|
-
ModulesSuspend = "modules-suspend",
|
|
140
|
-
ModulesUpdate = "modules-update",
|
|
141
|
-
OrganizationModulesCreate = "organization_modules-create",
|
|
142
|
-
OrganizationModulesDelete = "organization_modules-delete",
|
|
143
|
-
PaymentDetailsUpdate = "payment_details-update",
|
|
144
|
-
ProfilesDelete = "profiles-delete",
|
|
145
|
-
ProfilesUpdate = "profiles-update",
|
|
146
|
-
RegisterUser = "register-user",
|
|
147
|
-
ResetPassword = "reset-password",
|
|
148
|
-
SpeedtestCreate = "speedtest-create",
|
|
149
|
-
SpeedtestRead = "speedtest-read",
|
|
150
|
-
StripeProxyRead = "stripeproxy-read",
|
|
151
|
-
SubscriptionsRead = "subscriptions-read",
|
|
152
|
-
SuperUser = "superuser",
|
|
153
|
-
UserPilotProxyRead = "userpilotproxy-read",
|
|
154
|
-
UserRoleUpdate = "user_role-update",
|
|
155
|
-
UsersCreate = "users-create",
|
|
156
|
-
UsersDelete = "users-delete",
|
|
157
|
-
UsersRead = "users-read",
|
|
158
|
-
UsersUpdate = "users-update",
|
|
159
|
-
VendorBillingInformationsCreate = "vendor_billing_informations-create",
|
|
160
|
-
VendorBillingInformationsDelete = "vendor_billing_informations-delete",
|
|
161
|
-
VendorBillingInformationsRead = "vendor_billing_informations-read",
|
|
162
|
-
VendorBillingInformationsUpdate = "vendor_billing_informations-update",
|
|
163
|
-
VendorOrganizationMembersCreate = "vendor_members-create",
|
|
164
|
-
VendorOrganizationMembersDelete = "vendor_members-delete",
|
|
165
|
-
VendorOrganizationMembersRead = "vendor_members-read",
|
|
166
|
-
VendorOrganizationMembersUpdate = "vendor_members-update",
|
|
167
|
-
VendorOrganizationsCreate = "vendor_organizations-create",
|
|
168
|
-
VendorOrganizationsDelete = "vendor_organizations-delete",
|
|
169
|
-
VendorOrganizationsRead = "vendor_organizations-read",
|
|
170
|
-
VendorOrganizationsUpdate = "vendor_organizations-update",
|
|
171
|
-
WeatherProxyRead = "weatherproxy-read",
|
|
172
|
-
WhitelistCreate = "whitelist-create",
|
|
173
|
-
WhitelistDelete = "whitelist-delete",
|
|
174
|
-
WhitelistRead = "whitelist-read",
|
|
175
|
-
WhitelistUpdate = "whitelist-update"
|
|
176
|
-
}
|
|
30
|
+
export type HVPermissions = (string & Record<never, never>);
|
package/types/Permission.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
t as HVMainPermissions
|
|
4
|
-
};
|
|
1
|
+
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Repositions the menu vertically to stick with the trigger while scrolling.
|
|
3
|
-
* Horizontal scrolling is ignored.
|
|
4
|
-
*
|
|
5
|
-
* @returns `true` if the trigger has scrolled outside the vertical boundary of
|
|
6
|
-
* its nearest scrollable ancestor (or the viewport), otherwise `false`.
|
|
7
|
-
*/
|
|
8
|
-
export declare const repositionMenuVertically: (triggerElement: HTMLElement | null, menuElement: HTMLElement | null) => boolean;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const c = (e, t) => {
|
|
2
|
-
const o = e?.getBoundingClientRect();
|
|
3
|
-
if (!o || !t) return !1;
|
|
4
|
-
t.style.top = `${o.bottom}px`;
|
|
5
|
-
const l = r(e), n = l ? l.getBoundingClientRect() : { top: 0, bottom: window.innerHeight };
|
|
6
|
-
return o.bottom < n.top || o.top > n.bottom;
|
|
7
|
-
}, r = (e) => {
|
|
8
|
-
let t = e?.parentElement ?? null;
|
|
9
|
-
for (; t; ) {
|
|
10
|
-
const { overflow: o, overflowY: l } = getComputedStyle(t);
|
|
11
|
-
if (/(auto|scroll|overlay)/.test(o + l) && t.scrollHeight > t.clientHeight)
|
|
12
|
-
return t;
|
|
13
|
-
t = t.parentElement;
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
c as repositionMenuVertically
|
|
19
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Important note: Those permissions are only used for testing purposes.
|
|
3
|
-
* They do not reflect the actual permissions assigned to each role in a real environment.
|
|
4
|
-
*/
|
|
5
|
-
export declare const mockedRoles: {
|
|
6
|
-
UserDefault: string[];
|
|
7
|
-
UnassignedHV: string[];
|
|
8
|
-
HVFinancialAdmin: string[];
|
|
9
|
-
HVDeveloper: string[];
|
|
10
|
-
HVAdmin: string[];
|
|
11
|
-
HVManager: string[];
|
|
12
|
-
HVLeadDeveloper: string[];
|
|
13
|
-
Developer: string[];
|
|
14
|
-
'Business Owner': string[];
|
|
15
|
-
'Lead Developer': string[];
|
|
16
|
-
'Business Manager': string[];
|
|
17
|
-
'Vendor Organization Member': string[];
|
|
18
|
-
'Farm Worker': string[];
|
|
19
|
-
'Farm Manager': string[];
|
|
20
|
-
Agronomist: string[];
|
|
21
|
-
Advisor: string[];
|
|
22
|
-
'Organization Administrator': string[];
|
|
23
|
-
'Farm Organization Member': string[];
|
|
24
|
-
};
|