@or-sdk/view-templates 1.0.1-beta.497.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/README.md +23 -0
- package/dist/cjs/ViewTemplates.js +199 -0
- package/dist/cjs/ViewTemplates.js.map +1 -0
- package/dist/cjs/constants.js +59 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/getGetByIdQuery.js +10 -0
- package/dist/cjs/utils/getGetByIdQuery.js.map +1 -0
- package/dist/cjs/utils/getListQuery.js +10 -0
- package/dist/cjs/utils/getListQuery.js.map +1 -0
- package/dist/cjs/utils/getNewViewTemplate.js +132 -0
- package/dist/cjs/utils/getNewViewTemplate.js.map +1 -0
- package/dist/cjs/utils/index.js +13 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/esm/ViewTemplates.js +125 -0
- package/dist/esm/ViewTemplates.js.map +1 -0
- package/dist/esm/constants.js +106 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/getGetByIdQuery.js +12 -0
- package/dist/esm/utils/getGetByIdQuery.js.map +1 -0
- package/dist/esm/utils/getListQuery.js +15 -0
- package/dist/esm/utils/getListQuery.js.map +1 -0
- package/dist/esm/utils/getNewViewTemplate.js +132 -0
- package/dist/esm/utils/getNewViewTemplate.js.map +1 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/types/ViewTemplates.d.ts +103 -0
- package/dist/types/ViewTemplates.d.ts.map +1 -0
- package/dist/types/constants.d.ts +6 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +117 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/getGetByIdQuery.d.ts +5 -0
- package/dist/types/utils/getGetByIdQuery.d.ts.map +1 -0
- package/dist/types/utils/getListQuery.d.ts +5 -0
- package/dist/types/utils/getListQuery.d.ts.map +1 -0
- package/dist/types/utils/getNewViewTemplate.d.ts +92 -0
- package/dist/types/utils/getNewViewTemplate.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/package.json +30 -0
- package/src/ViewTemplates.ts +164 -0
- package/src/constants.ts +109 -0
- package/src/index.ts +2 -0
- package/src/types.ts +136 -0
- package/src/utils/getGetByIdQuery.ts +13 -0
- package/src/utils/getListQuery.ts +16 -0
- package/src/utils/getNewViewTemplate.ts +132 -0
- package/src/utils/index.ts +7 -0
- package/tsconfig.dev.json +8 -0
- package/tsconfig.esm.json +12 -0
- package/tsconfig.json +7 -0
- package/tsconfig.types.json +10 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Installation:
|
|
2
|
+
```
|
|
3
|
+
$ npm i @or-sdk/view-templates
|
|
4
|
+
```
|
|
5
|
+
|
|
6
|
+
## Usage:
|
|
7
|
+
```typescript
|
|
8
|
+
import { ViewTemplates } from '@or-sdk/view-templates'
|
|
9
|
+
|
|
10
|
+
// with direct api url
|
|
11
|
+
const viewTemplates = new ViewTemplates({
|
|
12
|
+
token: 'my-account-token-string',
|
|
13
|
+
dataHubUrl: 'http://example.data-hub/endpoint'
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// with service discovery(slower)
|
|
17
|
+
const viewTemplates = new ViewTemplates({
|
|
18
|
+
token: 'my-account-token-string',
|
|
19
|
+
discoveryUrl: 'http://example.view-templates/endpoint'
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
[[include:view-templates/CHANGELOG.md]]
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
+
t[p] = s[p];
|
|
53
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
+
t[p[i]] = s[p[i]];
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
exports.ViewTemplates = void 0;
|
|
62
|
+
var data_hub_1 = require("@or-sdk/data-hub");
|
|
63
|
+
var utils_1 = require("./utils");
|
|
64
|
+
var constants_1 = require("./constants");
|
|
65
|
+
var ViewTemplates = (function () {
|
|
66
|
+
function ViewTemplates(params) {
|
|
67
|
+
var token = params.token, discoveryUrl = params.discoveryUrl, dataHubUrl = params.dataHubUrl;
|
|
68
|
+
this.dataHub = new data_hub_1.DataHub({
|
|
69
|
+
token: token,
|
|
70
|
+
discoveryUrl: discoveryUrl,
|
|
71
|
+
dataHubUrl: dataHubUrl,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
ViewTemplates.prototype.listViewTemplates = function (params) {
|
|
75
|
+
var _a;
|
|
76
|
+
if (params === void 0) { params = {}; }
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var _b, projection, varPrams, variables, operationName, data;
|
|
79
|
+
return __generator(this, function (_c) {
|
|
80
|
+
_b = params.projection, projection = _b === void 0 ? [] : _b, varPrams = __rest(params, ["projection"]);
|
|
81
|
+
variables = {
|
|
82
|
+
entity: constants_1.ENTITY_NAME,
|
|
83
|
+
params: __assign({ queryParams: {}, limit: 30 }, varPrams),
|
|
84
|
+
forceSandbox: false,
|
|
85
|
+
sourceId: (_a = varPrams === null || varPrams === void 0 ? void 0 : varPrams.queryParams) === null || _a === void 0 ? void 0 : _a.sourceId,
|
|
86
|
+
};
|
|
87
|
+
operationName = this.dataHub.getOperationName(data_hub_1.OperationNames.LIST_TEMPLATES);
|
|
88
|
+
data = {
|
|
89
|
+
operationName: operationName,
|
|
90
|
+
query: (0, utils_1.getListQuery)({
|
|
91
|
+
projection: projection,
|
|
92
|
+
}),
|
|
93
|
+
variables: variables,
|
|
94
|
+
};
|
|
95
|
+
return [2, this.dataHub.getFullList('POST', '/graphql', data)];
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
ViewTemplates.prototype.getViewTemplateById = function (viewTemplateId, params) {
|
|
100
|
+
if (params === void 0) { params = {}; }
|
|
101
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
+
var _a, projection, varPrams, variables, operationName, data, result;
|
|
103
|
+
return __generator(this, function (_b) {
|
|
104
|
+
switch (_b.label) {
|
|
105
|
+
case 0:
|
|
106
|
+
_a = params.projection, projection = _a === void 0 ? [] : _a, varPrams = __rest(params, ["projection"]);
|
|
107
|
+
variables = {
|
|
108
|
+
entity: constants_1.ENTITY_NAME,
|
|
109
|
+
params: __assign({ id: viewTemplateId }, varPrams),
|
|
110
|
+
};
|
|
111
|
+
operationName = 'getTemplate';
|
|
112
|
+
data = {
|
|
113
|
+
operationName: operationName,
|
|
114
|
+
query: (0, utils_1.getGetByIdQuery)({
|
|
115
|
+
projection: projection,
|
|
116
|
+
}),
|
|
117
|
+
variables: variables,
|
|
118
|
+
};
|
|
119
|
+
return [4, this.dataHub.makeRequest({
|
|
120
|
+
method: 'POST',
|
|
121
|
+
route: '/graphql',
|
|
122
|
+
data: data,
|
|
123
|
+
})];
|
|
124
|
+
case 1:
|
|
125
|
+
result = _b.sent();
|
|
126
|
+
return [2, result.data[operationName]];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
ViewTemplates.prototype.download = function (viewTemplateId, options) {
|
|
132
|
+
if (options === void 0) { options = {}; }
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var variables, operationName, data, result;
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
variables = {
|
|
139
|
+
entity: constants_1.ENTITY_NAME,
|
|
140
|
+
data: {
|
|
141
|
+
id: viewTemplateId,
|
|
142
|
+
body: __assign({}, options),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
operationName = 'downloadTo';
|
|
146
|
+
data = {
|
|
147
|
+
operationName: operationName,
|
|
148
|
+
query: constants_1.QUERY_DOWNLOAD_TO,
|
|
149
|
+
variables: variables,
|
|
150
|
+
};
|
|
151
|
+
return [4, this.dataHub.makeRequest({
|
|
152
|
+
method: 'POST',
|
|
153
|
+
route: '/graphql',
|
|
154
|
+
data: data,
|
|
155
|
+
})];
|
|
156
|
+
case 1:
|
|
157
|
+
result = _a.sent();
|
|
158
|
+
return [2, result.data[operationName]];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
ViewTemplates.prototype.upgrade = function (viewTemplateId, options) {
|
|
164
|
+
if (options === void 0) { options = {}; }
|
|
165
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
+
var variables, operationName, data, result;
|
|
167
|
+
return __generator(this, function (_a) {
|
|
168
|
+
switch (_a.label) {
|
|
169
|
+
case 0:
|
|
170
|
+
variables = {
|
|
171
|
+
entity: constants_1.ENTITY_NAME,
|
|
172
|
+
id: viewTemplateId,
|
|
173
|
+
options: options,
|
|
174
|
+
};
|
|
175
|
+
operationName = 'upgrade';
|
|
176
|
+
data = {
|
|
177
|
+
operationName: operationName,
|
|
178
|
+
query: constants_1.QUERY_UPGRADE,
|
|
179
|
+
variables: variables,
|
|
180
|
+
};
|
|
181
|
+
return [4, this.dataHub.makeRequest({
|
|
182
|
+
method: 'POST',
|
|
183
|
+
route: '/graphql',
|
|
184
|
+
data: data,
|
|
185
|
+
})];
|
|
186
|
+
case 1:
|
|
187
|
+
result = _a.sent();
|
|
188
|
+
return [2, result.data[operationName]];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
ViewTemplates.getNewViewTemplate = function () {
|
|
194
|
+
return (0, utils_1.getNewViewTemplate)();
|
|
195
|
+
};
|
|
196
|
+
return ViewTemplates;
|
|
197
|
+
}());
|
|
198
|
+
exports.ViewTemplates = ViewTemplates;
|
|
199
|
+
//# sourceMappingURL=ViewTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewTemplates.js","sourceRoot":"","sources":["../../src/ViewTemplates.ts"],"names":[],"m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,EAAE,OAAY;QAAZ,wBAAA,EAAA,YAAY;;;;;;wBACjD,SAAS,GAAG;4BAChB,MAAM,EAAE,uBAAW;4BACnB,EAAE,EAAE,cAAc;4BAClB,OAAO,SAAA;yBACR,CAAC;wBAEI,aAAa,GAAG,SAAS,CAAC;wBAE1B,IAAI,GAAG;4BACX,aAAa,eAAA;4BACb,KAAK,EAAE,yBAAa;4BACpB,SAAS,WAAA;yBACV,CAAC;wBAEa,WAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAmC;gCAC9E,MAAM,EAAE,MAAM;gCACd,KAAK,EAAE,UAAU;gCACjB,IAAI,MAAA;6BACL,CAAC,EAAA;;wBAJI,MAAM,GAAG,SAIb;wBAEF,WAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAE,EAAC;;;;KACpC;IAQa,gCAAkB,GAAhC;QACE,OAAO,IAAA,0BAAkB,GAAE,CAAC;IAC9B,CAAC;IAEH,oBAAC;AAAD,CAAC,AA7JD,IA6JC;AA7JY,sCAAa"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENTITY_NAME = exports.QUERY_UPGRADE = exports.QUERY_DOWNLOAD_TO = exports.DEFAULT_PROJECTION_GET_LIST = exports.DEFAULT_PROJECTION_LIST = void 0;
|
|
4
|
+
exports.DEFAULT_PROJECTION_LIST = [
|
|
5
|
+
'id',
|
|
6
|
+
'template',
|
|
7
|
+
'template.category',
|
|
8
|
+
'template.description',
|
|
9
|
+
'template.help',
|
|
10
|
+
'template.icon',
|
|
11
|
+
'template.iconUrl',
|
|
12
|
+
'template.implicitly',
|
|
13
|
+
'template.label',
|
|
14
|
+
'template.publishedBy',
|
|
15
|
+
'template.tags',
|
|
16
|
+
'template.type',
|
|
17
|
+
'template.version',
|
|
18
|
+
'cardIds',
|
|
19
|
+
];
|
|
20
|
+
exports.DEFAULT_PROJECTION_GET_LIST = [
|
|
21
|
+
'id',
|
|
22
|
+
'cardIds',
|
|
23
|
+
'linkId',
|
|
24
|
+
'mirrorCardIds',
|
|
25
|
+
'schemaVersion',
|
|
26
|
+
'dateCreated',
|
|
27
|
+
'dateModified',
|
|
28
|
+
'data',
|
|
29
|
+
'data.data',
|
|
30
|
+
'data.form',
|
|
31
|
+
'data.form.code',
|
|
32
|
+
'data.form.data',
|
|
33
|
+
'data.form.style',
|
|
34
|
+
'data.form.template',
|
|
35
|
+
'data.presentation',
|
|
36
|
+
'data.presentation.code',
|
|
37
|
+
'data.presentation.data',
|
|
38
|
+
'data.presentation.style',
|
|
39
|
+
'data.presentation.template',
|
|
40
|
+
'linkType',
|
|
41
|
+
'reference',
|
|
42
|
+
'template',
|
|
43
|
+
'template.category',
|
|
44
|
+
'template.description',
|
|
45
|
+
'template.help',
|
|
46
|
+
'template.icon',
|
|
47
|
+
'template.iconUrl',
|
|
48
|
+
'template.implicitly',
|
|
49
|
+
'template.label',
|
|
50
|
+
'template.publishedBy',
|
|
51
|
+
'template.tags',
|
|
52
|
+
'template.type',
|
|
53
|
+
'template.version',
|
|
54
|
+
'deletedDate @include(if: false)',
|
|
55
|
+
];
|
|
56
|
+
exports.QUERY_DOWNLOAD_TO = "mutation downloadTo($entity: TemplateType!, $data: DownloadInput!) {\n downloadTo(entity: $entity, data: $data) {\n ... on View {\n id\n cardIds\n linkId\n mirrorCardIds\n schemaVersion\n dateCreated\n dateModified\n data {\n data\n form {\n code\n data\n style\n template\n }\n presentation {\n code\n data\n style\n template\n }\n }\n linkType\n reference\n template {\n category\n description\n help\n icon\n iconUrl\n implicitly\n label\n publishedBy\n tags\n type\n version\n }\n deletedDate @include(if: false)\n }\n }\n}";
|
|
57
|
+
exports.QUERY_UPGRADE = "mutation upgrade($entity: TemplateType!, $id: String!, $options: UpgradeOptions) {\n upgrade(entity: $entity, id: $id, options: $options) {\n ... on View {\n id\n }\n }\n}\n";
|
|
58
|
+
exports.ENTITY_NAME = 'VIEW';
|
|
59
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG;IACrC,IAAI;IACJ,UAAU;IACV,mBAAmB;IACnB,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,qBAAqB;IACrB,gBAAgB;IAChB,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,SAAS;CACV,CAAC;AAEW,QAAA,2BAA2B,GAAG;IACzC,IAAI;IACJ,SAAS;IACT,QAAQ;IACR,eAAe;IACf,eAAe;IACf,aAAa;IACb,cAAc;IACd,MAAM;IACN,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,4BAA4B;IAC5B,UAAU;IACV,WAAW;IACX,UAAU;IACV,mBAAmB;IACnB,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,qBAAqB;IACrB,gBAAgB;IAChB,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,iCAAiC;CAClC,CAAC;AAEW,QAAA,iBAAiB,GAAG,uxBA2C/B,CAAC;AAEU,QAAA,aAAa,GAAG,oMAO5B,CAAC;AAEW,QAAA,WAAW,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ViewTemplates = void 0;
|
|
18
|
+
var ViewTemplates_1 = require("./ViewTemplates");
|
|
19
|
+
Object.defineProperty(exports, "ViewTemplates", { enumerable: true, get: function () { return ViewTemplates_1.ViewTemplates; } });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var data_hub_1 = require("@or-sdk/data-hub");
|
|
4
|
+
var constants_1 = require("../constants");
|
|
5
|
+
function getGetByIdQuery(_a) {
|
|
6
|
+
var _b = _a.projection, projection = _b === void 0 ? [] : _b;
|
|
7
|
+
return "query getTemplate($entity: TemplateType!, $params: GetInput!, $sourceId: String) {\n getTemplate(entity: $entity, params: $params, sourceId: $sourceId) {\n ... on View {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_GET_LIST), "\n }\n }\n}");
|
|
8
|
+
}
|
|
9
|
+
exports.default = getGetByIdQuery;
|
|
10
|
+
//# sourceMappingURL=getGetByIdQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGetByIdQuery.js","sourceRoot":"","sources":["../../../src/utils/getGetByIdQuery.ts"],"names":[],"mappings":";;AAAA,6CAA0D;AAC1D,0CAA2D;AAE3D,SAAS,eAAe,CAAC,EAA8C;QAA5C,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA;IACxC,OAAO,uLAEU,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uCAA2B,CAAC,oBAGrG,CAAC;AACH,CAAC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var data_hub_1 = require("@or-sdk/data-hub");
|
|
4
|
+
var constants_1 = require("../constants");
|
|
5
|
+
function getListQuery(_a) {
|
|
6
|
+
var _b = _a.projection, projection = _b === void 0 ? [] : _b;
|
|
7
|
+
return "query listTemplates($entity: TemplateType!, $params: ListInput!, $sourceId: String, $forceSandbox: Boolean) {\n listTemplates(entity: $entity, params: $params, sourceId: $sourceId, forceSandbox: $forceSandbox) {\n records {\n ... on View {".concat((0, data_hub_1.getQueryProjectionPart)(projection.length ? projection : constants_1.DEFAULT_PROJECTION_LIST), "\n }\n }\n last\n }\n}");
|
|
8
|
+
}
|
|
9
|
+
exports.default = getListQuery;
|
|
10
|
+
//# sourceMappingURL=getListQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getListQuery.js","sourceRoot":"","sources":["../../../src/utils/getListQuery.ts"],"names":[],"mappings":";;AAAA,6CAA0D;AAC1D,0CAAuD;AAEvD,SAAS,YAAY,CAAC,EAA8C;QAA5C,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA;IACrC,OAAO,kQAGY,IAAA,iCAAsB,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mCAAuB,CAAC,uCAKnG,CAAC;AACH,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function getNewViewTemplate() {
|
|
4
|
+
return {
|
|
5
|
+
cardIds: [],
|
|
6
|
+
data: {
|
|
7
|
+
data: {
|
|
8
|
+
allowCardsDragging: true,
|
|
9
|
+
allowCardsDraggingWhenReadOnly: false,
|
|
10
|
+
'background-color': '',
|
|
11
|
+
customBackgroundColor: {
|
|
12
|
+
fill: 'rgba(246, 246, 246, 0.5)',
|
|
13
|
+
hex: '#F6F6F6',
|
|
14
|
+
opacity: 1,
|
|
15
|
+
source: 'hex',
|
|
16
|
+
stroke: 'rgb(246, 246, 246)',
|
|
17
|
+
},
|
|
18
|
+
description: 'I\'m going to build my own view template',
|
|
19
|
+
destroyRejectedCards: true,
|
|
20
|
+
filterByTagIds: [],
|
|
21
|
+
filters: {
|
|
22
|
+
dates: {
|
|
23
|
+
rangeName: '30days',
|
|
24
|
+
},
|
|
25
|
+
queryParams: {},
|
|
26
|
+
timezone: {
|
|
27
|
+
text: 'UTC',
|
|
28
|
+
uiLabel: 'UTC',
|
|
29
|
+
value: 'UTC',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
label: 'My custom view template',
|
|
33
|
+
loadEntities: {},
|
|
34
|
+
navigationSection: {
|
|
35
|
+
name: 'Analytics',
|
|
36
|
+
link: {
|
|
37
|
+
name: 'Overview',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
showFilterByTagsButton: false,
|
|
41
|
+
showFilterByTagsButtonWhenReadOnly: false,
|
|
42
|
+
showViewLoadingStatus: false,
|
|
43
|
+
style: '',
|
|
44
|
+
useCustomBackgroundColor: false,
|
|
45
|
+
viewClasses: [],
|
|
46
|
+
viewLoadingStatus: {
|
|
47
|
+
progressType: 'circular',
|
|
48
|
+
slots: [
|
|
49
|
+
'aside-left',
|
|
50
|
+
'aside-right',
|
|
51
|
+
'footer',
|
|
52
|
+
'header',
|
|
53
|
+
'navigation',
|
|
54
|
+
],
|
|
55
|
+
message: '',
|
|
56
|
+
title: '',
|
|
57
|
+
flat: false,
|
|
58
|
+
showProgress: true,
|
|
59
|
+
errorOptionIds: [],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
form: {
|
|
63
|
+
code: 'return {\n computed: {\n allowCardsDragging: {\n get() {\n return this.userData.allowCardsDragging;\n },\n set(value) {\n this.setData([{\n "path": "allowCardsDragging",\n "newSetting": value\n }]);\n }\n },\n\n allowCardsDraggingWhenReadOnly: {\n get() {\n return this.userData.allowCardsDraggingWhenReadOnly;\n },\n set(value) {\n this.setData([{\n "path": "allowCardsDraggingWhenReadOnly",\n "newSetting": value\n }]);\n }\n },\n\n defaultColors() {\n return [{\n "hex": "#ffffff",\n "source": "hex",\n "fill": "rgba(255, 255, 255, 0.5)",\n "stroke": "rgba(255, 255, 255, 1)",\n "opacity": 1\n }];\n },\n\n destroyRejectedCards: {\n get() {\n return this.userData.destroyRejectedCards;\n },\n set(value) {\n this.setData([{\n "path": "destroyRejectedCards",\n "newSetting": value\n }]);\n }\n },\n\n layoutSlotOptions() {\n return _.get(this.formData, \'layoutSlotOptions\') || [];\n },\n\n loadBots: {\n get() {\n return _.get(this.userData, \'loadEntities.bots\', false);\n },\n set(value) {\n this.changeLoadEntities(\'bots\', value);\n }\n },\n\n loadFlows: {\n get() {\n return _.get(this.userData, \'loadEntities.flows\', false);\n },\n set(value) {\n this.changeLoadEntities(\'flows\', value);\n }\n },\n\n loadTags: {\n get() {\n return _.get(this.userData, \'loadEntities.tags\', false);\n },\n set(value) {\n this.changeLoadEntities(\'tags\', value);\n }\n },\n\n loadViews: {\n get() {\n return _.get(this.userData, \'loadEntities.views\', false);\n },\n set(value) {\n this.changeLoadEntities(\'views\', value);\n }\n },\n\n viewLoadingStatus: {\n get() {\n return this.userData.viewLoadingStatus || {\n slots: [],\n errorOptionIds: []\n };\n },\n set(value) {\n this.setData([{\n "path": "viewLoadingStatus",\n "newSetting": value\n }]);\n }\n },\n\n overrideLoadBots: {\n get() {\n return !_.isNil(_.get(this.userData, \'loadEntities.bots\'));\n },\n set(value) {\n this.changeOverrideLoadEntities(\'bots\', this.loadBots, value);\n }\n },\n\n overrideLoadFlows: {\n get() {\n return !_.isNil(_.get(this.userData, \'loadEntities.flows\'));\n },\n set(value) {\n this.changeOverrideLoadEntities(\'flows\', this.loadFlows, value);\n }\n },\n\n overrideLoadTags: {\n get() {\n return !_.isNil(_.get(this.userData, \'loadEntities.tags\'));\n },\n set(value) {\n this.changeOverrideLoadEntities(\'tags\', this.loadTags, value);\n }\n },\n\n overrideLoadViews: {\n get() {\n return !_.isNil(_.get(this.userData, \'loadEntities.views\'));\n },\n set(value) {\n this.changeOverrideLoadEntities(\'views\', this.loadViews, value);\n }\n },\n\n progressElementTypeOptions() {\n return _.get(this.formData, \'progressElementTypeOptions\') || [];\n },\n\n showFilterByTagsButton: {\n get() {\n return this.userData.showFilterByTagsButton;\n },\n set(value) {\n this.setData([{\n "path": "showFilterByTagsButton",\n "newSetting": value\n }]);\n }\n },\n\n showFilterByTagsButtonWhenReadOnly: {\n get() {\n return this.userData.showFilterByTagsButtonWhenReadOnly;\n },\n set(value) {\n this.setData([{\n "path": "showFilterByTagsButtonWhenReadOnly",\n "newSetting": value\n }]);\n }\n },\n\n showViewLoadingStatus: {\n get() {\n return _.get(this.userData, \'showViewLoadingStatus\', false);\n },\n set(value) {\n this.setData([{\n "path": "showViewLoadingStatus",\n "newSetting": value\n }]);\n }\n },\n\n userData() {\n return _.cloneDeep(this.viewData) || {};\n },\n\n viewBackgroundColor: {\n get() {\n const customBackgroundColor = this.userData.customBackgroundColor;\n return !_.isEmpty(this.defaultColors) && _.isEmpty(customBackgroundColor) ?\n this.defaultColors[0] :\n customBackgroundColor;\n },\n set(value) {\n this.setData([{\n "path": \'customBackgroundColor\',\n "newSetting": _.assign(value, {\n opacity: 1\n })\n }, {\n "path": \'background-color\',\n "newSetting": value.hex\n }]);\n }\n },\n\n viewLoadingStatusErrorOptions() {\n return _.get(this.formData, \'loadingStatusErrorOptions\') || [];\n },\n\n viewLoadingStatusTitlePlaceholder() {\n return _.isEmpty(this.viewLoadingStatusInput.title) ?\n _.get(this.userData, \'label\') :\n this.viewLoadingStatusInput.title;\n }\n },\n\n data() {\n return {\n colorPickerDisabledColor: {\n "hex": "#E9E9E9",\n "source": "hex",\n "fill": "rgba(233, 233, 233, 0.5)",\n "stroke": "rgb(233, 233, 233)"\n },\n showViewLoadingStatusTimeoutDefault: 10,\n showViewLoadingStatusTimeoutMax: 60,\n showViewLoadingStatusTimeoutMin: 1,\n styleInput: \'\',\n useCustomBackgroundColorInput: false,\n viewClassesObj: {},\n viewLoadingStatusInput: {\n slots: [],\n errorOptionIds: []\n }\n };\n },\n\n methods: {\n changeLoadEntities(entitiesType, value) {\n const newValue = _.cloneDeep(_.get(this.userData, \'loadEntities\')) || {};\n _.set(newValue, entitiesType, value);\n this.setData([{\n "path": "loadEntities",\n "newSetting": newValue\n }]);\n },\n\n changeOverrideLoadEntities(entitiesType, loadEntities, value) {\n const oldValue = _.get(this.userData, \'loadEntities\');\n const newValue = oldValue ? _.cloneDeep(oldValue) : {};\n if (value) {\n _.set(newValue, entitiesType, loadEntities == true);\n } else {\n _.unset(newValue, entitiesType);\n }\n if (!_.isEqual(newValue, oldValue)) {\n this.setData([{\n "path": "loadEntities",\n "newSetting": newValue\n }]);\n }\n },\n\n changeUseCustomBackgroundColor(value) {\n const backgroundColor = value ?\n _.get(this.userData, \'customBackgroundColor.hex\') :\n \'\';\n this.setData([{\n "path": "useCustomBackgroundColor",\n "newSetting": value\n }, {\n "path": "background-color",\n "newSetting": backgroundColor\n }]);\n },\n\n changeViewClasses(value, viewClasses) {\n const oldViewClasses = _.get(this.userData, \'viewClasses\', []);\n const fixedViewClasses = _.map(viewClasses, _.kebabCase);\n const newViewClasses = value ?\n _.uniq(_.concat(oldViewClasses, fixedViewClasses)) :\n _.reject(oldViewClasses, viewClass => _.includes(fixedViewClasses, viewClass));\n this.setData([{\n "path": "viewClasses",\n "newSetting": newViewClasses\n }]);\n },\n\n initViewClassesObj() {\n this.viewClassesObj = _.reduce(this.userData.viewClasses, (res, value) => {\n _.set(res, `${_.camelCase(value)}`, true);\n return res;\n }, {});\n },\n\n initViewLoadingStatusInput() {\n this.viewLoadingStatusInput = this.viewLoadingStatus;\n if (!_.has(this.viewLoadingStatusInput, \'slots\')) {\n _.set(this.viewLoadingStatusInput, \'slots\', []);\n }\n if (!_.has(this.viewLoadingStatusInput, \'errorOptionIds\')) {\n _.set(this.viewLoadingStatusInput, \'errorOptionIds\', []);\n }\n },\n\n saveStyles() {\n this.setData([{\n "path": "style",\n "newSetting": _.cloneDeep(this.styleInput)\n }]);\n },\n\n setData(changes) {\n try {\n const beforeChange = _.cloneDeep(this.viewData);\n const afterChange = _.cloneDeep(this.viewData);\n\n _.forEach(changes, item => {\n const path = _.get(item, \'path\');\n if (path && _.has(item, \'newSetting\')) {\n const newValue = _.get(item, \'newSetting\');\n const oldValue = _.get(beforeChange, path);\n if (!_.isEqual(newValue, oldValue)) {\n _.set(afterChange, path, newValue);\n }\n }\n });\n this.$emit(\'apply-new-settings\', afterChange);\n } catch (e) {\n console.log(e);\n }\n },\n\n updateViewLoadingStatus() {\n this.viewLoadingStatus = _.cloneDeep(this.viewLoadingStatusInput);\n },\n\n updateViewLoadingStatusTimeout(value) {\n const timeout = Number(value);\n if (_.isEmpty(value) || isNaN(timeout)) {\n this.viewLoadingStatusInput.timeout = undefined;\n } else {\n const fixedTimeout = Math.max(Math.min(timeout, this.showViewLoadingStatusTimeoutMax), this.showViewLoadingStatusTimeoutMin);\n if (fixedTimeout !== timeout) {\n this.viewLoadingStatusInput.timeout = fixedTimeout;\n }\n }\n this.updateViewLoadingStatus();\n }\n },\n\n mounted() {\n this.useCustomBackgroundColorInput = this.userData.useCustomBackgroundColor;\n this.initViewClassesObj();\n this.initViewLoadingStatusInput();\n this.styleInput = _.cloneDeep(this.userData.style) || \'\';\n },\n\n props: {\n formData: {\n type: Object,\n default: null\n },\n\n viewData: {\n type: Object,\n required: true\n }\n }\n}',
|
|
64
|
+
data: {
|
|
65
|
+
layoutSlotOptions: [
|
|
66
|
+
{
|
|
67
|
+
value: 'aside-left',
|
|
68
|
+
label: 'Aside Left',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: 'aside-right',
|
|
72
|
+
label: 'Aside Right',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: 'footer',
|
|
76
|
+
label: 'Footer',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
value: 'header',
|
|
80
|
+
label: 'Header',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: 'navigation',
|
|
84
|
+
label: 'Navigation',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
loadingStatusErrorOptions: [
|
|
88
|
+
{
|
|
89
|
+
value: 'reload-page',
|
|
90
|
+
label: 'Reload',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
value: 'sign-out',
|
|
94
|
+
label: 'Sign out',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
progressElementTypeOptions: [
|
|
98
|
+
{
|
|
99
|
+
value: 'circular',
|
|
100
|
+
label: 'Circular',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: 'linear',
|
|
104
|
+
label: 'Linear',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
style: '.form-wrapper {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n -webkit-justify-content: space-around;\n justify-content: space-around;\n}\n\n.form-row-with-label {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n}\n\n.form-row-label {\n font-size: 12px;\n color: #91969d;\n line-height: 36px;\n}\n\n.form-row {\n display: flex;\n flex-grow: 1;\n flex-direction: row;\n}\n\n.form-row-margin-bottom {\n margin-bottom: 20px;\n}\n\n.form-col {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n padding-right: 10px;\n \n &.narrow {\n flex-grow: 0;\n }\n \n &.custom-style {\n .or-code {\n margin-bottom: 12px;\n }\n }\n}\n\n.textbox-right-label {\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n margin-top: 36px;\n \n .ui-textbox {\n margin-bottom: 0;\n margin-right: 10px;\n width: 90px;\n }\n}\n\n.background-color-wrapper {\n display: flex;\n flex-direction: row;\n \n .color-picker {\n padding: 0 0 6px 12px;\n }\n}\n\n.override-load-all-entities {\n .ui-checkbox.load-all-entities {\n margin-left: 20px;\n }\n}\n',
|
|
109
|
+
template: '<div class="form-wrapper">\n <or-collapsible title="Layout" class="collapsible-view-data" open disable-ripple>\n <div class="form-row form-row-margin-bottom">\n <div class="form-col">\n <or-switch label="Show button Filter by Tags" v-model="showFilterByTagsButton"></or-switch>\n <or-switch v-if="showFilterByTagsButton === true" label="Show button Filter by Tags on shared View"\n v-model="showFilterByTagsButtonWhenReadOnly">\n </or-switch>\n </div>\n </div>\n <div class="form-row form-row-margin-bottom">\n <div class="form-col">\n <or-switch label="Enable cards dragging" v-model="allowCardsDragging"></or-switch>\n <or-switch v-if="allowCardsDragging === true" label="Enable cards dragging on shared View"\n v-model="allowCardsDraggingWhenReadOnly">\n </or-switch>\n </div>\n </div>\n <div class="form-row">\n <div class="form-col background-color-wrapper">\n <or-switch label="Change background color" v-model="useCustomBackgroundColorInput" \n class="switch-change-background-color"\n @change="changeUseCustomBackgroundColor">\n </or-switch>\n <or-color-picker v-if="useCustomBackgroundColorInput" v-model="viewBackgroundColor" \n class="small round" :default-colors="defaultColors" allow-advanced>\n </or-color-picker>\n <or-color-picker v-else readonly :value="colorPickerDisabledColor" \n class="small round" :default-colors="defaultColors">\n </or-color-picker>\n </div>\n </div>\n <div class="form-row form-row-margin-bottom">\n <div class="form-col item-view-classes-wrapper">\n <or-switch label="Hide margin outside card" v-model="viewClassesObj.gridCardsNoPadding" \n class="switch-change-view-classes-grid-cards-no-padding"\n @change="changeViewClasses($event, [\'gridNoMargin\', \'gridCardsNoPadding\'])">\n </or-switch>\n <or-switch label="Hide margin inside card" v-model="viewClassesObj.gridCardsNoCardPadding" \n class="switch-change-view-classes-grid-cards-no-card-padding"\n @change="changeViewClasses($event, [\'gridCardsNoCardPadding\'])">\n </or-switch>\n <or-switch label="Hide border of card" v-model="viewClassesObj.gridCardsNoBorder" \n class="switch-change-view-classes-grid-cards-no-border"\n @change="changeViewClasses($event, [\'gridCardsNoBorder\'])">\n </or-switch>\n </div>\n </div>\n <div class="form-row">\n <div class="form-col">\n <or-switch label="Destroy hidden cards" v-model="destroyRejectedCards" \n class="switch-destroy-hidden-cards">\n </or-switch>\n </div>\n </div>\n <div class="form-row">\n <div class="form-col custom-style">\n <or-code v-model="styleInput" label="View custom styles" mode="scss" @blur="saveStyles">\n </or-code>\n </div>\n </div>\n </or-collapsible>\n <or-collapsible title="Loading data status" class="collapsible-card-data" disable-ripple>\n <div class="form-row">\n <div class="form-col">\n <or-switch v-model="showViewLoadingStatus" class="switch-show-status"\n label="One or several card will show loading data status message on view opening">\n </or-switch>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row">\n <div class="form-col">\n <or-textbox label="Title" v-model="viewLoadingStatusInput.title" \n :placeholder="viewLoadingStatusTitlePlaceholder"\n @change="updateViewLoadingStatus">\n </or-textbox>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row">\n <div class="form-col">\n <or-textbox label="Message" v-model="viewLoadingStatusInput.message" \n placeholder="Loading"\n @change="updateViewLoadingStatus">\n </or-textbox>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row">\n <div class="form-col">\n <or-select-expression\n class="loading-status-error-handlers"\n label="Loading data standard error handlers" multiple simple-text\n v-model="viewLoadingStatusInput.errorOptionIds"\n :options="viewLoadingStatusErrorOptions"\n @input="updateViewLoadingStatus">\n </or-select-expression>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row">\n <div class="form-col">\n <or-switch label="Show progress element" v-model="viewLoadingStatusInput.showProgress" \n class="switch-show-status-progress"\n @change="updateViewLoadingStatus">\n </or-switch>\n </div>\n </div>\n <div v-if="showViewLoadingStatus && viewLoadingStatusInput.showProgress" class="form-row">\n <div class="form-col">\n <or-select label="Progress element type" v-model="viewLoadingStatusInput.progressType" \n :options="progressElementTypeOptions"\n @change="updateViewLoadingStatus">\n </or-select>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row">\n <div class="form-col">\n <or-select-expression\n class="navigation-link-filters"\n label="Hide cards in slots" multiple simple-text\n v-model="viewLoadingStatusInput.slots"\n :options="layoutSlotOptions"\n @input="updateViewLoadingStatus">\n </or-select-expression>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row">\n <div class="form-col">\n <or-switch label="Show status in box" v-model="viewLoadingStatusInput.flat" \n class="switch-show-status-in-box" \n :true-value="false" :false-value="true"\n @change="updateViewLoadingStatus">\n </or-switch>\n </div>\n </div>\n <div v-if="showViewLoadingStatus" class="form-row"> \n <div class="form-col">\n <or-textbox label="Timeout to wait status message from card in seconds"\n v-model="viewLoadingStatusInput.timeout" type="number" step="1"\n :placeholder="showViewLoadingStatusTimeoutDefault"\n :min="showViewLoadingStatusTimeoutMin" :max="showViewLoadingStatusTimeoutMax"\n @change="updateViewLoadingStatusTimeout">\n </or-textbox>\n </div>\n </div>\n </or-collapsible>\n <or-collapsible title="Load account entities on the view opening" class="collapsible-view-data" disable-ripple>\n <div class="form-row override-load-all-entities">\n <div class="form-col">\n <or-switch label="Override default behavior to load bots" \n v-model="overrideLoadBots">\n </or-switch>\n </div>\n </div>\n <div v-if="overrideLoadBots" class="form-row override-load-all-entities">\n <div class="form-col">\n <or-checkbox class="load-all-entities" label="Load all bots" \n v-model="loadBots">\n </or-checkbox>\n </div>\n </div>\n <div class="form-row override-load-all-entities">\n <div class="form-col">\n <or-switch label="Override default behavior to load flows" \n v-model="overrideLoadFlows">\n </or-switch>\n </div>\n </div>\n <div v-if="overrideLoadFlows" class="form-row override-load-all-entities">\n <div class="form-col">\n <or-checkbox class="load-all-entities" label="Load all flows" \n v-model="loadFlows">\n </or-checkbox>\n </div>\n </div>\n <div class="form-row override-load-all-entities">\n <div class="form-col">\n <or-switch label="Override default behavior to load views" \n v-model="overrideLoadViews">\n </or-switch>\n </div>\n </div>\n <div v-if="overrideLoadViews" class="form-row override-load-all-entities">\n <div class="form-col">\n <or-checkbox class="load-all-entities" label="Load all views" \n v-model="loadViews">\n </or-checkbox>\n </div>\n </div>\n <div class="form-row override-load-all-entities">\n <div class="form-col">\n <or-switch label="Override default behavior to load tags" \n v-model="overrideLoadTags">\n </or-switch>\n </div>\n </div>\n <div v-if="overrideLoadTags" class="form-row override-load-all-entities">\n <div class="form-col">\n <or-checkbox class="load-all-entities" label="Load all tags" \n v-model="loadTags">\n </or-checkbox>\n </div>\n </div>\n </or-collapsible>\n</div>',
|
|
110
|
+
},
|
|
111
|
+
presentation: {
|
|
112
|
+
code: "return {\n extends : Vue.component('or-grid-draggable')\n};",
|
|
113
|
+
data: null,
|
|
114
|
+
style: '',
|
|
115
|
+
template: '',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
template: {
|
|
119
|
+
category: '',
|
|
120
|
+
description: 'I\'m going to build my own view template',
|
|
121
|
+
help: '',
|
|
122
|
+
icon: '',
|
|
123
|
+
iconUrl: '',
|
|
124
|
+
label: 'My custom view template',
|
|
125
|
+
publishedBy: '',
|
|
126
|
+
tags: '',
|
|
127
|
+
version: '',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
exports.default = getNewViewTemplate;
|
|
132
|
+
//# sourceMappingURL=getNewViewTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNewViewTemplate.js","sourceRoot":"","sources":["../../../src/utils/getNewViewTemplate.ts"],"names":[],"mappings":";;AAAA,SAAS,kBAAkB;IACzB,OAAO;QACL,OAAO,EAAE,EAAE;QACX,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,kBAAkB,EAAE,IAAI;gBACxB,8BAA8B,EAAE,KAAK;gBACrC,kBAAkB,EAAE,EAAE;gBACtB,qBAAqB,EAAE;oBACrB,IAAI,EAAE,0BAA0B;oBAChC,GAAG,EAAE,SAAS;oBACd,OAAO,EAAE,CAAC;oBACV,MAAM,EAAE,KAAK;oBACb,MAAM,EAAE,oBAAoB;iBAC7B;gBACD,WAAW,EAAE,0CAA0C;gBACvD,oBAAoB,EAAE,IAAI;gBAC1B,cAAc,EAAE,EAAE;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,SAAS,EAAE,QAAQ;qBACpB;oBACD,WAAW,EAAE,EAAE;oBACf,QAAQ,EAAE;wBACR,IAAI,EAAE,KAAK;wBACX,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,KAAK;qBACb;iBACF;gBACD,KAAK,EAAE,yBAAyB;gBAChC,YAAY,EAAE,EAAE;gBAChB,iBAAiB,EAAE;oBACjB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE;wBACJ,IAAI,EAAE,UAAU;qBACjB;iBACF;gBACD,sBAAsB,EAAE,KAAK;gBAC7B,kCAAkC,EAAE,KAAK;gBACzC,qBAAqB,EAAE,KAAK;gBAC5B,KAAK,EAAE,EAAE;gBACT,wBAAwB,EAAE,KAAK;gBAC/B,WAAW,EAAE,EAAE;gBACf,iBAAiB,EAAE;oBACjB,YAAY,EAAE,UAAU;oBACxB,KAAK,EAAE;wBACL,YAAY;wBACZ,aAAa;wBACb,QAAQ;wBACR,QAAQ;wBACR,YAAY;qBACb;oBACD,OAAO,EAAE,EAAE;oBACX,KAAK,EAAE,EAAE;oBACT,I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AE;SACZ;KACF,CAAC;AACJ,CAAC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getNewViewTemplate = exports.getGetByIdQuery = exports.getListQuery = void 0;
|
|
7
|
+
var getListQuery_1 = require("./getListQuery");
|
|
8
|
+
Object.defineProperty(exports, "getListQuery", { enumerable: true, get: function () { return __importDefault(getListQuery_1).default; } });
|
|
9
|
+
var getGetByIdQuery_1 = require("./getGetByIdQuery");
|
|
10
|
+
Object.defineProperty(exports, "getGetByIdQuery", { enumerable: true, get: function () { return __importDefault(getGetByIdQuery_1).default; } });
|
|
11
|
+
var getNewViewTemplate_1 = require("./getNewViewTemplate");
|
|
12
|
+
Object.defineProperty(exports, "getNewViewTemplate", { enumerable: true, get: function () { return __importDefault(getNewViewTemplate_1).default; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;AAIA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB"}
|