@balena/ui-shared-components 13.0.0-build-remove-role-inheritance-ac3d10291e39eebb252625d4d728cead979ec6ad-1 → 13.0.0-build-rename-and-require-widget-extracontext-37df890fe262ef54dc0d361d32b076c7eeccd84b-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/dist/components/RJST/Actions/Create.js +1 -1
- package/dist/components/RJST/Actions/Update.js +2 -6
- package/dist/components/RJST/components/Widget/Formats/BooleanAsIconWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/CodeWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/DisabledTextWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/DurationWidget.d.ts +1 -6
- package/dist/components/RJST/components/Widget/Formats/DurationWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/ElapsedTimeWidget.js +2 -2
- package/dist/components/RJST/components/Widget/Formats/HashWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/PercentageWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/PlaceholderTextWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/TemperatureWidget.js +1 -1
- package/dist/components/RJST/components/Widget/Formats/TxtWidget.js +9 -9
- package/dist/components/RJST/components/Widget/Formats/WrapWidget.js +1 -1
- package/dist/components/RJST/components/Widget/index.d.ts +1 -1
- package/dist/components/RJST/components/Widget/index.js +2 -2
- package/dist/components/RJST/components/Widget/utils.d.ts +2 -2
- package/dist/components/RJST/components/Widget/utils.js +3 -1
- package/dist/components/RJST/index.js +1 -1
- package/dist/components/RJST/models/example.d.ts +1 -1
- package/dist/components/RJST/models/example.js +1 -1
- package/dist/components/RJST/models/helpers.d.ts +1 -1
- package/dist/components/RJST/models/helpers.js +2 -2
- package/dist/components/RJST/schemaOps.d.ts +2 -2
- package/dist/components/RJST/utils.d.ts +1 -1
- package/dist/components/RJST/utils.js +8 -8
- package/package.json +3 -3
|
@@ -33,7 +33,7 @@ export const Create = ({ model, rjstContext, hasOngoingAction, onActionTriggered
|
|
|
33
33
|
return (_jsx(Box, { display: "flex", children: _jsx(Tooltip, { title: typeof disabledReason === 'string' ? disabledReason : undefined, children: _jsx(Button, { "data-action": `create-${model.resource}`, variant: "contained", onClick: () => {
|
|
34
34
|
onActionTriggered({
|
|
35
35
|
action,
|
|
36
|
-
schema: rjstJsonSchemaPick(model.schema, model.permissions.
|
|
36
|
+
schema: rjstJsonSchemaPick(model.schema, model.permissions.create),
|
|
37
37
|
});
|
|
38
38
|
}, startIcon: _jsx(FontAwesomeIcon, { icon: faMagic }), disabled: !!disabledReason, children: _jsx(ActionContent, { action: action, getDisabledReason: action.isDisabled, affectedEntries: undefined, checkedState: undefined, onDisabledReady: (result) => {
|
|
39
39
|
setDisabledReasonsByAction((disabledReasonsState) => (Object.assign(Object.assign({}, disabledReasonsState), { [action.title]: result })));
|
|
@@ -45,9 +45,7 @@ export const Update = ({ model, rjstContext, selected, hasOngoingAction, onActio
|
|
|
45
45
|
action,
|
|
46
46
|
schema: action.type === 'delete'
|
|
47
47
|
? {}
|
|
48
|
-
: rjstJsonSchemaPick(model.schema, model.permissions.
|
|
49
|
-
// TODO: Why is this cast necessary?
|
|
50
|
-
(p) => p[action.type])),
|
|
48
|
+
: rjstJsonSchemaPick(model.schema, model.permissions[action.type]),
|
|
51
49
|
affectedEntries: selected,
|
|
52
50
|
});
|
|
53
51
|
},
|
|
@@ -88,9 +86,7 @@ export const Update = ({ model, rjstContext, selected, hasOngoingAction, onActio
|
|
|
88
86
|
action,
|
|
89
87
|
schema: action.type === 'delete'
|
|
90
88
|
? {}
|
|
91
|
-
: rjstJsonSchemaPick(model.schema, model.permissions.
|
|
92
|
-
// TODO: Why is this cast necessary?
|
|
93
|
-
(p) => p[action.type])),
|
|
89
|
+
: rjstJsonSchemaPick(model.schema, model.permissions[action.type]),
|
|
94
90
|
affectedEntries: selected,
|
|
95
91
|
});
|
|
96
92
|
}, disabled: !!disabledUpdateReason, color: action.isDangerous ? 'error' : 'secondary', children: _jsx(ActionContent, { action: action, getDisabledReason: action.isDisabled, affectedEntries: selected, checkedState: checkedState, onDisabledReady: (result) => {
|
|
@@ -4,7 +4,7 @@ import { faTimesCircle } from '@fortawesome/free-solid-svg-icons/faTimesCircle';
|
|
|
4
4
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
5
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
6
6
|
import { Box, Typography } from '@mui/material';
|
|
7
|
-
export const BooleanAsIconWidget = widgetFactory('BooleanAsIcon',
|
|
7
|
+
export const BooleanAsIconWidget = widgetFactory('BooleanAsIcon', [
|
|
8
8
|
JsonTypes.boolean,
|
|
9
9
|
JsonTypes.number,
|
|
10
10
|
JsonTypes.null,
|
|
@@ -3,6 +3,6 @@ import { Tooltip } from '@mui/material';
|
|
|
3
3
|
import { Copy } from '../../../../Copy';
|
|
4
4
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
5
5
|
import { Code } from '../../../../Code';
|
|
6
|
-
export const CodeWidget = widgetFactory('Code',
|
|
6
|
+
export const CodeWidget = widgetFactory('Code', [JsonTypes.string])(({ value, }) => {
|
|
7
7
|
return (_jsx(Copy, { copy: value, children: _jsx(Tooltip, { title: value, children: _jsx(Code, { noWrap: true, children: value }) }) }));
|
|
8
8
|
});
|
|
@@ -3,7 +3,7 @@ import { Tooltip, Typography } from '@mui/material';
|
|
|
3
3
|
import { useTranslation } from '../../../../../hooks/useTranslations';
|
|
4
4
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
5
5
|
import { token } from '../../../../../utils/token';
|
|
6
|
-
export const DisabledTextWidget = widgetFactory('DisabledText',
|
|
6
|
+
export const DisabledTextWidget = widgetFactory('DisabledText', [
|
|
7
7
|
JsonTypes.string,
|
|
8
8
|
JsonTypes.number,
|
|
9
9
|
JsonTypes.null,
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { intervalToDuration } from 'date-fns';
|
|
4
4
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
5
5
|
import { Typography } from '@mui/material';
|
|
6
|
-
export const DurationWidget = widgetFactory('Duration',
|
|
6
|
+
export const DurationWidget = widgetFactory('Duration', [JsonTypes.object])(({ value }) => {
|
|
7
7
|
const duration = React.useMemo(() => {
|
|
8
8
|
var _a, _b, _c;
|
|
9
9
|
if (!value.start || !value.end) {
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { UiOption, JsonTypes, widgetFactory, formatTimestamp, timeSince, } from '../utils';
|
|
3
3
|
import { Material, Tooltip } from '../../../../..';
|
|
4
4
|
const { Typography } = Material;
|
|
5
|
-
export const ElapsedTimeWidget = widgetFactory('ElapsedTime', {
|
|
5
|
+
export const ElapsedTimeWidget = widgetFactory('ElapsedTime', [JsonTypes.string, JsonTypes.number], {
|
|
6
6
|
dtFormat: UiOption.string,
|
|
7
|
-
}
|
|
7
|
+
})(({ value }) => {
|
|
8
8
|
if (!value) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Code } from '@mui/icons-material';
|
|
3
3
|
import { Copy } from '../../../../Copy';
|
|
4
4
|
import { JsonTypes, truncateHash, widgetFactory } from '../utils';
|
|
5
|
-
export const HashWidget = widgetFactory('Hash',
|
|
5
|
+
export const HashWidget = widgetFactory('Hash', [JsonTypes.string])(({ value, }) => {
|
|
6
6
|
return (_jsx(Copy, { copy: value, children: _jsx(Code, { children: truncateHash(value) }) }));
|
|
7
7
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
3
|
-
export const PercentageWidget = widgetFactory('Percentage',
|
|
3
|
+
export const PercentageWidget = widgetFactory('Percentage', [
|
|
4
4
|
JsonTypes.string,
|
|
5
5
|
JsonTypes.number,
|
|
6
6
|
])(({ value }) => {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Typography } from '@mui/material';
|
|
3
3
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
4
4
|
import { token } from '../../../../../utils/token';
|
|
5
|
-
export const PlaceholderTextWidget = widgetFactory('PlaceholderText',
|
|
5
|
+
export const PlaceholderTextWidget = widgetFactory('PlaceholderText', [
|
|
6
6
|
JsonTypes.string,
|
|
7
7
|
JsonTypes.number,
|
|
8
8
|
JsonTypes.null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
3
|
-
export const TemperatureWidget = widgetFactory('Temperature',
|
|
3
|
+
export const TemperatureWidget = widgetFactory('Temperature', [
|
|
4
4
|
JsonTypes.number,
|
|
5
5
|
])(({ value }) => {
|
|
6
6
|
return _jsx(_Fragment, { children: value ? `~${value}°C` : '-' });
|
|
@@ -19,7 +19,14 @@ const getArrayValue = (value, uiSchema) => {
|
|
|
19
19
|
return arrayString;
|
|
20
20
|
};
|
|
21
21
|
const DATE_TIME_FORMATS = ['date-time', 'date', 'time'];
|
|
22
|
-
const TxtWidget = widgetFactory('Txt',
|
|
22
|
+
const TxtWidget = widgetFactory('Txt', [
|
|
23
|
+
JsonTypes.string,
|
|
24
|
+
JsonTypes.null,
|
|
25
|
+
JsonTypes.integer,
|
|
26
|
+
JsonTypes.number,
|
|
27
|
+
JsonTypes.boolean,
|
|
28
|
+
JsonTypes.array,
|
|
29
|
+
], {
|
|
23
30
|
dtFormat: UiOption.string,
|
|
24
31
|
align: Object.assign(Object.assign({}, UiOption.string), { enum: ['inherit', 'left', 'center', 'right', 'justify'] }),
|
|
25
32
|
gutterBottom: UiOption.bolean,
|
|
@@ -27,14 +34,7 @@ const TxtWidget = widgetFactory('Txt', {
|
|
|
27
34
|
paragraph: UiOption.boolean,
|
|
28
35
|
sx: UiOption.object,
|
|
29
36
|
variant: UiOption.string,
|
|
30
|
-
},
|
|
31
|
-
JsonTypes.string,
|
|
32
|
-
JsonTypes.null,
|
|
33
|
-
JsonTypes.integer,
|
|
34
|
-
JsonTypes.number,
|
|
35
|
-
JsonTypes.boolean,
|
|
36
|
-
JsonTypes.array,
|
|
37
|
-
])(({ value, schema, uiSchema }) => {
|
|
37
|
+
})(({ value, schema, uiSchema }) => {
|
|
38
38
|
var _a;
|
|
39
39
|
let displayValue = isArray(value)
|
|
40
40
|
? getArrayValue(value, uiSchema)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Typography } from '@mui/material';
|
|
3
3
|
import { JsonTypes, widgetFactory } from '../utils';
|
|
4
|
-
export const WrapWidget = widgetFactory('Wrap',
|
|
4
|
+
export const WrapWidget = widgetFactory('Wrap', [JsonTypes.string])(({ value, }) => {
|
|
5
5
|
return (_jsx(Typography, { sx: { maxWidth: '475px', whitespace: 'normal' }, children: value }));
|
|
6
6
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { WidgetProps } from './utils';
|
|
2
|
-
export declare const Widget: ({ value,
|
|
2
|
+
export declare const Widget: ({ value, resource, schema, extraFormats, uiSchema, }: WidgetProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -31,7 +31,7 @@ const getWidget = (value, format, uiSchemaWidget, extraFormats) => {
|
|
|
31
31
|
});
|
|
32
32
|
return (_b = (_a = extraFormat === null || extraFormat === void 0 ? void 0 : extraFormat.widget) !== null && _a !== void 0 ? _a : typeWidgets[valueType]) !== null && _b !== void 0 ? _b : typeWidgets.default;
|
|
33
33
|
};
|
|
34
|
-
export const Widget = ({ value,
|
|
34
|
+
export const Widget = ({ value, resource, schema = {}, extraFormats, uiSchema, }) => {
|
|
35
35
|
const format = getSchemaFormat(schema);
|
|
36
36
|
if (!format) {
|
|
37
37
|
return _jsx(_Fragment, { children: value });
|
|
@@ -43,5 +43,5 @@ export const Widget = ({ value, extraContext, schema = {}, extraFormats, uiSchem
|
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
45
|
const WidgetComponent = getWidget(processedValue, format, undefined, extraFormats);
|
|
46
|
-
return (_jsx(WidgetComponent, {
|
|
46
|
+
return (_jsx(WidgetComponent, { resource: resource, value: processedValue !== null && processedValue !== void 0 ? processedValue : null, schema: schema }));
|
|
47
47
|
};
|
|
@@ -19,7 +19,7 @@ export interface WidgetProps<T extends object = object> {
|
|
|
19
19
|
schema: JSONSchema | undefined;
|
|
20
20
|
extraFormats?: Format[];
|
|
21
21
|
uiSchema?: UiSchema;
|
|
22
|
-
|
|
22
|
+
resource: T;
|
|
23
23
|
}
|
|
24
24
|
export interface Widget<T extends object = object, ExtraProps = object> {
|
|
25
25
|
uiOptions?: UiOptions;
|
|
@@ -49,7 +49,7 @@ export type UiOptions = {
|
|
|
49
49
|
[key: string]: JSONSchema;
|
|
50
50
|
};
|
|
51
51
|
export declare const UiOption: UiOptions;
|
|
52
|
-
export declare const widgetFactory: <ST extends Array<keyof JsonTypesTypeMap>>(displayName: string,
|
|
52
|
+
export declare const widgetFactory: <ST extends Array<keyof JsonTypesTypeMap>>(displayName: string, supportedTypes: ST, uiOptions?: Widget["uiOptions"]) => <T extends object, ExtraProps extends object = object, V extends WidgetProps["value"] | null = JsonTypesTypeMap[ST[number]]>(widgetFn: (props: Overwrite<WidgetProps<T>, {
|
|
53
53
|
value: V;
|
|
54
54
|
}> & ExtraProps) => JSX.Element | null) => Widget<T, ExtraProps>;
|
|
55
55
|
export declare const formatTimestamp: (timestamp: string | number, uiSchema?: UiSchema) => string;
|
|
@@ -33,7 +33,9 @@ export const UiOption = {
|
|
|
33
33
|
// TODO: Replace the HOF with a plain function once TS supports optional generic types
|
|
34
34
|
// See: https://github.com/microsoft/TypeScript/issues/14400
|
|
35
35
|
// TODO: convert the fn args to an object once we bump TS
|
|
36
|
-
export const widgetFactory = (displayName,
|
|
36
|
+
export const widgetFactory = (displayName, supportedTypes,
|
|
37
|
+
// TODO: Implement a way to pass these from RJST to widgets. Likely by adding a uiSchema property or something
|
|
38
|
+
uiOptions = {}) => {
|
|
37
39
|
return (widgetFn) => {
|
|
38
40
|
const widget = widgetFn;
|
|
39
41
|
Object.assign(widget, {
|
|
@@ -378,7 +378,7 @@ const getColumnsFromSchema = ({ t, schema, idField, isServerSide, customSort, pr
|
|
|
378
378
|
? fieldCustomSort
|
|
379
379
|
: getSortingFunction(key, val), render: (fieldVal, entry) => {
|
|
380
380
|
const calculatedField = rjstAdaptRefScheme(fieldVal, val);
|
|
381
|
-
return (_jsx(Widget, { extraFormats: [...(formats !== null && formats !== void 0 ? formats : []), ...defaultFormats], schema: widgetSchema, value: calculatedField,
|
|
381
|
+
return (_jsx(Widget, { extraFormats: [...(formats !== null && formats !== void 0 ? formats : []), ...defaultFormats], schema: widgetSchema, value: calculatedField, resource: entry }));
|
|
382
382
|
} });
|
|
383
383
|
});
|
|
384
384
|
};
|
|
@@ -8,7 +8,7 @@ export interface AugmentedSshKey extends RJSTBaseResource<AugmentedSshKey> {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const model: RJSTRawModel<AugmentedSshKey>;
|
|
10
10
|
export declare const transformers: {
|
|
11
|
-
__permissions: () => import("../schemaOps").Permissions<AugmentedSshKey
|
|
11
|
+
__permissions: () => import("../schemaOps").Permissions<AugmentedSshKey>;
|
|
12
12
|
};
|
|
13
13
|
export declare const dataExample: {
|
|
14
14
|
id: number;
|
|
@@ -10,6 +10,6 @@ export declare const rjstDefaultPermissions: {
|
|
|
10
10
|
};
|
|
11
11
|
export declare const rjstRunTransformers: <T extends Dictionary<any>, TResult extends T, TContext = null>(data: T | undefined, transformers: Transformers<T, Omit<TResult, keyof T>, TContext>, context?: TContext) => TResult | undefined;
|
|
12
12
|
export declare const rjstGetModelForCollection: <T>(model: RJSTRawModel<T>, context?: {
|
|
13
|
-
accessRole?: string
|
|
13
|
+
accessRole?: string | null;
|
|
14
14
|
}) => RJSTModel<T>;
|
|
15
15
|
export {};
|
|
@@ -38,6 +38,6 @@ export const rjstGetModelForCollection = (model, context) => {
|
|
|
38
38
|
...model.priorities.tertiary,
|
|
39
39
|
])
|
|
40
40
|
: model.schema;
|
|
41
|
-
return Object.assign(Object.assign({}, model), { permissions: (
|
|
42
|
-
|
|
41
|
+
return Object.assign(Object.assign({}, model), { permissions: (accessRole != null && model.permissions[accessRole]) ||
|
|
42
|
+
model.permissions['default'], schema });
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@ import type { CheckedState } from './components/Table/utils';
|
|
|
4
4
|
import type { PineFilterObject } from './oData/jsonToOData';
|
|
5
5
|
export interface RJSTBaseResource<T> {
|
|
6
6
|
id: number;
|
|
7
|
-
__permissions:
|
|
7
|
+
__permissions: Permissions<T>;
|
|
8
8
|
}
|
|
9
9
|
type XHeaderLink = {
|
|
10
10
|
tooltip: string;
|
|
@@ -30,7 +30,7 @@ export interface RJSTRawModel<T> {
|
|
|
30
30
|
export interface RJSTModel<T> {
|
|
31
31
|
resource: string;
|
|
32
32
|
schema: JSONSchema;
|
|
33
|
-
permissions:
|
|
33
|
+
permissions: Permissions<T>;
|
|
34
34
|
priorities?: Priorities<T>;
|
|
35
35
|
}
|
|
36
36
|
export type RJSTEntityPropertyDefinition<T> = {
|
|
@@ -9,6 +9,6 @@ export declare const setToLocalStorage: (key: string, value: unknown) => void;
|
|
|
9
9
|
export declare const findInObject: (obj: Record<string, any>, key: string) => any;
|
|
10
10
|
export declare const ObjectFromEntries: (entries: Array<[string, any]>) => Record<string, any>;
|
|
11
11
|
export declare const getTagsDisabledReason: <T extends RJSTBaseResource<T>>(selected: T[] | undefined, tagField: keyof T, checkedState: CheckedState | undefined, tagsSdk: RJSTTagsSdk<T>, t: TFunction) => Promise<string | null>;
|
|
12
|
-
export declare const getCreateDisabledReason: <T extends RJSTBaseResource<T>>(permissions:
|
|
12
|
+
export declare const getCreateDisabledReason: <T extends RJSTBaseResource<T>>(permissions: Permissions<T>, hasOngoingAction: boolean, t: TFunction) => string | undefined;
|
|
13
13
|
export declare const rjstGetDisabledReason: <T extends RJSTBaseResource<T>>(selected: T[] | undefined, checkedState: CheckedState | undefined, hasOngoingAction: boolean, actionType: "update" | "delete" | null, t: TFunction) => string | undefined;
|
|
14
14
|
export declare const getSortingFunction: <T>(schemaKey: keyof T, schemaValue: JSONSchema) => (a: T, b: T) => number;
|
|
@@ -60,9 +60,9 @@ export const getTagsDisabledReason = async (selected, tagField, checkedState, ta
|
|
|
60
60
|
const lacksPermissionsOnSelected = tagsSdk && 'canAccess' in tagsSdk
|
|
61
61
|
? !(await tagsSdk.canAccess({ checkedState, selected }))
|
|
62
62
|
: selected === null || selected === void 0 ? void 0 : selected.some((entry) => {
|
|
63
|
-
return !entry.__permissions.
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
return (!entry.__permissions.delete &&
|
|
64
|
+
!entry.__permissions.create.includes(tagField) &&
|
|
65
|
+
!entry.__permissions.update.includes(tagField));
|
|
66
66
|
});
|
|
67
67
|
if (lacksPermissionsOnSelected) {
|
|
68
68
|
return t('info.edit_tag_no_permissions', { resource: 'item' });
|
|
@@ -70,11 +70,11 @@ export const getTagsDisabledReason = async (selected, tagField, checkedState, ta
|
|
|
70
70
|
return null;
|
|
71
71
|
};
|
|
72
72
|
export const getCreateDisabledReason = (permissions, hasOngoingAction, t) => {
|
|
73
|
+
var _a;
|
|
73
74
|
if (hasOngoingAction) {
|
|
74
75
|
return t('info.ongoing_action_wait');
|
|
75
76
|
}
|
|
76
|
-
if (!permissions.length
|
|
77
|
-
!permissions.filter((p) => { var _a; return (_a = p.create) === null || _a === void 0 ? void 0 : _a.length; }).length) {
|
|
77
|
+
if (!((_a = permissions.create) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
78
78
|
return t('info.create_item_no_permissions', { resource: 'item' });
|
|
79
79
|
}
|
|
80
80
|
};
|
|
@@ -89,9 +89,9 @@ export const rjstGetDisabledReason = (selected, checkedState, hasOngoingAction,
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
const lacksPermissionsOnSelected = selected.some((entry) => {
|
|
92
|
-
return entry.__permissions
|
|
93
|
-
(Array.isArray(
|
|
94
|
-
|
|
92
|
+
return (!entry.__permissions[actionType] ||
|
|
93
|
+
(Array.isArray(entry.__permissions[actionType]) &&
|
|
94
|
+
entry.__permissions[actionType].length <= 0));
|
|
95
95
|
});
|
|
96
96
|
if (lacksPermissionsOnSelected) {
|
|
97
97
|
return t('info.update_item_no_permissions', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "13.0.0-build-
|
|
3
|
+
"version": "13.0.0-build-rename-and-require-widget-extracontext-37df890fe262ef54dc0d361d32b076c7eeccd84b-1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"ajv": "^8.17.1",
|
|
33
33
|
"ajv-formats": "^3.0.1",
|
|
34
34
|
"ajv-keywords": "^5.1.0",
|
|
35
|
-
"analytics-client": "^3.
|
|
35
|
+
"analytics-client": "^3.1.0",
|
|
36
36
|
"color": "^5.0.0",
|
|
37
37
|
"color-hash": "^2.0.2",
|
|
38
38
|
"date-fns": "^4.1.0",
|
|
@@ -138,6 +138,6 @@
|
|
|
138
138
|
},
|
|
139
139
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
140
140
|
"versionist": {
|
|
141
|
-
"publishedAt": "2025-05-
|
|
141
|
+
"publishedAt": "2025-05-15T18:17:53.484Z"
|
|
142
142
|
}
|
|
143
143
|
}
|