@gooddata/sdk-ui-ext 11.47.0-alpha.3 → 11.47.0-alpha.5
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 +3 -3
- 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/configurationControls/conditionalFormatting/CfSelect.d.ts +14 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/CfSelect.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/CfSelect.js +25 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionEditor.d.ts +18 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionEditor.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionEditor.js +132 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts +4 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.js +15 -116
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts +5 -3
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.js +10 -10
- package/esm/internal/components/configurationControls/conditionalFormatting/ReorderList.d.ts +25 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ReorderList.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/ReorderList.js +94 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.d.ts +66 -7
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/conditionalFormattingModel.js +165 -21
- package/esm/internal/components/configurationControls/conditionalFormatting/reorderListModel.d.ts +4 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/reorderListModel.d.ts.map +1 -0
- package/esm/internal/components/configurationControls/conditionalFormatting/reorderListModel.js +16 -0
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.d.ts +0 -1
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.d.ts.map +1 -1
- package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.d.ts +9 -2
- package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.d.ts.map +1 -1
- package/esm/internal/components/configurationPanels/PivotTableConfigurationPanel.js +4 -4
- 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/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.js +8 -7
- 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/en-US.localization-bundle.d.ts +8 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-US.localization-bundle.js +8 -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/locales.d.ts +6 -0
- package/esm/locales.d.ts.map +1 -1
- package/esm/locales.js +2 -0
- 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
- package/styles/css/main.css +102 -13
- package/styles/css/main.css.map +1 -1
- package/styles/internal/css/conditional_formatting.css +102 -13
- package/styles/internal/css/conditional_formatting.css.map +1 -1
- package/styles/internal/scss/conditional_formatting.scss +138 -13
|
@@ -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,WA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E,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;;;OAKG;IACH,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE,gEAAgE;IAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,mFAAmF;IACnF,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC;;;OAGG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,6DAA6D;IAC7D,yBAAyB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;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;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,EA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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,OA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AC,MAAM,CAAC,CAAC;IACzC;;;;;;;;OAQG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2FAA2F;IAC3F,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAEjC,qGAAqG;IACrG,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACzE,8EAA8E;IAC9E,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC3E;;;;OAIG;IACH,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAC7E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CACzB,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAC5C,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EACjC,UAAU,EAAE,OAAO,GACpB,WAAW,CAwTb"}
|
|
@@ -4,7 +4,7 @@ import { idRef, objRefToString, } from "@gooddata/sdk-model";
|
|
|
4
4
|
import { useBackendStrict, useCancelablePromise, useWorkspaceStrict } 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-alpha.
|
|
3
|
+
"version": "11.47.0-alpha.5",
|
|
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-
|
|
67
|
-
"@gooddata/sdk-
|
|
68
|
-
"@gooddata/sdk-
|
|
69
|
-
"@gooddata/sdk-
|
|
70
|
-
"@gooddata/sdk-ui": "11.47.0-alpha.
|
|
71
|
-
"@gooddata/sdk-ui-
|
|
72
|
-
"@gooddata/sdk-ui-
|
|
73
|
-
"@gooddata/sdk-ui-geo": "11.47.0-alpha.
|
|
74
|
-
"@gooddata/sdk-ui-kit": "11.47.0-alpha.
|
|
75
|
-
"@gooddata/sdk-ui-pivot": "11.47.0-alpha.
|
|
76
|
-
"@gooddata/sdk-ui-semantic-search": "11.47.0-alpha.
|
|
77
|
-
"@gooddata/sdk-ui-theme-provider": "11.47.0-alpha.
|
|
78
|
-
"@gooddata/sdk-ui-vis-commons": "11.47.0-alpha.
|
|
79
|
-
"@gooddata/util": "11.47.0-alpha.
|
|
66
|
+
"@gooddata/sdk-backend-spi": "11.47.0-alpha.5",
|
|
67
|
+
"@gooddata/sdk-embedding": "11.47.0-alpha.5",
|
|
68
|
+
"@gooddata/sdk-model": "11.47.0-alpha.5",
|
|
69
|
+
"@gooddata/sdk-backend-base": "11.47.0-alpha.5",
|
|
70
|
+
"@gooddata/sdk-ui": "11.47.0-alpha.5",
|
|
71
|
+
"@gooddata/sdk-ui-charts": "11.47.0-alpha.5",
|
|
72
|
+
"@gooddata/sdk-ui-filters": "11.47.0-alpha.5",
|
|
73
|
+
"@gooddata/sdk-ui-geo": "11.47.0-alpha.5",
|
|
74
|
+
"@gooddata/sdk-ui-kit": "11.47.0-alpha.5",
|
|
75
|
+
"@gooddata/sdk-ui-pivot": "11.47.0-alpha.5",
|
|
76
|
+
"@gooddata/sdk-ui-semantic-search": "11.47.0-alpha.5",
|
|
77
|
+
"@gooddata/sdk-ui-theme-provider": "11.47.0-alpha.5",
|
|
78
|
+
"@gooddata/sdk-ui-vis-commons": "11.47.0-alpha.5",
|
|
79
|
+
"@gooddata/util": "11.47.0-alpha.5"
|
|
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-alpha.
|
|
128
|
-
"@gooddata/i18n-toolkit": "11.47.0-alpha.
|
|
129
|
-
"@gooddata/oxlint-config": "11.47.0-alpha.
|
|
130
|
-
"@gooddata/reference-workspace": "11.47.0-alpha.
|
|
131
|
-
"@gooddata/sdk-backend-mockingbird": "11.47.0-alpha.
|
|
132
|
-
"@gooddata/stylelint-config": "11.47.0-alpha.
|
|
127
|
+
"@gooddata/eslint-config": "11.47.0-alpha.5",
|
|
128
|
+
"@gooddata/i18n-toolkit": "11.47.0-alpha.5",
|
|
129
|
+
"@gooddata/oxlint-config": "11.47.0-alpha.5",
|
|
130
|
+
"@gooddata/reference-workspace": "11.47.0-alpha.5",
|
|
131
|
+
"@gooddata/sdk-backend-mockingbird": "11.47.0-alpha.5",
|
|
132
|
+
"@gooddata/stylelint-config": "11.47.0-alpha.5"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"react": "^18.0.0 || ^19.0.0",
|
package/styles/css/main.css
CHANGED
|
@@ -2620,10 +2620,13 @@
|
|
|
2620
2620
|
.gd-cf-section__rules {
|
|
2621
2621
|
display: flex;
|
|
2622
2622
|
flex-direction: column;
|
|
2623
|
-
gap: 5px;
|
|
2624
2623
|
margin-bottom: 5px;
|
|
2625
2624
|
}
|
|
2626
2625
|
|
|
2626
|
+
.gd-cf-select__option {
|
|
2627
|
+
height: 28px;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2627
2630
|
.gd-cf-type-icon {
|
|
2628
2631
|
display: inline-block;
|
|
2629
2632
|
flex: 0 0 auto;
|
|
@@ -2636,13 +2639,78 @@
|
|
|
2636
2639
|
background-size: contain;
|
|
2637
2640
|
}
|
|
2638
2641
|
|
|
2642
|
+
.gd-cf-reorder__handle {
|
|
2643
|
+
position: absolute;
|
|
2644
|
+
width: 7px;
|
|
2645
|
+
height: 18px;
|
|
2646
|
+
background-color: var(--gd-palette-complementary-5);
|
|
2647
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0h2v2H0zM5 0h2v2H5z'/%3E%3C/svg%3E");
|
|
2648
|
+
-webkit-mask-repeat: repeat-y;
|
|
2649
|
+
-webkit-mask-size: 7px 4px;
|
|
2650
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0h2v2H0zM5 0h2v2H5z'/%3E%3C/svg%3E");
|
|
2651
|
+
mask-repeat: repeat-y;
|
|
2652
|
+
mask-size: 7px 4px;
|
|
2653
|
+
cursor: grab;
|
|
2654
|
+
opacity: 0;
|
|
2655
|
+
pointer-events: none;
|
|
2656
|
+
transition: opacity 0.15s ease;
|
|
2657
|
+
}
|
|
2658
|
+
.gd-cf-reorder__handle:active {
|
|
2659
|
+
cursor: grabbing;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
.gd-cf-reorder-item--dragging {
|
|
2663
|
+
opacity: 0.4;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
.gd-cf-reorder-item--drop-above,
|
|
2667
|
+
.gd-cf-reorder-item--drop-below {
|
|
2668
|
+
position: relative;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
.gd-cf-reorder-item--drop-above::before,
|
|
2672
|
+
.gd-cf-reorder-item--drop-below::after {
|
|
2673
|
+
content: "";
|
|
2674
|
+
position: absolute;
|
|
2675
|
+
right: 0;
|
|
2676
|
+
left: 0;
|
|
2677
|
+
height: 2px;
|
|
2678
|
+
border-radius: 1px;
|
|
2679
|
+
background: var(--gd-palette-primary-base);
|
|
2680
|
+
pointer-events: none;
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
.gd-cf-reorder-item--drop-above::before {
|
|
2684
|
+
top: -3px;
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
.gd-cf-reorder-item--drop-below::after {
|
|
2688
|
+
bottom: -3px;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2639
2691
|
.gd-cf-rule {
|
|
2692
|
+
position: relative;
|
|
2640
2693
|
display: flex;
|
|
2641
2694
|
align-items: center;
|
|
2695
|
+
min-height: 30px;
|
|
2642
2696
|
border-radius: 3px;
|
|
2697
|
+
transition: margin-left 0.15s ease, padding-left 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
|
|
2698
|
+
}
|
|
2699
|
+
.gd-cf-rule .gd-cf-reorder__handle {
|
|
2700
|
+
top: 50%;
|
|
2701
|
+
left: 6px;
|
|
2702
|
+
transform: translateY(-50%);
|
|
2643
2703
|
}
|
|
2644
2704
|
.gd-cf-rule:hover {
|
|
2645
|
-
|
|
2705
|
+
z-index: 1;
|
|
2706
|
+
background: var(--gd-palette-complementary-0);
|
|
2707
|
+
box-shadow: 0 0 0 1px var(--gd-palette-complementary-3), 0 2px 4px 0 rgba(20, 56, 93, 0.15);
|
|
2708
|
+
margin-left: -20px;
|
|
2709
|
+
padding-left: 20px;
|
|
2710
|
+
}
|
|
2711
|
+
.gd-cf-rule:hover .gd-cf-reorder__handle {
|
|
2712
|
+
opacity: 1;
|
|
2713
|
+
pointer-events: auto;
|
|
2646
2714
|
}
|
|
2647
2715
|
.gd-cf-rule:has(.gd-cf-rule__delete:hover) {
|
|
2648
2716
|
background: var(--gd-palette-error-dimmed);
|
|
@@ -2671,19 +2739,13 @@
|
|
|
2671
2739
|
font-size: 10px;
|
|
2672
2740
|
}
|
|
2673
2741
|
.gd-cf-rule__delete {
|
|
2742
|
+
display: inline-flex;
|
|
2674
2743
|
flex: 0 0 auto;
|
|
2675
|
-
|
|
2744
|
+
opacity: 0;
|
|
2745
|
+
transition: opacity 0.15s ease;
|
|
2676
2746
|
}
|
|
2677
2747
|
.gd-cf-rule:hover .gd-cf-rule__delete, .gd-cf-rule:focus-within .gd-cf-rule__delete {
|
|
2678
|
-
|
|
2679
|
-
}
|
|
2680
|
-
|
|
2681
|
-
.gd-cf-rule .gd-cf-rule__delete::before {
|
|
2682
|
-
color: var(--gd-palette-complementary-6);
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
.gd-cf-rule .gd-cf-rule__delete:hover::before {
|
|
2686
|
-
color: var(--gd-palette-error-base);
|
|
2748
|
+
opacity: 1;
|
|
2687
2749
|
}
|
|
2688
2750
|
|
|
2689
2751
|
.gd-cf-section__anchor {
|
|
@@ -2743,18 +2805,41 @@
|
|
|
2743
2805
|
padding: 10px;
|
|
2744
2806
|
border-top: 1px solid var(--gd-palette-complementary-3);
|
|
2745
2807
|
}
|
|
2746
|
-
.gd-cf-dialog .dropdown-button,
|
|
2747
2808
|
.gd-cf-dialog .gd-input-field {
|
|
2748
2809
|
width: 100%;
|
|
2749
2810
|
}
|
|
2750
2811
|
|
|
2751
2812
|
.gd-cf-condition {
|
|
2813
|
+
position: relative;
|
|
2752
2814
|
display: flex;
|
|
2753
2815
|
flex-direction: column;
|
|
2754
2816
|
gap: 5px;
|
|
2755
2817
|
padding: 5px 10px 10px;
|
|
2756
2818
|
border-radius: 3px;
|
|
2757
2819
|
background: var(--gd-palette-complementary-2);
|
|
2820
|
+
transition: margin 0.15s ease, padding 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
|
|
2821
|
+
}
|
|
2822
|
+
.gd-cf-condition.gd-cf-reorder-item {
|
|
2823
|
+
padding-left: 18px;
|
|
2824
|
+
}
|
|
2825
|
+
.gd-cf-condition .gd-cf-reorder__handle {
|
|
2826
|
+
top: 10px;
|
|
2827
|
+
left: 5px;
|
|
2828
|
+
}
|
|
2829
|
+
.gd-cf-condition:hover {
|
|
2830
|
+
z-index: 1;
|
|
2831
|
+
background: var(--gd-palette-complementary-0);
|
|
2832
|
+
box-shadow: 0 0 0 1px var(--gd-palette-complementary-3), 0 2px 4px 0 rgba(20, 56, 93, 0.15);
|
|
2833
|
+
margin: 0 -5px;
|
|
2834
|
+
padding-right: 15px;
|
|
2835
|
+
padding-left: 15px;
|
|
2836
|
+
}
|
|
2837
|
+
.gd-cf-condition.gd-cf-reorder-item:hover {
|
|
2838
|
+
padding-left: 23px;
|
|
2839
|
+
}
|
|
2840
|
+
.gd-cf-condition:hover .gd-cf-reorder__handle {
|
|
2841
|
+
opacity: 1;
|
|
2842
|
+
pointer-events: auto;
|
|
2758
2843
|
}
|
|
2759
2844
|
.gd-cf-condition__header {
|
|
2760
2845
|
display: flex;
|
|
@@ -2769,6 +2854,10 @@
|
|
|
2769
2854
|
display: flex;
|
|
2770
2855
|
gap: 5px;
|
|
2771
2856
|
}
|
|
2857
|
+
.gd-cf-condition__error {
|
|
2858
|
+
color: var(--gd-palette-error-base);
|
|
2859
|
+
font-size: 11px;
|
|
2860
|
+
}
|
|
2772
2861
|
.gd-cf-condition__format-row {
|
|
2773
2862
|
display: flex;
|
|
2774
2863
|
align-items: center;
|