@qrvey/widget-configurability 0.0.0-beta.4539 → 0.0.0-beta.4657
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/README.md +53 -0
- package/dist/cjs/index.js +12 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/metadata/customization-metadata.js +241 -0
- package/dist/cjs/metadata/customization-metadata.js.map +1 -0
- package/dist/cjs/metadata/index.js +11 -0
- package/dist/cjs/metadata/index.js.map +1 -0
- package/dist/cjs/metadata/labels/chart-panel.labels.js +56 -0
- package/dist/cjs/metadata/labels/chart-panel.labels.js.map +1 -0
- package/dist/cjs/metadata/labels/dashboard.labels.js +207 -0
- package/dist/cjs/metadata/labels/dashboard.labels.js.map +1 -0
- package/dist/cjs/metadata/metadata.models.js +3 -0
- package/dist/cjs/metadata/metadata.models.js.map +1 -0
- package/dist/cjs/models/remote.models.js +3 -0
- package/dist/cjs/models/remote.models.js.map +1 -0
- package/dist/cjs/models/validation.models.js +3 -0
- package/dist/cjs/models/validation.models.js.map +1 -0
- package/dist/cjs/remote/remote-customization.loader.js +213 -0
- package/dist/cjs/remote/remote-customization.loader.js.map +1 -0
- package/dist/cjs/structural-manager.js +35 -2
- package/dist/cjs/structural-manager.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils/defaults.helpers.js +3 -0
- package/dist/cjs/utils/defaults.helpers.js.map +1 -1
- package/dist/cjs/utils/layers.helpers.js +178 -0
- package/dist/cjs/utils/layers.helpers.js.map +1 -0
- package/dist/cjs/utils/logger.helpers.js +10 -0
- package/dist/cjs/utils/logger.helpers.js.map +1 -0
- package/dist/cjs/utils/scope.helpers.js +4 -1
- package/dist/cjs/utils/scope.helpers.js.map +1 -1
- package/dist/cjs/validation/customization.validator.js +366 -0
- package/dist/cjs/validation/customization.validator.js.map +1 -0
- package/dist/esm/index.mjs +842 -48
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/metadata.mjs +2750 -0
- package/dist/esm/metadata.mjs.map +1 -0
- package/dist/types/customization.models-CCSWjfb2.d.ts +47 -0
- package/dist/types/index.d.ts +98 -68
- package/dist/types/metadata.d.ts +59 -0
- package/package.json +7 -1
- package/dist/cjs/utils/download-modal.helpers.js +0 -29
- package/dist/cjs/utils/download-modal.helpers.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
REPORT = "report",
|
|
4
|
-
DOWNLOAD_MANAGER = "download-manager",
|
|
5
|
-
DOWNLOAD_MODAL = "download-modal",
|
|
6
|
-
CHART_PANEL = "chart-panel",
|
|
7
|
-
CHART_GALLERY = "chart-gallery",
|
|
8
|
-
CHART_BUILDER = "chart-builder"
|
|
9
|
-
}
|
|
10
|
-
declare const WIDGET_SUBMODULE_NAMES: Partial<Record<Widget, string>>;
|
|
11
|
-
declare const WIDGET_STRUCTURE_SCOPE_KIND = "qrvey.widget-structure-scope";
|
|
12
|
-
declare const WIDGET_STRUCTURE_SCOPE_FORMAT = 1;
|
|
13
|
-
declare enum WidgetVersion {
|
|
14
|
-
v1 = "1.0",
|
|
15
|
-
latest = "latest"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare const allowedOperators: readonly ["=", "!=", ">", ">=", "<", "<=", "startsWith", "endsWith", "contains"];
|
|
19
|
-
type Operators = (typeof allowedOperators)[number];
|
|
20
|
-
type ConditionValue = string | number;
|
|
21
|
-
interface Condition {
|
|
22
|
-
field: string;
|
|
23
|
-
operator: Operators;
|
|
24
|
-
value: ConditionValue;
|
|
25
|
-
}
|
|
26
|
-
type ConditionState = Record<string, ConditionValue>;
|
|
27
|
-
|
|
28
|
-
interface Verbs {
|
|
29
|
-
remove?: string[];
|
|
30
|
-
keep?: string[];
|
|
31
|
-
reorder?: string[];
|
|
32
|
-
}
|
|
33
|
-
interface CustomizationStructure extends Verbs {
|
|
34
|
-
defaults?: Record<string, unknown>;
|
|
35
|
-
subModules?: WidgetSubModuleCollection;
|
|
36
|
-
}
|
|
37
|
-
interface Conditional extends CustomizationStructure {
|
|
38
|
-
condition: Condition;
|
|
39
|
-
}
|
|
40
|
-
type View = Record<string, WidgetCustomization>;
|
|
41
|
-
type WidgetSubModuleCollection = Record<string, WidgetCustomization>;
|
|
42
|
-
interface WidgetCustomization extends CustomizationStructure {
|
|
43
|
-
conditional?: Conditional[];
|
|
44
|
-
views?: View;
|
|
45
|
-
}
|
|
1
|
+
import { W as WidgetCustomization, C as Condition, a as Widget, b as WidgetVersion, c as ConditionState } from './customization.models-CCSWjfb2.js';
|
|
2
|
+
export { d as ConditionValue, O as Operators, e as WIDGET_STRUCTURE_SCOPE_FORMAT, f as WIDGET_STRUCTURE_SCOPE_KIND, g as WIDGET_SUBMODULE_NAMES, h as WidgetSubModuleCollection } from './customization.models-CCSWjfb2.js';
|
|
46
3
|
|
|
47
4
|
type SectionValue = number | boolean | string | undefined | SectionValue[] | Record<string, unknown>;
|
|
48
5
|
type SectionDefinition = WidgetStructure | (string | WidgetStructure)[] | undefined | boolean;
|
|
@@ -68,6 +25,7 @@ interface StructureEngineOptions {
|
|
|
68
25
|
}
|
|
69
26
|
interface BuildStructureOptions extends StructureEngineOptions {
|
|
70
27
|
validationMap?: ValidationMap;
|
|
28
|
+
layers?: WidgetCustomization[];
|
|
71
29
|
}
|
|
72
30
|
interface WidgetItemCondition {
|
|
73
31
|
effect: 'keep' | 'remove';
|
|
@@ -102,16 +60,77 @@ interface WidgetStructureScope {
|
|
|
102
60
|
defaults?: Record<string, unknown>;
|
|
103
61
|
}
|
|
104
62
|
|
|
63
|
+
type CustomizationErrorCode = 'INVALID_TYPE' | 'UNKNOWN_PROPERTY' | 'UNKNOWN_VIEW' | 'UNKNOWN_SUBMODULE' | 'UNKNOWN_KEY' | 'INVALID_PATTERN' | 'INVALID_DEFAULT' | 'INVALID_CONDITION' | 'EMPTY_CUSTOMIZATION' | 'UNKNOWN_WIDGET' | 'UNKNOWN_VERSION';
|
|
64
|
+
type CustomizationPath = (string | number)[];
|
|
65
|
+
interface CustomizationValidationError {
|
|
66
|
+
path: CustomizationPath;
|
|
67
|
+
code: CustomizationErrorCode;
|
|
68
|
+
severity: 'error' | 'warning';
|
|
69
|
+
message: string;
|
|
70
|
+
suggestion?: string;
|
|
71
|
+
}
|
|
72
|
+
interface CustomizationValidationResult {
|
|
73
|
+
valid: boolean;
|
|
74
|
+
errors: CustomizationValidationError[];
|
|
75
|
+
}
|
|
76
|
+
interface ValidateCustomizationOptions {
|
|
77
|
+
version?: string;
|
|
78
|
+
allowEmpty?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface RemoteCustomizationDefinition {
|
|
82
|
+
widget: string;
|
|
83
|
+
customizationId: string;
|
|
84
|
+
name?: string | null;
|
|
85
|
+
description?: string | null;
|
|
86
|
+
source?: 'system' | 'user';
|
|
87
|
+
structureVersion?: string;
|
|
88
|
+
contexts?: string[];
|
|
89
|
+
customization: WidgetCustomization;
|
|
90
|
+
createdAt?: string;
|
|
91
|
+
updatedAt?: string;
|
|
92
|
+
}
|
|
93
|
+
interface LoadRemoteCustomizationOptions {
|
|
94
|
+
widget: string;
|
|
95
|
+
customizationId?: string | null;
|
|
96
|
+
context?: string;
|
|
97
|
+
domain: string;
|
|
98
|
+
apiDomain?: string;
|
|
99
|
+
apiKey?: string;
|
|
100
|
+
qvToken?: string;
|
|
101
|
+
timeoutMs?: number;
|
|
102
|
+
fetchFn?: typeof fetch;
|
|
103
|
+
cache?: boolean;
|
|
104
|
+
}
|
|
105
|
+
type RemoteCustomizationStatus = 'found' | 'fallback' | 'none' | 'error';
|
|
106
|
+
interface RemoteCustomizationError {
|
|
107
|
+
code: 'NETWORK' | 'TIMEOUT' | 'HTTP' | 'INVALID_RESPONSE' | 'INVALID_INPUT';
|
|
108
|
+
status?: number;
|
|
109
|
+
message: string;
|
|
110
|
+
}
|
|
111
|
+
interface RemoteCustomizationResult {
|
|
112
|
+
status: RemoteCustomizationStatus;
|
|
113
|
+
definition?: RemoteCustomizationDefinition;
|
|
114
|
+
error?: RemoteCustomizationError;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
type SubmoduleLayers = Record<string, Record<string, WidgetCustomization[]>>;
|
|
118
|
+
|
|
105
119
|
declare function getWidgetConfig(widget: Widget, version?: WidgetVersion): WidgetConfig;
|
|
106
120
|
declare function buildStructure(widget: Widget, customization?: WidgetCustomization, version?: WidgetVersion, options?: BuildStructureOptions): WidgetStructureInstance;
|
|
107
121
|
declare class WidgetStructureInstance {
|
|
108
122
|
private viewMap;
|
|
109
123
|
private rootDefaults?;
|
|
110
|
-
|
|
124
|
+
private submoduleLayers?;
|
|
125
|
+
constructor(viewMap: WidgetViewMap, rootDefaults?: Record<string, unknown> | undefined, submoduleLayers?: SubmoduleLayers | undefined);
|
|
111
126
|
private getValue;
|
|
112
127
|
isVisible(key: string, state?: ConditionState): boolean;
|
|
113
128
|
getChildMap(key: string): WidgetViewMap | undefined;
|
|
114
129
|
getSubmodule(module: string, view?: string): WidgetCustomization | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Submodule customizations of the stored layers, to pass as layers when building the embedded widget (structureFromSubmodule).
|
|
132
|
+
*/
|
|
133
|
+
getSubmoduleLayers(module: string, view?: string): WidgetCustomization[] | undefined;
|
|
115
134
|
getDefaults(key: string): Record<string, unknown> | undefined;
|
|
116
135
|
getRootDefaults(): Record<string, unknown> | undefined;
|
|
117
136
|
/**
|
|
@@ -166,27 +185,6 @@ declare function structureFrom(widget: Widget, input: unknown, view?: string, ve
|
|
|
166
185
|
*/
|
|
167
186
|
declare function structureFromSubmodule(parent: WidgetStructureInstance, module: string, view?: string, options?: BuildStructureOptions): WidgetStructureInstance;
|
|
168
187
|
|
|
169
|
-
interface DownloadModalResolvedConfig {
|
|
170
|
-
schedule: boolean;
|
|
171
|
-
subscribe: boolean;
|
|
172
|
-
banner: boolean;
|
|
173
|
-
owner: boolean;
|
|
174
|
-
subscribeOwner: boolean;
|
|
175
|
-
organization: boolean;
|
|
176
|
-
myself: boolean;
|
|
177
|
-
specificPeople: boolean;
|
|
178
|
-
externalUsers: boolean;
|
|
179
|
-
subscribeMyselfDefault: boolean;
|
|
180
|
-
}
|
|
181
|
-
interface ResolveDownloadModalOptions {
|
|
182
|
-
organizationAvailable?: boolean;
|
|
183
|
-
subscribeOwnerAvailable?: boolean;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* The export modal's visibility rules: Schedule hides Subscribe, and Subscribe hides when it has nothing left to show.
|
|
187
|
-
*/
|
|
188
|
-
declare function resolveDownloadModalConfig(structure: WidgetStructureInstance, { organizationAvailable, subscribeOwnerAvailable, }?: ResolveDownloadModalOptions): DownloadModalResolvedConfig;
|
|
189
|
-
|
|
190
188
|
declare const DOWNLOAD_MODAL_V1_KEYS: readonly ["qScheduleOption", "qSubscribeOption", "qSubscribeExternalUsers", "qSubscribeBanner", "qOwnerLabel", "qSubscribeOwner", "qSubscribeOrganization", "qSubscribeMyself", "qSubscribeSpecificPeople", "qIncludeHyperlinks", "qIncludeHeader"];
|
|
191
189
|
type DownloadModalKey = (typeof DOWNLOAD_MODAL_V1_KEYS)[number];
|
|
192
190
|
declare const hostKeepInheritance: (section?: string) => Record<string, string>;
|
|
@@ -194,6 +192,38 @@ declare const DOWNLOAD_MODAL_V1_DEFAULTS: {
|
|
|
194
192
|
subscribeMyself: boolean;
|
|
195
193
|
};
|
|
196
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Formats a validation path as the API error messages show it, e.g. views.design.remove[2]
|
|
197
|
+
* (admin_api_manager prefixes it with `customization.`).
|
|
198
|
+
*/
|
|
199
|
+
declare function formatCustomizationPath(path: CustomizationPath): string;
|
|
200
|
+
/**
|
|
201
|
+
* True when the customization has no effective rule: no verb with items and no defaults anywhere.
|
|
202
|
+
*/
|
|
203
|
+
declare function isEmptyCustomization(value: unknown): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Strict validation of a customization for writes (API and Admin Center): collects every error in one pass, each with its path.
|
|
206
|
+
*/
|
|
207
|
+
declare function validateCustomization(widget: Widget | string, customization: unknown, options?: ValidateCustomizationOptions): CustomizationValidationResult;
|
|
208
|
+
|
|
209
|
+
declare const CUSTOMIZATIONS_API_PATH = "/api/admin/v5/customizations/widgets";
|
|
210
|
+
declare const DEFAULT_CUSTOMIZATION_ID = "default";
|
|
211
|
+
/**
|
|
212
|
+
* Forgets every cached request (tests, or a host that needs to re-read definitions without reloading).
|
|
213
|
+
*/
|
|
214
|
+
declare function clearRemoteCustomizationCache(): void;
|
|
215
|
+
declare const isValidCustomizationId: (value: unknown) => value is string;
|
|
216
|
+
/**
|
|
217
|
+
* Resolves the stored customization a widget uses as its base layer (resolution table 3.3.1 of QRV-749).
|
|
218
|
+
* found: the requested definition (or the context's); fallback: default, because the requested one does not exist;
|
|
219
|
+
* none: no remote layer; error: the widget shows its configuration error.
|
|
220
|
+
*/
|
|
221
|
+
declare function loadRemoteCustomization(options: LoadRemoteCustomizationOptions): Promise<RemoteCustomizationResult>;
|
|
222
|
+
/**
|
|
223
|
+
* The layers a widget passes to buildStructure for a resolved result: the definition's customization, or none.
|
|
224
|
+
*/
|
|
225
|
+
declare function remoteCustomizationLayers(result: RemoteCustomizationResult | undefined): WidgetCustomization[];
|
|
226
|
+
|
|
197
227
|
declare class ViewsDto {
|
|
198
228
|
list: string[];
|
|
199
229
|
design: string[];
|
|
@@ -257,4 +287,4 @@ declare namespace dashboard_structure_doc {
|
|
|
257
287
|
export { dashboard_structure_doc_AssetListDto as AssetListDto, dashboard_structure_doc_BaseDashboardV1StructureDto as BaseDashboardV1StructureDto, dashboard_structure_doc_FilterPanelDto as FilterPanelDto, dashboard_structure_doc_MenuBarDto as MenuBarDto, dashboard_structure_doc_SubModulesDto as SubModulesDto, dashboard_structure_doc_ViewsDto as ViewsDto };
|
|
258
288
|
}
|
|
259
289
|
|
|
260
|
-
export { type BuildStructureOptions,
|
|
290
|
+
export { type BuildStructureOptions, CUSTOMIZATIONS_API_PATH, Condition, ConditionState, type CustomizationErrorCode, type CustomizationPath, type CustomizationValidationError, type CustomizationValidationResult, DEFAULT_CUSTOMIZATION_ID, DOWNLOAD_MODAL_V1_DEFAULTS, DOWNLOAD_MODAL_V1_KEYS, DOWNLOAD_MODAL_VALIDATOR_MAP, DX_VALIDATOR_MAP, dashboard_structure_doc as DashboardDoc, type DownloadModalKey, type LoadRemoteCustomizationOptions, type RemoteCustomizationDefinition, type RemoteCustomizationError, type RemoteCustomizationResult, type RemoteCustomizationStatus, type SanitizeFn, type ScopeOptions, type StructureEngineOptions, type StructureInput, type ValidateCustomizationOptions, type ValidationFN, type ValidationMap, Widget, type WidgetConditionMap, type WidgetConfig, WidgetCustomization, type WidgetItemCondition, type WidgetStructure, WidgetStructureInstance, type WidgetStructureRoot, type WidgetStructureScope, WidgetVersion, type WidgetViewMap, type WidgetViewMapItem, buildStructure, calculateRootDefaults, calculateViewMap, checkConditions, clearRemoteCustomizationCache, evaluateCondition, extractCustomization, formatCustomizationPath, getWidgetConfig, getWidgetStructure, hostKeepInheritance, isEmptyCustomization, isValidCustomizationId, isWidgetStructureScope, loadRemoteCustomization, remoteCustomizationLayers, scopeToCustomization, structureFrom, structureFromSubmodule, validateBoolean, validateCustomization, validateDefaults };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { a as Widget, b as WidgetVersion, W as WidgetCustomization } from './customization.models-CCSWjfb2.js';
|
|
2
|
+
|
|
3
|
+
interface CustomizationLabel {
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
type CustomizationLabelMap = Record<string, CustomizationLabel>;
|
|
8
|
+
interface CustomizationTarget {
|
|
9
|
+
views: string[];
|
|
10
|
+
subModules?: string[];
|
|
11
|
+
}
|
|
12
|
+
interface CustomizationTreeNode {
|
|
13
|
+
key: string;
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
kind: 'section' | 'item' | 'subModule';
|
|
18
|
+
children?: CustomizationTreeNode[];
|
|
19
|
+
}
|
|
20
|
+
interface CustomizationLock {
|
|
21
|
+
verb: 'keep' | 'remove';
|
|
22
|
+
pattern: string;
|
|
23
|
+
scope: 'root' | 'view' | 'conditional' | 'parent';
|
|
24
|
+
}
|
|
25
|
+
interface CustomizationTreeStateNode extends CustomizationTreeNode {
|
|
26
|
+
visible: boolean | 'mixed';
|
|
27
|
+
lockedBy?: CustomizationLock;
|
|
28
|
+
children?: CustomizationTreeStateNode[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const widgetMetadata: Partial<Record<Widget, {
|
|
32
|
+
labels: CustomizationLabelMap;
|
|
33
|
+
}>>;
|
|
34
|
+
/**
|
|
35
|
+
* Keys of the structure in a view (or at the root), in structure order, without the view prefix.
|
|
36
|
+
*/
|
|
37
|
+
declare function structureKeysOf(widget: Widget, view?: string, version?: WidgetVersion): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Label of a key: full path first, then the leaf id; a humanized id when neither exists.
|
|
40
|
+
*/
|
|
41
|
+
declare function getCustomizationLabel(widget: Widget, key: string): CustomizationLabel;
|
|
42
|
+
/**
|
|
43
|
+
* The labelled tree of a target: a widget view, or the structure of the embedded widget when subModules is set.
|
|
44
|
+
*/
|
|
45
|
+
declare function getCustomizationTree(widget: Widget, target: CustomizationTarget, options?: {
|
|
46
|
+
version?: WidgetVersion;
|
|
47
|
+
}): CustomizationTreeNode[];
|
|
48
|
+
/**
|
|
49
|
+
* The tree with the visibility of each node for a customization, computed with the real engine. A node whose
|
|
50
|
+
* visibility differs between the target views is 'mixed'; a hidden node a switch cannot bring back is locked.
|
|
51
|
+
*/
|
|
52
|
+
declare function getCustomizationTreeState(widget: Widget, customization: WidgetCustomization | undefined, target: CustomizationTarget): CustomizationTreeStateNode[];
|
|
53
|
+
/**
|
|
54
|
+
* A new customization with the minimal change for one switch, applied to every view of the target. It only edits
|
|
55
|
+
* the remove list of each view (or of the submodule inside it), never keep, conditional, defaults or root verbs.
|
|
56
|
+
*/
|
|
57
|
+
declare function toggleCustomizationKey(customization: WidgetCustomization | undefined, target: CustomizationTarget, key: string, visible: boolean): WidgetCustomization;
|
|
58
|
+
|
|
59
|
+
export { type CustomizationLabel, type CustomizationLabelMap, type CustomizationLock, type CustomizationTarget, type CustomizationTreeNode, type CustomizationTreeStateNode, getCustomizationLabel, getCustomizationTree, getCustomizationTreeState, structureKeysOf, toggleCustomizationKey, widgetMetadata };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qrvey/widget-configurability",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.4657",
|
|
4
4
|
"types": "dist/types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"import": "./dist/esm/index.mjs",
|
|
11
11
|
"require": "./dist/cjs/index.js",
|
|
12
12
|
"default": "./dist/cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./metadata": {
|
|
15
|
+
"types": "./dist/types/metadata.d.ts",
|
|
16
|
+
"import": "./dist/esm/metadata.mjs",
|
|
17
|
+
"require": "./dist/cjs/metadata/index.js",
|
|
18
|
+
"default": "./dist/cjs/metadata/index.js"
|
|
13
19
|
}
|
|
14
20
|
},
|
|
15
21
|
"files": [
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveDownloadModalConfig = resolveDownloadModalConfig;
|
|
4
|
-
/**
|
|
5
|
-
* The export modal's visibility rules: Schedule hides Subscribe, and Subscribe hides when it has nothing left to show.
|
|
6
|
-
*/
|
|
7
|
-
function resolveDownloadModalConfig(structure, { organizationAvailable = true, subscribeOwnerAvailable = false, } = {}) {
|
|
8
|
-
var _a;
|
|
9
|
-
const visible = (key) => structure.isVisible(key);
|
|
10
|
-
const elements = {
|
|
11
|
-
banner: visible('qSubscribeBanner'),
|
|
12
|
-
owner: visible('qOwnerLabel'),
|
|
13
|
-
subscribeOwner: visible('qSubscribeOwner'),
|
|
14
|
-
organization: visible('qSubscribeOrganization'),
|
|
15
|
-
myself: visible('qSubscribeMyself'),
|
|
16
|
-
specificPeople: visible('qSubscribeSpecificPeople'),
|
|
17
|
-
};
|
|
18
|
-
const schedule = visible('qScheduleOption');
|
|
19
|
-
const anyElement = elements.banner ||
|
|
20
|
-
elements.owner ||
|
|
21
|
-
(subscribeOwnerAvailable && elements.subscribeOwner) ||
|
|
22
|
-
(organizationAvailable && elements.organization) ||
|
|
23
|
-
elements.myself ||
|
|
24
|
-
elements.specificPeople;
|
|
25
|
-
return Object.assign(Object.assign({}, elements), { schedule, subscribe: schedule && visible('qSubscribeOption') && anyElement, externalUsers: visible('qSubscribeExternalUsers'),
|
|
26
|
-
// A rejected value comes back undefined, which keeps the checkbox checked as it always started.
|
|
27
|
-
subscribeMyselfDefault: ((_a = structure.getRootDefaults()) === null || _a === void 0 ? void 0 : _a.subscribeMyself) !== false });
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=download-modal.helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-modal.helpers.js","sourceRoot":"","sources":["../../../src/utils/download-modal.helpers.ts"],"names":[],"mappings":";;AA0BA,gEAiCC;AApCD;;GAEG;AACH,SAAgB,0BAA0B,CACtC,SAAkC,EAClC,EACI,qBAAqB,GAAG,IAAI,EAC5B,uBAAuB,GAAG,KAAK,MACF,EAAE;;IAEnC,MAAM,OAAO,GAAG,CAAC,GAAqB,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG;QACb,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC;QACnC,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC;QAC7B,cAAc,EAAE,OAAO,CAAC,iBAAiB,CAAC;QAC1C,YAAY,EAAE,OAAO,CAAC,wBAAwB,CAAC;QAC/C,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC;QACnC,cAAc,EAAE,OAAO,CAAC,0BAA0B,CAAC;KACtD,CAAC;IACF,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5C,MAAM,UAAU,GACZ,QAAQ,CAAC,MAAM;QACf,QAAQ,CAAC,KAAK;QACd,CAAC,uBAAuB,IAAI,QAAQ,CAAC,cAAc,CAAC;QACpD,CAAC,qBAAqB,IAAI,QAAQ,CAAC,YAAY,CAAC;QAChD,QAAQ,CAAC,MAAM;QACf,QAAQ,CAAC,cAAc,CAAC;IAC5B,uCACO,QAAQ,KACX,QAAQ,EACR,SAAS,EAAE,QAAQ,IAAI,OAAO,CAAC,kBAAkB,CAAC,IAAI,UAAU,EAChE,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC;QACjD,gGAAgG;QAChG,sBAAsB,EAClB,CAAA,MAAA,SAAS,CAAC,eAAe,EAAE,0CAAE,eAAe,MAAK,KAAK,IAC5D;AACN,CAAC"}
|