-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathutils.js
More file actions
47 lines (43 loc) · 866 Bytes
/
Copy pathutils.js
File metadata and controls
47 lines (43 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const defaultOptions = {
report: {
mode: 'view',
embedModes: ['view', 'edit', 'create'],
},
dashboard: {
mode: 'view',
embedModes: ['view'],
},
tile: {
mode: 'view',
embedModes: ['view'],
},
};
const embedTypes = Object.keys(defaultOptions);
const initializeState = type => ({
embedType: type,
tokenType: 'Embed',
accessToken: '',
embedUrl: '',
embedId: '',
pageName: '',
dashboardId: '',
permissions: 'All',
tileId: '',
filterPaneEnabled: 'filter-false',
navContentPaneEnabled: 'nav-false',
visualHeaderFlag: true,
flag: false,
reportMode: defaultOptions[type].mode,
datasetId: '',
theme: {},
show: false
});
const isObject = obj => {
return (typeof obj === "object" && obj !== null) || typeof obj === "function";
}
export {
embedTypes,
defaultOptions,
initializeState,
isObject,
};