@gooddata/sdk-ui-ext 11.47.0-alpha.4 → 11.47.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.
- package/NOTICE +18 -18
- package/esm/internal/components/BaseVisualization.d.ts +4 -0
- package/esm/internal/components/BaseVisualization.d.ts.map +1 -1
- package/esm/internal/components/BaseVisualization.js +1 -0
- package/esm/internal/components/pluggableVisualizations/baseChart/PluggableBaseChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/baseChart/PluggableBaseChart.js +2 -2
- package/esm/internal/interfaces/Visualization.d.ts +4 -0
- package/esm/internal/interfaces/Visualization.d.ts.map +1 -1
- package/esm/internal/translations/de-DE.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/de-DE.localization-bundle.js +2 -0
- package/esm/internal/translations/en-AU.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-AU.localization-bundle.js +2 -0
- package/esm/internal/translations/en-GB.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-GB.localization-bundle.js +2 -0
- package/esm/internal/translations/es-419.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/es-419.localization-bundle.js +2 -0
- package/esm/internal/translations/es-ES.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/es-ES.localization-bundle.js +2 -0
- package/esm/internal/translations/fi-FI.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/fi-FI.localization-bundle.js +2 -0
- package/esm/internal/translations/fr-CA.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/fr-CA.localization-bundle.js +2 -0
- package/esm/internal/translations/fr-FR.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/fr-FR.localization-bundle.js +2 -0
- package/esm/internal/translations/id-ID.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/id-ID.localization-bundle.js +2 -0
- package/esm/internal/translations/it-IT.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/it-IT.localization-bundle.js +2 -0
- package/esm/internal/translations/ja-JP.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/ja-JP.localization-bundle.js +2 -0
- package/esm/internal/translations/ko-KR.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/ko-KR.localization-bundle.js +2 -0
- package/esm/internal/translations/nl-NL.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/nl-NL.localization-bundle.js +2 -0
- package/esm/internal/translations/pl-PL.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/pl-PL.localization-bundle.js +2 -0
- package/esm/internal/translations/pt-BR.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/pt-BR.localization-bundle.js +2 -0
- package/esm/internal/translations/pt-PT.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/pt-PT.localization-bundle.js +2 -0
- package/esm/internal/translations/ru-RU.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/ru-RU.localization-bundle.js +2 -0
- package/esm/internal/translations/sl-SI.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/sl-SI.localization-bundle.js +2 -0
- package/esm/internal/translations/th-TH.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/th-TH.localization-bundle.js +2 -0
- package/esm/internal/translations/tr-TR.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/tr-TR.localization-bundle.js +2 -0
- package/esm/internal/translations/uk-UA.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/uk-UA.localization-bundle.js +2 -0
- package/esm/internal/translations/vi-VN.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/vi-VN.localization-bundle.js +2 -0
- package/esm/internal/translations/zh-HK.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/zh-HK.localization-bundle.js +2 -0
- package/esm/internal/translations/zh-Hans.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/zh-Hans.localization-bundle.js +2 -0
- package/esm/internal/translations/zh-Hant.localization-bundle.d.ts +2 -0
- package/esm/internal/translations/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/zh-Hant.localization-bundle.js +2 -0
- package/esm/internal/utils/translations.d.ts.map +1 -1
- package/esm/internal/utils/translations.js +12 -4
- package/esm/sdk-ui-ext.d.ts +14 -0
- package/esm/share/ObjectShareDialog.d.ts.map +1 -1
- package/esm/share/ObjectShareDialog.js +7 -2
- package/esm/share/accessSummary.d.ts +31 -9
- package/esm/share/accessSummary.d.ts.map +1 -1
- package/esm/share/accessSummary.js +45 -14
- package/esm/share/objectShareController.types.d.ts +14 -0
- package/esm/share/objectShareController.types.d.ts.map +1 -1
- package/esm/share/useAccessList.d.ts +13 -1
- package/esm/share/useAccessList.d.ts.map +1 -1
- package/esm/share/useAccessList.js +8 -4
- package/esm/share/useObjectShareController.d.ts.map +1 -1
- package/esm/share/useObjectShareController.js +38 -11
- package/package.json +21 -21
|
@@ -114,6 +114,9 @@ export function ObjectShareDialog({ target, objectTitle, isOpen, onClose, onSave
|
|
|
114
114
|
// users who can't transfer (e.g. View&Share).
|
|
115
115
|
onTransferOwnership: state.canTransferOwnership ? actions.openTransferOwnership : undefined })),
|
|
116
116
|
})), onAddClick: actions.openAddGrantee, isAddDisabled: isAddDisabled, generalAccess: state.generalAccess, onGeneralAccessChange: actions.requestGeneralAccessChange,
|
|
117
|
+
// Inherited workspace access can't be revoked here — the kit disables
|
|
118
|
+
// the Restricted option and explains why.
|
|
119
|
+
workspaceAccessInherited: state.workspaceAccessInherited,
|
|
117
120
|
// Permission dropdown on the "All workspace members" row — only while
|
|
118
121
|
// workspace access is on (the rule must exist to be re-graded). No
|
|
119
122
|
// labels (⋯) menu and no remove: per the Figma spec the workspace row
|
|
@@ -121,8 +124,10 @@ export function ObjectShareDialog({ target, objectTitle, isOpen, onClose, onSave
|
|
|
121
124
|
// scope is managed implicitly with the RESTRICTED↔WORKSPACE toggle.
|
|
122
125
|
workspaceControls: state.generalAccess === "WORKSPACE" ? (_jsx(UiGranteeRowControls, { labels: [], selectedLabelIds: [], permissionLevel: state.workspaceLevel,
|
|
123
126
|
// Also disabled while its own re-grade is committing, so
|
|
124
|
-
// rapid toggles can't queue overlapping writes
|
|
125
|
-
|
|
127
|
+
// rapid toggles can't queue overlapping writes — and when
|
|
128
|
+
// the level is locked (inherited-only access has no direct
|
|
129
|
+
// rule to re-grade; an inherited SHARE pins the level).
|
|
130
|
+
isDisabled: !isMutable || state.workspaceLevelSaving || state.workspaceLevelLocked, onLabelsChange: noop, onPermissionChange: (level) => {
|
|
126
131
|
void actions.changeWorkspaceLevel(level);
|
|
127
132
|
} })) : undefined,
|
|
128
133
|
// Keep the "All workspace members" description in sync with the picked
|
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import type { AccessGranteeDetail, IGranularRulesAccess } from "@gooddata/sdk-model";
|
|
2
2
|
import type { GeneralAccessValue } from "@gooddata/sdk-ui-kit";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* All `allWorkspaceUsers` rule grants. With workspace hierarchy the backend
|
|
5
|
+
* returns one entry per granting workspace — this workspace's own grant carries
|
|
6
|
+
* direct `permissions` while a parent's carries `inheritedPermissions`, in
|
|
7
|
+
* unspecified order. Callers must aggregate across entries, never inspect just
|
|
8
|
+
* the first.
|
|
9
|
+
*/
|
|
10
|
+
export declare function findAllWorkspaceUsersGrants(grants: AccessGranteeDetail[]): IGranularRulesAccess[];
|
|
11
|
+
/**
|
|
12
|
+
* Whether THIS workspace grants access to all workspace users — some rule entry
|
|
13
|
+
* with non-empty direct `permissions`. Inherited (parent-workspace) rule access
|
|
14
|
+
* is deliberately excluded: this value backs the mutable direct state; displays
|
|
15
|
+
* compose it with {@link deriveInheritedWorkspaceLevel}.
|
|
7
16
|
*/
|
|
8
|
-
export declare function findAllWorkspaceUsersGrant(grants: AccessGranteeDetail[]): IGranularRulesAccess | undefined;
|
|
9
17
|
export declare function deriveGeneralAccess(grants: AccessGranteeDetail[]): GeneralAccessValue;
|
|
10
18
|
/**
|
|
11
|
-
* Workspace-wide permission level
|
|
12
|
-
* VIEW; promoted to SHARE only when
|
|
13
|
-
* is intentionally not surfaced — the UI caps at VIEW/SHARE.
|
|
19
|
+
* Workspace-wide permission level of this workspace's own rule grant. Defaults
|
|
20
|
+
* to VIEW; promoted to SHARE only when some rule entry directly permits SHARE.
|
|
21
|
+
* EDIT is intentionally not surfaced — the UI caps at VIEW/SHARE.
|
|
14
22
|
*/
|
|
15
23
|
export declare function deriveWorkspacePermissionLevel(grants: AccessGranteeDetail[]): "VIEW" | "SHARE";
|
|
16
24
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
25
|
+
* Strongest workspace-wide level inherited from parent workspaces, or undefined
|
|
26
|
+
* when none is inherited. Inherited rule access grants every user of this
|
|
27
|
+
* workspace access too (workspace membership cascades down the hierarchy), yet
|
|
28
|
+
* cannot be revoked from here — consumers must surface it as workspace access
|
|
29
|
+
* and disable the Restricted option.
|
|
30
|
+
*/
|
|
31
|
+
export declare function deriveInheritedWorkspaceLevel(grants: AccessGranteeDetail[]): "VIEW" | "SHARE" | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The effective (displayed) workspace access: the direct state composed with
|
|
34
|
+
* inherited rule access. Inherited access makes general access WORKSPACE even
|
|
35
|
+
* when this workspace holds no rule of its own, and the level is the strongest
|
|
36
|
+
* of the two.
|
|
19
37
|
*/
|
|
38
|
+
export declare function composeEffectiveWorkspaceAccess(direct: GeneralAccessValue, directLevel: "VIEW" | "SHARE", inheritedLevel: "VIEW" | "SHARE" | undefined): {
|
|
39
|
+
generalAccess: GeneralAccessValue;
|
|
40
|
+
workspaceLevel: "VIEW" | "SHARE";
|
|
41
|
+
};
|
|
20
42
|
//# sourceMappingURL=accessSummary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessSummary.d.ts","sourceRoot":"","sources":["../../src/share/accessSummary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"accessSummary.d.ts","sourceRoot":"","sources":["../../src/share/accessSummary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,oBAAoB,EAAE,CAEjG;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,kBAAkB,CAIrF;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,GAAG,OAAO,CAI9F;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAMzG;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC3C,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,GAAG,OAAO,EAC7B,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAC7C;IAAE,aAAa,EAAE,kBAAkB,CAAC;IAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAKzE"}
|
|
@@ -1,26 +1,57 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* All `allWorkspaceUsers` rule grants. With workspace hierarchy the backend
|
|
4
|
+
* returns one entry per granting workspace — this workspace's own grant carries
|
|
5
|
+
* direct `permissions` while a parent's carries `inheritedPermissions`, in
|
|
6
|
+
* unspecified order. Callers must aggregate across entries, never inspect just
|
|
7
|
+
* the first.
|
|
6
8
|
*/
|
|
7
|
-
export function
|
|
8
|
-
return grants.
|
|
9
|
+
export function findAllWorkspaceUsersGrants(grants) {
|
|
10
|
+
return grants.filter((g) => g.type === "allWorkspaceUsers");
|
|
9
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Whether THIS workspace grants access to all workspace users — some rule entry
|
|
14
|
+
* with non-empty direct `permissions`. Inherited (parent-workspace) rule access
|
|
15
|
+
* is deliberately excluded: this value backs the mutable direct state; displays
|
|
16
|
+
* compose it with {@link deriveInheritedWorkspaceLevel}.
|
|
17
|
+
*/
|
|
10
18
|
export function deriveGeneralAccess(grants) {
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
return findAllWorkspaceUsersGrants(grants).some((rule) => rule.permissions.length > 0)
|
|
20
|
+
? "WORKSPACE"
|
|
21
|
+
: "RESTRICTED";
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
|
-
* Workspace-wide permission level
|
|
16
|
-
* VIEW; promoted to SHARE only when
|
|
17
|
-
* is intentionally not surfaced — the UI caps at VIEW/SHARE.
|
|
24
|
+
* Workspace-wide permission level of this workspace's own rule grant. Defaults
|
|
25
|
+
* to VIEW; promoted to SHARE only when some rule entry directly permits SHARE.
|
|
26
|
+
* EDIT is intentionally not surfaced — the UI caps at VIEW/SHARE.
|
|
18
27
|
*/
|
|
19
28
|
export function deriveWorkspacePermissionLevel(grants) {
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
return findAllWorkspaceUsersGrants(grants).some((rule) => rule.permissions.includes("SHARE"))
|
|
30
|
+
? "SHARE"
|
|
31
|
+
: "VIEW";
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Strongest workspace-wide level inherited from parent workspaces, or undefined
|
|
35
|
+
* when none is inherited. Inherited rule access grants every user of this
|
|
36
|
+
* workspace access too (workspace membership cascades down the hierarchy), yet
|
|
37
|
+
* cannot be revoked from here — consumers must surface it as workspace access
|
|
38
|
+
* and disable the Restricted option.
|
|
39
|
+
*/
|
|
40
|
+
export function deriveInheritedWorkspaceLevel(grants) {
|
|
41
|
+
const inherited = findAllWorkspaceUsersGrants(grants).flatMap((rule) => rule.inheritedPermissions);
|
|
42
|
+
if (inherited.includes("SHARE")) {
|
|
43
|
+
return "SHARE";
|
|
44
|
+
}
|
|
45
|
+
return inherited.length > 0 ? "VIEW" : undefined;
|
|
22
46
|
}
|
|
23
47
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
48
|
+
* The effective (displayed) workspace access: the direct state composed with
|
|
49
|
+
* inherited rule access. Inherited access makes general access WORKSPACE even
|
|
50
|
+
* when this workspace holds no rule of its own, and the level is the strongest
|
|
51
|
+
* of the two.
|
|
26
52
|
*/
|
|
53
|
+
export function composeEffectiveWorkspaceAccess(direct, directLevel, inheritedLevel) {
|
|
54
|
+
const generalAccess = direct === "WORKSPACE" || inheritedLevel ? "WORKSPACE" : "RESTRICTED";
|
|
55
|
+
const workspaceLevel = inheritedLevel === "SHARE" || (direct === "WORKSPACE" && directLevel === "SHARE") ? "SHARE" : "VIEW";
|
|
56
|
+
return { generalAccess, workspaceLevel };
|
|
57
|
+
}
|
|
@@ -80,6 +80,20 @@ export interface IObjectShareControllerState {
|
|
|
80
80
|
* never offered for the workspace rule.
|
|
81
81
|
*/
|
|
82
82
|
workspaceLevel: "VIEW" | "SHARE";
|
|
83
|
+
/**
|
|
84
|
+
* Whether workspace-wide access is (at least partly) inherited from a parent
|
|
85
|
+
* workspace. Inherited rule access grants every user of this workspace access
|
|
86
|
+
* too, yet cannot be revoked from here — consumers disable the Restricted
|
|
87
|
+
* option and explain why. `generalAccess` and `workspaceLevel` are effective
|
|
88
|
+
* values that already account for it.
|
|
89
|
+
*/
|
|
90
|
+
workspaceAccessInherited: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the workspace-rule level dropdown must be read-only: this workspace
|
|
93
|
+
* holds no rule of its own to re-grade (access is inherited-only), or an
|
|
94
|
+
* inherited SHARE pins the effective level regardless of the direct grant.
|
|
95
|
+
*/
|
|
96
|
+
workspaceLevelLocked: boolean;
|
|
83
97
|
/**
|
|
84
98
|
* Whether a workspace-level re-grade is in flight. Consumers disable the
|
|
85
99
|
* workspace permission dropdown while true so rapid toggles can't issue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACR,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,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,UAAU,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,mBAAmB,CAAC;IACrD,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5D,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;;OAMG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,oBAAoB,GAAG,SAA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AO,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACR,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,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,UAAU,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,mBAAmB,CAAC;IACrD,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC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A6B,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;IACxB,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -15,10 +15,22 @@ export interface IAccessList {
|
|
|
15
15
|
hasList: boolean;
|
|
16
16
|
/** Local grantee rows — seeded from the fetch, then authoritative; mutations write through. */
|
|
17
17
|
grantees: IObjectShareGrantee[];
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Workspace vs restricted general access granted by THIS workspace's own rule —
|
|
20
|
+
* local state; mutations write through. Excludes inherited (parent-workspace)
|
|
21
|
+
* rule access, which is exposed separately as `inheritedWorkspaceLevel`.
|
|
22
|
+
*/
|
|
19
23
|
generalAccess: GeneralAccessValue;
|
|
20
24
|
/** Workspace-rule permission level (VIEW/SHARE) — local state; mutations write through. */
|
|
21
25
|
workspaceLevel: "VIEW" | "SHARE";
|
|
26
|
+
/**
|
|
27
|
+
* Strongest workspace-wide level inherited from parent workspaces, or undefined
|
|
28
|
+
* when none. Seeded from the fetch and never mutated: inherited access cannot
|
|
29
|
+
* be changed from this workspace, so no write-through applies. Effective
|
|
30
|
+
* (displayed) general access is WORKSPACE whenever this is set, regardless of
|
|
31
|
+
* the direct `generalAccess` state.
|
|
32
|
+
*/
|
|
33
|
+
inheritedWorkspaceLevel: "VIEW" | "SHARE" | undefined;
|
|
22
34
|
/** Inline access summary, or undefined before the first load. */
|
|
23
35
|
summary: IObjectAccessSummary | undefined;
|
|
24
36
|
/** Top-level load status surfaced as the controller status. */
|
|
@@ -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,EAEH,KAAK,sBAAsB,EAE3B,KAAK,MAAM,EAGd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAmB,MAAM,sBAAsB,CAAC;
|
|
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,EAEH,KAAK,sBAAsB,EAE3B,KAAK,MAAM,EAGd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAmB,MAAM,sBAAsB,CAAC;AAkB7G,OAAO,KAAK,EAER,2BAA2B,EAC3B,mBAAmB,EACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,iFAAiF;IACjF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAC;IACjB,iGAA+F;IAC/F,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC;;;;OAIG;IACH,aAAa,EAAE,kBAAkB,CAAC;IAClC,6FAA2F;IAC3F,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC;;;;;;OAMG;IACH,uBAAuB,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC1C,+DAA+D;IAC/D,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9C,iD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rict } from "@gooddata/sdk-ui";
|
|
5
5
|
import { useToastMessage } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { isPermissionsNotAvailable } from "./accessErrors.js";
|
|
7
|
-
import { deriveGeneralAccess, deriveWorkspacePermissionLevel } from "./accessSummary.js";
|
|
7
|
+
import { composeEffectiveWorkspaceAccess, deriveGeneralAccess, deriveInheritedWorkspaceLevel, deriveWorkspacePermissionLevel, } from "./accessSummary.js";
|
|
8
8
|
import { objectShareMessages } from "./messages.js";
|
|
9
9
|
import { assigneeIdentityFacts, assigneeMatchesQuery, granteeId, granteesFromAccessList, userDisplayPair, userIdentityFacts, } from "./objectShareController.helpers.js";
|
|
10
10
|
/**
|
|
@@ -30,6 +30,7 @@ export function useAccessList(target, onSaved, dialogOpen) {
|
|
|
30
30
|
const [grantees, setGrantees] = useState([]);
|
|
31
31
|
const [generalAccess, setGeneralAccess] = useState("RESTRICTED");
|
|
32
32
|
const [workspaceLevel, setWorkspaceLevel] = useState("VIEW");
|
|
33
|
+
const [inheritedWorkspaceLevel, setInheritedWorkspaceLevel] = useState(undefined);
|
|
33
34
|
// The target the local state was seeded for; undefined until the first seed.
|
|
34
35
|
// Reading state as belonging to the current target hinges on this matching
|
|
35
36
|
// `targetKey` — a target switch makes the old state stale until the re-seed.
|
|
@@ -82,6 +83,7 @@ export function useAccessList(target, onSaved, dialogOpen) {
|
|
|
82
83
|
setGrantees(granteesFromAccessList(fetchedList));
|
|
83
84
|
setGeneralAccess(deriveGeneralAccess(fetchedList.grants));
|
|
84
85
|
setWorkspaceLevel(deriveWorkspacePermissionLevel(fetchedList.grants));
|
|
86
|
+
setInheritedWorkspaceLevel(deriveInheritedWorkspaceLevel(fetchedList.grants));
|
|
85
87
|
setSeededTarget(targetKey);
|
|
86
88
|
setLoadError(undefined);
|
|
87
89
|
}
|
|
@@ -164,12 +166,13 @@ export function useAccessList(target, onSaved, dialogOpen) {
|
|
|
164
166
|
if (!hasList) {
|
|
165
167
|
return undefined;
|
|
166
168
|
}
|
|
169
|
+
// The summary shows effective access: an inherited rule counts as
|
|
170
|
+
// workspace access even when this workspace holds no rule of its own.
|
|
167
171
|
return {
|
|
168
|
-
generalAccess,
|
|
169
|
-
workspaceLevel: generalAccess === "WORKSPACE" ? workspaceLevel : "VIEW",
|
|
172
|
+
...composeEffectiveWorkspaceAccess(generalAccess, workspaceLevel, inheritedWorkspaceLevel),
|
|
170
173
|
granteeCount: namedGrantees.filter((g) => g.pending !== "removing").length,
|
|
171
174
|
};
|
|
172
|
-
}, [hasList, generalAccess, workspaceLevel, namedGrantees]);
|
|
175
|
+
}, [hasList, generalAccess, workspaceLevel, inheritedWorkspaceLevel, namedGrantees]);
|
|
173
176
|
// "success" only once the *current* target's list has been seeded. After a
|
|
174
177
|
// target switch the previous seed is stale (seededTarget !== targetKey), so
|
|
175
178
|
// gating on hasList keeps the status at "loading" until the new list lands —
|
|
@@ -266,6 +269,7 @@ export function useAccessList(target, onSaved, dialogOpen) {
|
|
|
266
269
|
grantees: namedGrantees,
|
|
267
270
|
generalAccess,
|
|
268
271
|
workspaceLevel,
|
|
272
|
+
inheritedWorkspaceLevel,
|
|
269
273
|
summary,
|
|
270
274
|
status,
|
|
271
275
|
loadError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useObjectShareController.d.ts","sourceRoot":"","sources":["../../src/share/useObjectShareController.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"useObjectShareController.d.ts","sourceRoot":"","sources":["../../src/share/useObjectShareController.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAmB1E,OAAO,EACH,KAAK,sBAAsB,EAI3B,KAAK,sBAAsB,EAE9B,MAAM,kCAAkC,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAC5C,OAAO,CAAC,EAAE,sBAAsB,GACjC,sBAAsB,CAo0BxB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { areObjRefsEqual } from "@gooddata/sdk-model";
|
|
4
4
|
import { useToastMessage, } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { composeEffectiveWorkspaceAccess } from "./accessSummary.js";
|
|
5
6
|
import { objectShareMessages } from "./messages.js";
|
|
6
7
|
import { EMPTY_IDS, NO_LABELS, effectivePermissionAbove, granularGranteeFor, toGranularGrantee, } from "./objectShareController.helpers.js";
|
|
7
8
|
import { useAccessList } from "./useAccessList.js";
|
|
@@ -49,7 +50,7 @@ export function useObjectShareController(target, options) {
|
|
|
49
50
|
const [workspaceLevelSaving, setWorkspaceLevelSaving] = useState(false);
|
|
50
51
|
// The backend access list, seeded into local state (rows, general access,
|
|
51
52
|
// summary, the commit/picker primitives) lives in its own hook.
|
|
52
|
-
const { targetKey, hasList, grantees, generalAccess, workspaceLevel, summary, status, loadError, accessUnavailable, commit, loadOptions, refForId, getCurrentUserRef, canTransferOwnership, setGrantees, setGeneralAccess, setWorkspaceLevel, } = useAccessList(target, onSaved, isOpen);
|
|
53
|
+
const { targetKey, hasList, grantees, generalAccess, workspaceLevel, inheritedWorkspaceLevel, summary, status, loadError, accessUnavailable, commit, loadOptions, refForId, getCurrentUserRef, canTransferOwnership, setGrantees, setGeneralAccess, setWorkspaceLevel, } = useAccessList(target, onSaved, isOpen);
|
|
53
54
|
// Always-current target key, read inside async mutation finalizers that captured
|
|
54
55
|
// an older one. A write started for object A resolves after the user navigated to
|
|
55
56
|
// object B; because local state is authoritative (no refetch), applying A's
|
|
@@ -336,10 +337,19 @@ export function useObjectShareController(target, options) {
|
|
|
336
337
|
setSelectedLabelIdsByGrantee,
|
|
337
338
|
]);
|
|
338
339
|
const requestGeneralAccessChange = useCallback((next) => {
|
|
339
|
-
|
|
340
|
+
// Inherited rule access can't be revoked from this workspace, so a
|
|
341
|
+
// Restricted request can never be honored — refuse it (the radio row
|
|
342
|
+
// is also disabled). Compare against the effective value the radio
|
|
343
|
+
// shows: with inherited access it is WORKSPACE even when this
|
|
344
|
+
// workspace holds no rule of its own.
|
|
345
|
+
if (inheritedWorkspaceLevel && next === "RESTRICTED") {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const effective = inheritedWorkspaceLevel ? "WORKSPACE" : generalAccess;
|
|
349
|
+
if (next !== effective) {
|
|
340
350
|
setPendingGeneralAccess(next);
|
|
341
351
|
}
|
|
342
|
-
}, [generalAccess]);
|
|
352
|
+
}, [generalAccess, inheritedWorkspaceLevel]);
|
|
343
353
|
const confirmGeneralAccessChange = useCallback(async () => {
|
|
344
354
|
const next = pendingGeneralAccess;
|
|
345
355
|
if (!next || next === generalAccess) {
|
|
@@ -410,9 +420,14 @@ export function useObjectShareController(target, options) {
|
|
|
410
420
|
]);
|
|
411
421
|
const changeWorkspaceLevel = useCallback(async (level) => {
|
|
412
422
|
// Only re-grade an already-granted workspace rule; ignore no-ops, calls made
|
|
413
|
-
// while
|
|
423
|
+
// while this workspace grants no rule of its own (inherited-only access has
|
|
424
|
+
// nothing to re-grade), calls while an inherited SHARE pins the effective
|
|
425
|
+
// level (a direct downgrade couldn't change it), and re-entry while a
|
|
414
426
|
// previous re-grade is still in flight (would overlap writes).
|
|
415
|
-
if (generalAccess !== "WORKSPACE" ||
|
|
427
|
+
if (generalAccess !== "WORKSPACE" ||
|
|
428
|
+
inheritedWorkspaceLevel === "SHARE" ||
|
|
429
|
+
level === workspaceLevel ||
|
|
430
|
+
workspaceLevelSaving) {
|
|
416
431
|
return;
|
|
417
432
|
}
|
|
418
433
|
const startedFor = targetKey;
|
|
@@ -433,7 +448,15 @@ export function useObjectShareController(target, options) {
|
|
|
433
448
|
setWorkspaceLevel(previousLevel);
|
|
434
449
|
}
|
|
435
450
|
setWorkspaceLevelSaving(false);
|
|
436
|
-
}, [
|
|
451
|
+
}, [
|
|
452
|
+
generalAccess,
|
|
453
|
+
inheritedWorkspaceLevel,
|
|
454
|
+
workspaceLevel,
|
|
455
|
+
workspaceLevelSaving,
|
|
456
|
+
targetKey,
|
|
457
|
+
commit,
|
|
458
|
+
setWorkspaceLevel,
|
|
459
|
+
]);
|
|
437
460
|
const openTransferOwnership = useCallback(() => {
|
|
438
461
|
setSubview("transferOwnership");
|
|
439
462
|
setTransferTargetState(undefined);
|
|
@@ -643,11 +666,14 @@ export function useObjectShareController(target, options) {
|
|
|
643
666
|
accessUnavailable,
|
|
644
667
|
summary,
|
|
645
668
|
grantees,
|
|
646
|
-
|
|
647
|
-
//
|
|
648
|
-
//
|
|
649
|
-
|
|
650
|
-
|
|
669
|
+
// Effective access: the direct state composed with inherited rule
|
|
670
|
+
// access. Also pins the level to VIEW while restricted, so the (hidden)
|
|
671
|
+
// dropdown never shows a stale SHARE left over from a prior grant.
|
|
672
|
+
...composeEffectiveWorkspaceAccess(generalAccess, workspaceLevel, inheritedWorkspaceLevel),
|
|
673
|
+
workspaceAccessInherited: inheritedWorkspaceLevel !== undefined,
|
|
674
|
+
// No direct rule to re-grade (inherited-only access), or an inherited
|
|
675
|
+
// SHARE pins the effective level — either way the dropdown is read-only.
|
|
676
|
+
workspaceLevelLocked: generalAccess !== "WORKSPACE" || inheritedWorkspaceLevel === "SHARE",
|
|
651
677
|
workspaceLevelSaving,
|
|
652
678
|
labels: effectiveLabels,
|
|
653
679
|
labelsResolved,
|
|
@@ -668,6 +694,7 @@ export function useObjectShareController(target, options) {
|
|
|
668
694
|
grantees,
|
|
669
695
|
generalAccess,
|
|
670
696
|
workspaceLevel,
|
|
697
|
+
inheritedWorkspaceLevel,
|
|
671
698
|
workspaceLevelSaving,
|
|
672
699
|
effectiveLabels,
|
|
673
700
|
labelsResolved,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-ext",
|
|
3
|
-
"version": "11.47.0
|
|
3
|
+
"version": "11.47.0",
|
|
4
4
|
"description": "GoodData.UI SDK - Extensions",
|
|
5
5
|
"license": "LicenseRef-LICENSE",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -63,20 +63,20 @@
|
|
|
63
63
|
"ts-invariant": "0.10.3",
|
|
64
64
|
"tslib": "2.8.1",
|
|
65
65
|
"uuid": "11.1.1",
|
|
66
|
-
"@gooddata/sdk-backend-base": "11.47.0
|
|
67
|
-
"@gooddata/sdk-
|
|
68
|
-
"@gooddata/sdk-
|
|
69
|
-
"@gooddata/sdk-
|
|
70
|
-
"@gooddata/sdk-
|
|
71
|
-
"@gooddata/sdk-ui-charts": "11.47.0
|
|
72
|
-
"@gooddata/sdk-ui-filters": "11.47.0
|
|
73
|
-
"@gooddata/sdk-ui-geo": "11.47.0
|
|
74
|
-
"@gooddata/sdk-ui-
|
|
75
|
-
"@gooddata/sdk-ui-semantic-search": "11.47.0
|
|
76
|
-
"@gooddata/sdk-ui-theme-provider": "11.47.0
|
|
77
|
-
"@gooddata/sdk-ui-vis-commons": "11.47.0
|
|
78
|
-
"@gooddata/util": "11.47.0
|
|
79
|
-
"@gooddata/sdk-ui-
|
|
66
|
+
"@gooddata/sdk-backend-base": "11.47.0",
|
|
67
|
+
"@gooddata/sdk-backend-spi": "11.47.0",
|
|
68
|
+
"@gooddata/sdk-model": "11.47.0",
|
|
69
|
+
"@gooddata/sdk-embedding": "11.47.0",
|
|
70
|
+
"@gooddata/sdk-ui": "11.47.0",
|
|
71
|
+
"@gooddata/sdk-ui-charts": "11.47.0",
|
|
72
|
+
"@gooddata/sdk-ui-filters": "11.47.0",
|
|
73
|
+
"@gooddata/sdk-ui-geo": "11.47.0",
|
|
74
|
+
"@gooddata/sdk-ui-pivot": "11.47.0",
|
|
75
|
+
"@gooddata/sdk-ui-semantic-search": "11.47.0",
|
|
76
|
+
"@gooddata/sdk-ui-theme-provider": "11.47.0",
|
|
77
|
+
"@gooddata/sdk-ui-vis-commons": "11.47.0",
|
|
78
|
+
"@gooddata/util": "11.47.0",
|
|
79
|
+
"@gooddata/sdk-ui-kit": "11.47.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -124,12 +124,12 @@
|
|
|
124
124
|
"typescript": "5.9.3",
|
|
125
125
|
"vitest": "4.1.8",
|
|
126
126
|
"vitest-dom": "0.1.1",
|
|
127
|
-
"@gooddata/eslint-config": "11.47.0
|
|
128
|
-
"@gooddata/
|
|
129
|
-
"@gooddata/
|
|
130
|
-
"@gooddata/
|
|
131
|
-
"@gooddata/
|
|
132
|
-
"@gooddata/
|
|
127
|
+
"@gooddata/eslint-config": "11.47.0",
|
|
128
|
+
"@gooddata/sdk-backend-mockingbird": "11.47.0",
|
|
129
|
+
"@gooddata/i18n-toolkit": "11.47.0",
|
|
130
|
+
"@gooddata/stylelint-config": "11.47.0",
|
|
131
|
+
"@gooddata/oxlint-config": "11.47.0",
|
|
132
|
+
"@gooddata/reference-workspace": "11.47.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"react": "^18.0.0 || ^19.0.0",
|