@gooddata/sdk-ui-ext 11.43.0-alpha.2 → 11.43.0-alpha.4
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/NOTICE +4826 -13873
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/internal/components/configurationControls/ConfigSection.d.ts +2 -1
- package/esm/internal/components/configurationControls/ConfigSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/ConfigSection.js +7 -3
- package/esm/internal/components/configurationControls/colors/colorDropdown/ColorDropdown.d.ts +4 -0
- package/esm/internal/components/configurationControls/colors/colorDropdown/ColorDropdown.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/colors/colorDropdown/ColorDropdown.js +13 -2
- package/esm/internal/components/configurationControls/colors/colorDropdown/ColorPalette.d.ts +5 -0
- package/esm/internal/components/configurationControls/colors/colorDropdown/ColorPalette.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/colors/colorDropdown/ColorPalette.js +5 -3
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts +13 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.js +158 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts +12 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.js +54 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingColors.d.ts +14 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingColors.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingColors.js +32 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.d.ts +28 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.js +149 -0
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.d.ts +1 -0
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.d.ts.map +1 -1
- package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.d.ts +1 -0
- package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.d.ts.map +1 -1
- package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.js +9 -1
- package/esm/internal/components/dialogs/userManagementDialogs/AddWorkspaceToSubjects.d.ts +0 -1
- package/esm/internal/components/dialogs/userManagementDialogs/AddWorkspaceToSubjects.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/AddWorkspaceToSubjects.js +3 -3
- package/esm/internal/components/dialogs/userManagementDialogs/UserEditDialog.d.ts +0 -1
- package/esm/internal/components/dialogs/userManagementDialogs/UserEditDialog.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/UserEditDialog.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/UserGroupEditDialog.d.ts +0 -1
- package/esm/internal/components/dialogs/userManagementDialogs/UserGroupEditDialog.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/UserGroupEditDialog.js +3 -3
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddWorkspace.d.ts +1 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddWorkspace.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddWorkspace.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/GranularPermissions.d.ts +1 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/GranularPermissions.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/GranularPermissions.js +3 -3
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/PermissionsDropdown.d.ts +0 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/PermissionsDropdown.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/PermissionsDropdown.js +3 -5
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/WorkspaceItem.d.ts +1 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/WorkspaceItem.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/WorkspaceItem.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceList.d.ts +0 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceList.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts +3 -0
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.js +33 -5
- package/esm/internal/constants/supportedProperties.d.ts.map +1 -1
- package/esm/internal/constants/supportedProperties.js +1 -0
- package/esm/internal/translations/de-DE.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/de-DE.localization-bundle.js +12 -1
- package/esm/internal/translations/en-AU.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-AU.localization-bundle.js +12 -1
- package/esm/internal/translations/en-GB.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-GB.localization-bundle.js +12 -1
- package/esm/internal/translations/en-US.localization-bundle.d.ts +168 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-US.localization-bundle.js +168 -0
- package/esm/internal/translations/es-419.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/es-419.localization-bundle.js +12 -1
- package/esm/internal/translations/es-ES.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/es-ES.localization-bundle.js +12 -1
- package/esm/internal/translations/fi-FI.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/fi-FI.localization-bundle.js +12 -1
- package/esm/internal/translations/fr-CA.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/fr-CA.localization-bundle.js +12 -1
- package/esm/internal/translations/fr-FR.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/fr-FR.localization-bundle.js +12 -1
- package/esm/internal/translations/id-ID.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/id-ID.localization-bundle.js +12 -1
- package/esm/internal/translations/it-IT.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/it-IT.localization-bundle.js +12 -1
- package/esm/internal/translations/ja-JP.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/ja-JP.localization-bundle.js +12 -1
- package/esm/internal/translations/ko-KR.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/ko-KR.localization-bundle.js +12 -1
- package/esm/internal/translations/nl-NL.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/nl-NL.localization-bundle.js +12 -1
- package/esm/internal/translations/pl-PL.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/pl-PL.localization-bundle.js +12 -1
- package/esm/internal/translations/pt-BR.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/pt-BR.localization-bundle.js +12 -1
- package/esm/internal/translations/pt-PT.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/pt-PT.localization-bundle.js +12 -1
- package/esm/internal/translations/ru-RU.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/ru-RU.localization-bundle.js +12 -1
- package/esm/internal/translations/sl-SI.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/sl-SI.localization-bundle.js +12 -1
- package/esm/internal/translations/th-TH.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/th-TH.localization-bundle.js +12 -1
- package/esm/internal/translations/tr-TR.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/tr-TR.localization-bundle.js +12 -1
- package/esm/internal/translations/uk-UA.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/uk-UA.localization-bundle.js +12 -1
- package/esm/internal/translations/vi-VN.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/vi-VN.localization-bundle.js +12 -1
- package/esm/internal/translations/zh-HK.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/zh-HK.localization-bundle.js +12 -1
- package/esm/internal/translations/zh-Hans.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/zh-Hans.localization-bundle.js +12 -1
- package/esm/internal/translations/zh-Hant.localization-bundle.d.ts +11 -0
- package/esm/internal/translations/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/zh-Hant.localization-bundle.js +12 -1
- package/esm/internal/utils/propertiesHelper.d.ts +2 -1
- package/esm/internal/utils/propertiesHelper.d.ts.map +1 -1
- package/esm/internal/utils/propertiesHelper.js +3 -0
- package/esm/locales.d.ts +79 -0
- package/esm/locales.d.ts.map +1 -1
- package/esm/locales.js +46 -0
- package/esm/sdk-ui-ext.d.ts +24 -10
- package/esm/share/ObjectShareDialog.js +2 -2
- package/esm/share/objectShareController.helpers.d.ts +0 -26
- package/esm/share/objectShareController.helpers.d.ts.map +1 -1
- package/esm/share/objectShareController.helpers.js +2 -38
- package/esm/share/objectShareController.types.d.ts +39 -0
- package/esm/share/objectShareController.types.d.ts.map +1 -1
- package/esm/share/useAccessList.d.ts +31 -18
- package/esm/share/useAccessList.d.ts.map +1 -1
- package/esm/share/useAccessList.js +85 -133
- package/esm/share/useLabelScope.d.ts +6 -8
- package/esm/share/useLabelScope.d.ts.map +1 -1
- package/esm/share/useLabelScope.js +34 -28
- package/esm/share/useObjectShareController.d.ts +19 -16
- package/esm/share/useObjectShareController.d.ts.map +1 -1
- package/esm/share/useObjectShareController.js +212 -119
- package/package.json +21 -21
- package/styles/css/main.css +238 -0
- package/styles/css/main.css.map +1 -1
- package/styles/internal/css/conditional_formatting.css +239 -0
- package/styles/internal/css/conditional_formatting.css.map +1 -0
- package/styles/internal/css/config_panel.css +5 -0
- package/styles/internal/css/config_panel.css.map +1 -1
- package/styles/internal/scss/conditional_formatting.scss +269 -0
- package/styles/internal/scss/config_panel.scss +11 -0
- package/styles/scss/main.scss +1 -0
- package/esm/share/useObjectShare.d.ts +0 -50
- package/esm/share/useObjectShare.d.ts.map +0 -1
- package/esm/share/useObjectShare.js +0 -17
package/esm/sdk-ui-ext.d.ts
CHANGED
|
@@ -453,7 +453,6 @@ export declare interface IAddWorkspaceToSubjectsProps extends IWithTelemetryProp
|
|
|
453
453
|
organizationId: string;
|
|
454
454
|
onSuccess: () => void;
|
|
455
455
|
onClose: () => void;
|
|
456
|
-
areFilterViewsEnabled?: boolean;
|
|
457
456
|
}
|
|
458
457
|
|
|
459
458
|
/**
|
|
@@ -1577,6 +1576,12 @@ export declare interface IObjectShareGrantee {
|
|
|
1577
1576
|
* the row's "effective permission" warning badge.
|
|
1578
1577
|
*/
|
|
1579
1578
|
effectivePermission?: ObjectSharePermissionLevel;
|
|
1579
|
+
/**
|
|
1580
|
+
* Whether the grantee inherits SHARE (e.g. via a group), regardless of the
|
|
1581
|
+
* current direct `level`. Retained from the fetch so `effectivePermission` can
|
|
1582
|
+
* be recomputed locally when the direct level changes (no refetch).
|
|
1583
|
+
*/
|
|
1584
|
+
inheritsShare?: boolean;
|
|
1580
1585
|
/**
|
|
1581
1586
|
* Row-level in-flight state for optimistic updates: `"saving"` while a level
|
|
1582
1587
|
* change or freshly-added grant is being committed, `"removing"` while a
|
|
@@ -1806,7 +1811,6 @@ export declare interface IUserEditDialogProps extends IWithTelemetryProps {
|
|
|
1806
1811
|
onSuccess: () => void;
|
|
1807
1812
|
onClose: () => void;
|
|
1808
1813
|
renderDataSourceIcon?: (dataSource: IGrantedDataSource) => ReactElement;
|
|
1809
|
-
areFilterViewsEnabled?: boolean;
|
|
1810
1814
|
isSystemAccountFilteringEnabled?: boolean;
|
|
1811
1815
|
selectedTab?: UserTabId;
|
|
1812
1816
|
}
|
|
@@ -1822,7 +1826,6 @@ export declare interface IUserGroupEditDialogProps extends IWithTelemetryProps {
|
|
|
1822
1826
|
onSuccess: () => void;
|
|
1823
1827
|
onClose: () => void;
|
|
1824
1828
|
renderDataSourceIcon?: (dataSource: IGrantedDataSource) => ReactElement;
|
|
1825
|
-
areFilterViewsEnabled?: boolean;
|
|
1826
1829
|
}
|
|
1827
1830
|
|
|
1828
1831
|
/**
|
|
@@ -2028,14 +2031,25 @@ export declare function useInsightPickerState(author?: string): {
|
|
|
2028
2031
|
};
|
|
2029
2032
|
|
|
2030
2033
|
/**
|
|
2031
|
-
*
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2034
|
-
*
|
|
2035
|
-
*
|
|
2034
|
+
* Manages the share dialog state and backend I/O for a single shareable object.
|
|
2035
|
+
*
|
|
2036
|
+
* The access list is fetched once and seeded into local state, which is the
|
|
2037
|
+
* source of truth while the dialog/summary is mounted. Each access change is
|
|
2038
|
+
* written through to local state immediately and sent to the backend; on failure
|
|
2039
|
+
* the one changed entry is rolled back. There is no post-write refetch, so the
|
|
2040
|
+
* grantee list never blanks and never fights the backend's read-after-write lag.
|
|
2041
|
+
* Top-level open/close is the consumer's concern (see {@link ObjectShareDialog}).
|
|
2042
|
+
*
|
|
2043
|
+
* Mutations follow a **commit-on-interaction** model: each access change is sent
|
|
2044
|
+
* immediately; the general-access toggle goes through a confirm step because it
|
|
2045
|
+
* is high-impact. There is no batched Save. The list is fetched eagerly so
|
|
2046
|
+
* `state.summary` also drives an inline access row while closed.
|
|
2036
2047
|
*
|
|
2037
|
-
*
|
|
2038
|
-
*
|
|
2048
|
+
* Most consumers do not call this directly — render {@link ObjectShareDialog} with
|
|
2049
|
+
* plain props and it owns its controller. Call this (exported as `useObjectShare`)
|
|
2050
|
+
* only to share a single access-list fetch between the dialog and an inline summary
|
|
2051
|
+
* row: call it once, read `state.summary` for the row, and pass the controller into
|
|
2052
|
+
* the dialog.
|
|
2039
2053
|
*
|
|
2040
2054
|
* @internal
|
|
2041
2055
|
*/
|
|
@@ -4,7 +4,7 @@ import { useCallback } from "react";
|
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { UiAddGranteeDialog, UiConfirmDialog, UiGranteeRowControls, UiObjectShareDialog, } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { objectShareMessages } from "./messages.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useObjectShareController } from "./useObjectShareController.js";
|
|
8
8
|
/**
|
|
9
9
|
* Connected share dialog. Renders the main share modal, the add-grantee
|
|
10
10
|
* sub-dialog and the general-access confirm dialog, all driven by one
|
|
@@ -28,7 +28,7 @@ export function ObjectShareDialog({ target, objectTitle, isOpen, onClose, onSave
|
|
|
28
28
|
// unconditionally (rules of hooks), so when a controller is injected we pass
|
|
29
29
|
// it an undefined target — it then no-ops and never duplicates the fetch the
|
|
30
30
|
// injected controller already owns.
|
|
31
|
-
const ownController =
|
|
31
|
+
const ownController = useObjectShareController(controller ? undefined : target, {
|
|
32
32
|
onSaved,
|
|
33
33
|
labels,
|
|
34
34
|
labelsError,
|
|
@@ -15,32 +15,6 @@ export declare function directLevel(permissions: readonly string[]): ObjectShare
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function effectivePermissionAbove(direct: ObjectSharePermissionLevel, inheritedPermissions: readonly string[]): ObjectSharePermissionLevel | undefined;
|
|
17
17
|
export declare function granteesFromAccessList(list: IObjectAccessList | undefined): IObjectShareGrantee[];
|
|
18
|
-
/**
|
|
19
|
-
* Optimistic overlay entry for a single grantee id. `"set"` carries the intended
|
|
20
|
-
* row (a fresh add or a level change); `"remove"` marks a removal. `pending` is
|
|
21
|
-
* true while the backend write is in flight.
|
|
22
|
-
*/
|
|
23
|
-
export type IGranteeOverlayEntry = {
|
|
24
|
-
op: "set";
|
|
25
|
-
grantee: IObjectShareGrantee;
|
|
26
|
-
pending: boolean;
|
|
27
|
-
} | {
|
|
28
|
-
op: "remove";
|
|
29
|
-
pending: boolean;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Merge the committed rows with the optimistic overlay: `set` replaces/inserts a
|
|
33
|
-
* row (annotated pending), `remove` drops it. Entries with no committed effect
|
|
34
|
-
* still apply so the UI reflects the user's intent during read-after-write lag.
|
|
35
|
-
*/
|
|
36
|
-
export declare function mergeOverlay(committed: IObjectShareGrantee[], overlay: Record<string, IGranteeOverlayEntry>): IObjectShareGrantee[];
|
|
37
|
-
/**
|
|
38
|
-
* Drop overlay entries the freshly-fetched list now confirms: a `set` whose
|
|
39
|
-
* committed level matches the intended level, or a `remove` whose grantee is
|
|
40
|
-
* gone. Unconfirmed entries are kept (server still lagging) but lose `pending`
|
|
41
|
-
* so the row shows the intended value without a spinner.
|
|
42
|
-
*/
|
|
43
|
-
export declare function reconcileOverlay(committed: IObjectShareGrantee[], overlay: Record<string, IGranteeOverlayEntry>): Record<string, IGranteeOverlayEntry>;
|
|
44
18
|
export declare function toGranularGrantee(kind: "user" | "group", granteeRef: ObjRef, level: ObjectSharePermissionLevel | "none"): IGranularAccessGrantee;
|
|
45
19
|
/**
|
|
46
20
|
* The principal a label-scope reconcile applies to: a named user/group, or the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectShareController.helpers.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAM9F;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,0BAA0B,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,0BAA0B,EAClC,oBAAoB,EAAE,SAAS,MAAM,EAAE,GACxC,0BAA0B,GAAG,SAAS,CAExC;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"objectShareController.helpers.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAM9F;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,0BAA0B,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,0BAA0B,EAClC,oBAAoB,EAAE,SAAS,MAAM,EAAE,GACxC,0BAA0B,GAAG,SAAS,CAExC;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAgCjG;AAED,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,MAAM,GAAG,OAAO,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,0BAA0B,GAAG,MAAM,GAC3C,sBAAsB,CAMxB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,iBAAiB,EAAE,IAAI,CAAA;CAAE,CAAC;AAElC,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,0BAA0B,GAAG,MAAM,0BAO7C;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,mBAAmB,EAC9B,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,iBAAiB,EAAE,GAC5B,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,sBAAsB,CAAA;CAAE,CAAC,CAWzD;AAED,sFAAsF;AACtF,eAAO,MAAM,SAAS,EAAE,iBAAiB,EAAO,CAAC;AAEjD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,CAAqB,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAU/E"}
|
|
@@ -41,6 +41,7 @@ export function granteesFromAccessList(list) {
|
|
|
41
41
|
email: g.user.email,
|
|
42
42
|
level,
|
|
43
43
|
effectivePermission: effectivePermissionAbove(level, g.inheritedPermissions),
|
|
44
|
+
inheritsShare: g.inheritedPermissions.includes("SHARE"),
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
else if (isGranularUserGroupAccess(g)) {
|
|
@@ -52,49 +53,12 @@ export function granteesFromAccessList(list) {
|
|
|
52
53
|
name: g.userGroup.name ?? objRefToString(g.userGroup.ref),
|
|
53
54
|
level,
|
|
54
55
|
effectivePermission: effectivePermissionAbove(level, g.inheritedPermissions),
|
|
56
|
+
inheritsShare: g.inheritedPermissions.includes("SHARE"),
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
return out;
|
|
59
61
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Merge the committed rows with the optimistic overlay: `set` replaces/inserts a
|
|
62
|
-
* row (annotated pending), `remove` drops it. Entries with no committed effect
|
|
63
|
-
* still apply so the UI reflects the user's intent during read-after-write lag.
|
|
64
|
-
*/
|
|
65
|
-
export function mergeOverlay(committed, overlay) {
|
|
66
|
-
const byId = new Map(committed.map((g) => [g.id, g]));
|
|
67
|
-
for (const [id, entry] of Object.entries(overlay)) {
|
|
68
|
-
if (entry.op === "remove") {
|
|
69
|
-
byId.delete(id);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
byId.set(id, { ...entry.grantee, pending: entry.pending ? "saving" : undefined });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return [...byId.values()];
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Drop overlay entries the freshly-fetched list now confirms: a `set` whose
|
|
79
|
-
* committed level matches the intended level, or a `remove` whose grantee is
|
|
80
|
-
* gone. Unconfirmed entries are kept (server still lagging) but lose `pending`
|
|
81
|
-
* so the row shows the intended value without a spinner.
|
|
82
|
-
*/
|
|
83
|
-
export function reconcileOverlay(committed, overlay) {
|
|
84
|
-
const byId = new Map(committed.map((g) => [g.id, g]));
|
|
85
|
-
const next = {};
|
|
86
|
-
for (const [id, entry] of Object.entries(overlay)) {
|
|
87
|
-
if (entry.op === "remove") {
|
|
88
|
-
if (byId.has(id)) {
|
|
89
|
-
next[id] = { op: "remove", pending: false };
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else if (byId.get(id)?.level !== entry.grantee.level) {
|
|
93
|
-
next[id] = { op: "set", grantee: entry.grantee, pending: false };
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return next;
|
|
97
|
-
}
|
|
98
62
|
export function toGranularGrantee(kind, granteeRef, level) {
|
|
99
63
|
const permissions = level === "none" ? [] : level === "SHARE" ? ["SHARE", "VIEW"] : ["VIEW"];
|
|
100
64
|
return kind === "user"
|
|
@@ -28,6 +28,12 @@ export interface IObjectShareGrantee {
|
|
|
28
28
|
* the row's "effective permission" warning badge.
|
|
29
29
|
*/
|
|
30
30
|
effectivePermission?: ObjectSharePermissionLevel;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the grantee inherits SHARE (e.g. via a group), regardless of the
|
|
33
|
+
* current direct `level`. Retained from the fetch so `effectivePermission` can
|
|
34
|
+
* be recomputed locally when the direct level changes (no refetch).
|
|
35
|
+
*/
|
|
36
|
+
inheritsShare?: boolean;
|
|
31
37
|
/**
|
|
32
38
|
* Row-level in-flight state for optimistic updates: `"saving"` while a level
|
|
33
39
|
* change or freshly-added grant is being committed, `"removing"` while a
|
|
@@ -107,4 +113,37 @@ export interface IObjectShareController {
|
|
|
107
113
|
state: IObjectShareControllerState;
|
|
108
114
|
actions: IObjectShareControllerActions;
|
|
109
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Options for {@link useObjectShare}.
|
|
118
|
+
*
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
121
|
+
export interface IUseObjectShareOptions {
|
|
122
|
+
/**
|
|
123
|
+
* Fires after each successful access mutation (add grantee, change level,
|
|
124
|
+
* remove, general access toggle). Use it to keep UI outside the dialog in
|
|
125
|
+
* sync with edits made inside it (e.g. refresh an inline access row).
|
|
126
|
+
*/
|
|
127
|
+
onSaved?: () => void;
|
|
128
|
+
/**
|
|
129
|
+
* Labels (display forms) of the shared attribute, enabling the per-grantee
|
|
130
|
+
* label-scope picker. Omit for objects without labels (e.g. facts).
|
|
131
|
+
*/
|
|
132
|
+
labels?: IObjectShareLabel[];
|
|
133
|
+
/**
|
|
134
|
+
* Whether loading the object's labels failed. While true the controller stays
|
|
135
|
+
* label-unresolved so every access-changing control is disabled: with the
|
|
136
|
+
* label set unknown, reconciling access would diff against an empty set and
|
|
137
|
+
* silently orphan any real per-label grants. Distinct from an object that
|
|
138
|
+
* genuinely has no labels (omit `labels`), where editing is safe.
|
|
139
|
+
*/
|
|
140
|
+
labelsError?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the object's labels are still loading. While true the controller stays
|
|
143
|
+
* label-unresolved (same gating as `labelsError`): the labels aren't passed yet,
|
|
144
|
+
* so an empty list must not be mistaken for a label-free object — otherwise row
|
|
145
|
+
* controls would reconcile against an empty set and orphan real per-label grants.
|
|
146
|
+
*/
|
|
147
|
+
labelsLoading?: boolean;
|
|
148
|
+
}
|
|
110
149
|
//# sourceMappingURL=objectShareController.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,0BAA0B,CAAC;IAClC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CACnC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pD;;;OAGG;IACH,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtF,+DAA+D;IAC/D,0BAA0B,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/D,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,4DAA4D;IAC5D,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,2BAA2B,CAAC;IACnC,OAAO,EAAE,6BAA6B,CAAC;CAC1C"}
|
|
1
|
+
{"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,0BAA0B,CAAC;IAClC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,UAA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AAC,CAAC;IACpD;;;OAGG;IACH,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtF,+DAA+D;IAC/D,0BAA0B,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/D,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,4DAA4D;IAC5D,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,2BAA2B,CAAC;IACnC,OAAO,EAAE,6BAA6B,CAAC;CAC1C;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import type { IObjectPermissionsObject } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type IGranularAccessGrantee, type
|
|
2
|
+
import { type IGranularAccessGrantee, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
import { type GeneralAccessValue, type IUiGranteeAsyncOptions } from "@gooddata/sdk-ui-kit";
|
|
4
|
-
import { type IGranteeOverlayEntry } from "./objectShareController.helpers.js";
|
|
5
4
|
import type { IObjectShareControllerState, IObjectShareGrantee } from "./objectShareController.types.js";
|
|
6
5
|
import type { IObjectAccessSummary } from "./types.js";
|
|
7
6
|
/**
|
|
8
|
-
* The owned access list
|
|
7
|
+
* The owned access list for {@link useObjectShareController}.
|
|
9
8
|
*
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
11
|
export interface IAccessList {
|
|
13
12
|
/** Stable serialized key of the current target's ref, or undefined when none. */
|
|
14
13
|
targetKey: string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
14
|
+
/** True once the current target's list has been fetched and seeded into local state. */
|
|
15
|
+
hasList: boolean;
|
|
16
|
+
/** Local grantee rows — seeded from the fetch, then authoritative; mutations write through. */
|
|
18
17
|
grantees: IObjectShareGrantee[];
|
|
19
|
-
/**
|
|
20
|
-
granteeIdsKey: string;
|
|
21
|
-
/** Optimistic-aware general access (workspace vs restricted). */
|
|
18
|
+
/** Workspace vs restricted general access — local state; mutations write through. */
|
|
22
19
|
generalAccess: GeneralAccessValue;
|
|
23
|
-
/**
|
|
20
|
+
/** Workspace-rule permission level (VIEW/SHARE) — local state; mutations write through. */
|
|
21
|
+
workspaceLevel: "VIEW" | "SHARE";
|
|
22
|
+
/** Inline access summary, or undefined before the first load. */
|
|
24
23
|
summary: IObjectAccessSummary | undefined;
|
|
25
24
|
/** Top-level load status surfaced as the controller status. */
|
|
26
25
|
status: IObjectShareControllerState["status"];
|
|
27
26
|
/** Error from the initial/target-change load. */
|
|
28
27
|
loadError: Error | undefined;
|
|
29
|
-
/**
|
|
28
|
+
/** Write a grant change to the backend and toast. False on failure; no refetch. */
|
|
30
29
|
commit: (mutate: IGranularAccessGrantee[], successMessage: {
|
|
31
30
|
id: string;
|
|
32
31
|
}) => Promise<boolean>;
|
|
@@ -34,16 +33,30 @@ export interface IAccessList {
|
|
|
34
33
|
loadOptions: (search: string) => Promise<IUiGranteeAsyncOptions>;
|
|
35
34
|
/** Resolve a grantee id back to the picker's original ObjRef (preserves Uri vs Id ref). */
|
|
36
35
|
refForId: (id: string) => ObjRef;
|
|
37
|
-
|
|
36
|
+
/** Write through a local grantee-row change (insert / level / remove); rolled back by the caller. */
|
|
37
|
+
setGrantees: React.Dispatch<React.SetStateAction<IObjectShareGrantee[]>>;
|
|
38
|
+
/** Write through a local general-access change; rolled back by the caller. */
|
|
39
|
+
setGeneralAccess: React.Dispatch<React.SetStateAction<GeneralAccessValue>>;
|
|
40
|
+
/**
|
|
41
|
+
* Write through the local workspace-rule permission level. A general-access write
|
|
42
|
+
* always grants workspace VIEW, so the caller sets this to keep the summary from
|
|
43
|
+
* showing a stale SHARE inherited from the initial fetch.
|
|
44
|
+
*/
|
|
45
|
+
setWorkspaceLevel: React.Dispatch<React.SetStateAction<"VIEW" | "SHARE">>;
|
|
38
46
|
setKnownNames: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
39
|
-
setOptimisticGeneralAccess: React.Dispatch<React.SetStateAction<GeneralAccessValue | undefined>>;
|
|
40
47
|
}
|
|
41
48
|
/**
|
|
42
|
-
* Owns the backend access list
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
49
|
+
* Owns the backend access list. It is fetched once (per target) then seeded into
|
|
50
|
+
* local state, which is authoritative while the dialog/summary is mounted:
|
|
51
|
+
* mutations write through to it directly and roll back the one changed entry on
|
|
52
|
+
* failure. There is no post-write refetch, so the grantee list never blanks and
|
|
53
|
+
* never fights the backend's read-after-write lag. A target switch re-seeds from
|
|
54
|
+
* the new fetch; the seed is gated on a per-target stamp so a late fetch for a
|
|
55
|
+
* previous target can't clobber the current one.
|
|
56
|
+
*
|
|
57
|
+
* Effective (inherited) permissions and display names come from that single
|
|
58
|
+
* fetch: inherited access doesn't change as a result of editing a direct grant,
|
|
59
|
+
* so the badge stays correct for the session without re-reading.
|
|
47
60
|
*
|
|
48
61
|
* @internal
|
|
49
62
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccessList.d.ts","sourceRoot":"","sources":["../../src/share/useAccessList.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"useAccessList.d.ts","sourceRoot":"","sources":["../../src/share/useAccessList.ts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