@gravitee/ui-components 3.28.7 → 3.28.8-debug-mode-add-menu-72c771a
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/package.json +16 -16
- package/src/atoms/gv-button/gv-button.d.ts +3 -3
- package/src/atoms/gv-checkbox/gv-checkbox.d.ts +3 -3
- package/src/atoms/gv-date-picker-calendar/gv-date-picker-calendar.d.ts +4 -4
- package/src/atoms/gv-input/gv-input.d.ts +5 -5
- package/src/atoms/gv-message/gv-message.d.ts +1 -1
- package/src/atoms/gv-select/gv-select.d.ts +2 -2
- package/src/atoms/gv-select-native/gv-select-native.d.ts +3 -3
- package/src/atoms/gv-text/gv-text.d.ts +2 -2
- package/src/charts/gv-chart-bar/gv-chart-bar.d.ts +1 -1
- package/src/charts/gv-chart-gauge/gv-chart-gauge.d.ts +1 -1
- package/src/charts/gv-chart-histogram/gv-chart-histogram.d.ts +1 -1
- package/src/charts/gv-chart-line/gv-chart-line.d.ts +1 -1
- package/src/charts/gv-chart-map/gv-chart-map.d.ts +1 -1
- package/src/charts/gv-chart-pie/gv-chart-pie.d.ts +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/events.d.ts +4 -1
- package/src/lib/events.js +0 -1
- package/src/lib/events.js.map +1 -1
- package/src/mixins/chart-element.d.ts +1 -1
- package/src/mixins/input-element.d.ts +1 -1
- package/src/mixins/item-resource.d.ts +3 -3
- package/src/molecules/gv-card/gv-card.d.ts +4 -4
- package/src/molecules/gv-card-full/gv-card-full.d.ts +4 -4
- package/src/molecules/gv-card-list/gv-card-list.d.ts +2 -2
- package/src/molecules/gv-category/gv-category.d.ts +1 -1
- package/src/molecules/gv-cron-editor/gv-cron-editor.d.ts +3 -3
- package/src/molecules/gv-list/gv-list.d.ts +5 -5
- package/src/molecules/gv-metrics/gv-metrics.d.ts +2 -2
- package/src/molecules/gv-modal/gv-modal.stories.d.ts +1 -1
- package/src/molecules/gv-nav/gv-nav.d.ts +1 -1
- package/src/molecules/gv-option/gv-option.d.ts +1 -1
- package/src/molecules/gv-plans/gv-plans.d.ts +1 -1
- package/src/molecules/gv-popover/gv-popover.d.ts +1 -1
- package/src/molecules/gv-promote/gv-promote.d.ts +4 -4
- package/src/molecules/gv-rating/gv-rating.d.ts +1 -1
- package/src/molecules/gv-rating-list/gv-rating-list.d.ts +2 -2
- package/src/molecules/gv-row/gv-row.d.ts +1 -1
- package/src/molecules/gv-stats/gv-stats.d.ts +2 -2
- package/src/molecules/gv-stepper/gv-stepper.d.ts +2 -2
- package/src/molecules/gv-table/gv-table.d.ts +8 -8
- package/src/molecules/gv-tree/gv-tree.d.ts +1 -1
- package/src/organisms/gv-documentation/gv-documentation.d.ts +1 -1
- package/src/organisms/gv-header/gv-header.d.ts +3 -3
- package/src/organisms/gv-http-client/gv-http-client.d.ts +4 -4
- package/src/organisms/gv-http-client/gv-http-client.stories.d.ts +1 -1
- package/src/organisms/gv-menu/gv-menu.d.ts +1 -1
- package/src/organisms/gv-pagination/gv-pagination.d.ts +1 -1
- package/src/organisms/gv-properties/gv-properties.d.ts +8 -8
- package/src/organisms/gv-properties/gv-properties.js +8 -5
- package/src/organisms/gv-properties/gv-properties.js.map +1 -1
- package/src/organisms/gv-resources/gv-resources.d.ts +6 -11
- package/src/organisms/gv-resources/gv-resources.js +9 -8
- package/src/organisms/gv-resources/gv-resources.js.map +1 -1
- package/src/organisms/gv-schema-form/gv-schema-form.d.ts +2 -2
- package/src/organisms/gv-schema-form/gv-schema-form.js +9 -4
- package/src/organisms/gv-schema-form/gv-schema-form.js.map +1 -1
- package/src/organisms/gv-schema-form/gv-schema-form.test.js +15 -0
- package/src/organisms/gv-schema-form/gv-schema-form.test.js.map +1 -1
- package/src/organisms/gv-schema-form-array/gv-schema-form-array.d.ts +2 -2
- package/src/organisms/gv-schema-form-control/gv-schema-form-control.d.ts +2 -1
- package/src/organisms/gv-schema-form-control/gv-schema-form-control.js +9 -1
- package/src/organisms/gv-schema-form-control/gv-schema-form-control.js.map +1 -1
- package/src/organisms/gv-schema-form-control-object/gv-schema-form-control-object.d.ts +2 -2
- package/src/organisms/gv-user-menu/gv-user-menu.d.ts +1 -1
- package/src/policy-studio/gv-design/gv-design.d.ts +368 -0
- package/src/policy-studio/gv-design/gv-design.js +1491 -0
- package/src/policy-studio/gv-design/gv-design.js.map +1 -0
- package/src/policy-studio/gv-design/gv-design.stories.d.ts +203 -0
- package/src/policy-studio/gv-design/gv-design.stories.js +233 -0
- package/src/policy-studio/gv-design/gv-design.stories.js.map +1 -0
- package/src/policy-studio/gv-design/gv-design.test.d.ts +1 -0
- package/src/policy-studio/gv-design/gv-design.test.js +333 -0
- package/src/policy-studio/gv-design/gv-design.test.js.map +1 -0
- package/src/policy-studio/gv-design/index.d.ts +1 -0
- package/src/policy-studio/gv-design/index.js +17 -0
- package/src/policy-studio/gv-design/index.js.map +1 -0
- package/src/policy-studio/gv-flow/gv-flow.d.ts +2 -2
- package/src/policy-studio/gv-flow-step/gv-flow-step.d.ts +2 -2
- package/src/policy-studio/gv-policy-studio/gv-policy-studio.d.ts +9 -9
- package/src/policy-studio/gv-policy-studio/gv-policy-studio.js +3 -0
- package/src/policy-studio/gv-policy-studio/gv-policy-studio.js.map +1 -1
- package/src/policy-studio/gv-policy-studio-menu/gv-policy-studio-menu.d.ts +3 -3
- package/wc/gv-design.d.ts +1 -0
- package/wc/gv-design.js +2 -0
- package/wc/gv-design.js.map +1 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
/*
|
|
11
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
import { afterEach, beforeEach, describe, expect, test, jest } from '@jest/globals';
|
|
26
|
+
import { Page, querySelector } from '../../../testing/lib/test-utils';
|
|
27
|
+
import definition from '../../../testing/resources/apim-definition.json';
|
|
28
|
+
import policies from '../../../testing/resources/apim-policies.json';
|
|
29
|
+
import resourceTypes from '../../../testing/resources/apim-resource-types.json';
|
|
30
|
+
import './gv-design';
|
|
31
|
+
import apimFlowSchema from '../../../testing/resources/schemas/apim-flow.json';
|
|
32
|
+
describe('D E S I G N', () => {
|
|
33
|
+
let page, component;
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
page = new Page();
|
|
36
|
+
component = page.create('gv-design', {});
|
|
37
|
+
component.policies = policies.data;
|
|
38
|
+
component.resourceTypes = resourceTypes.data;
|
|
39
|
+
component.flowSchema = {};
|
|
40
|
+
});
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
page.clear();
|
|
43
|
+
});
|
|
44
|
+
describe('C O M M O N', () => {
|
|
45
|
+
test('should create element', () => {
|
|
46
|
+
expect(window.customElements.get('gv-design')).toBeDefined();
|
|
47
|
+
const element = querySelector('gv-design');
|
|
48
|
+
expect(element).toBeDefined();
|
|
49
|
+
expect(element.definedFlows.length).toEqual(0);
|
|
50
|
+
expect(element.definedResources.length).toEqual(0);
|
|
51
|
+
expect(element.definedProperties).toBeDefined();
|
|
52
|
+
});
|
|
53
|
+
test('should dispatch fetch-documentation when open documentation from menu', (done) => {
|
|
54
|
+
const policy = { id: 'rate-limit', name: 'Rate Limit' };
|
|
55
|
+
component.policies = [policy];
|
|
56
|
+
component.addEventListener('gv-design:fetch-documentation', (e) => {
|
|
57
|
+
expect(e).toBeDefined();
|
|
58
|
+
done();
|
|
59
|
+
});
|
|
60
|
+
component._onOpenDocumentationFromMenu({ detail: { policy } });
|
|
61
|
+
});
|
|
62
|
+
test('should not updated when _dragPolicy change', (done) => {
|
|
63
|
+
component.updated = jest.fn();
|
|
64
|
+
component._dragPolicy = { policy: 'foobar' };
|
|
65
|
+
component.updateComplete.then(() => {
|
|
66
|
+
expect(component.updated.mock.calls.length).toBe(0);
|
|
67
|
+
done();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
test('should not updated when _dropPolicy change', (done) => {
|
|
71
|
+
component.updated = jest.fn();
|
|
72
|
+
component._dropPolicy = { policy: 'foobar' };
|
|
73
|
+
component.updateComplete.then(() => {
|
|
74
|
+
expect(component.updated.mock.calls.length).toBe(0);
|
|
75
|
+
done();
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('A P I M', () => {
|
|
80
|
+
beforeEach(() => {
|
|
81
|
+
component.definition = definition;
|
|
82
|
+
});
|
|
83
|
+
test('should find flow by id', () => {
|
|
84
|
+
const flowIdFromApiDefinition = component.definition.flows[0]._id;
|
|
85
|
+
const flowIdFromPlanDefinition = component.definition.plans[1].flows[0]._id;
|
|
86
|
+
expect(component._findFlowById(flowIdFromApiDefinition)).not.toBeNull();
|
|
87
|
+
expect(component._findFlowById(flowIdFromPlanDefinition)).not.toBeNull();
|
|
88
|
+
});
|
|
89
|
+
test('should find collection of flow', (done) => {
|
|
90
|
+
const flowIdFromApiDefinition = component.definition.flows[0]._id;
|
|
91
|
+
const flowIdFromPlanDefinition = component.definition.plans[1].flows[0]._id;
|
|
92
|
+
component.updateComplete.then(() => {
|
|
93
|
+
expect(component._findFlowCollection(flowIdFromApiDefinition)).toEqual({
|
|
94
|
+
plan: undefined,
|
|
95
|
+
flows: component.definition.flows,
|
|
96
|
+
});
|
|
97
|
+
expect(component._findFlowCollection(flowIdFromPlanDefinition)).toEqual({
|
|
98
|
+
plan: component.definition.plans[1],
|
|
99
|
+
flows: component.definition.plans[1].flows,
|
|
100
|
+
});
|
|
101
|
+
done();
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
test('should delete flow from plan', () => {
|
|
105
|
+
const flow = component.definition.plans[1].flows[0];
|
|
106
|
+
expect(component.definition.plans[1].flows.length).toEqual(3);
|
|
107
|
+
expect(component.definition.flows.length).toEqual(3);
|
|
108
|
+
component._onDeleteFlow({ detail: { content: Object.assign({}, flow) } });
|
|
109
|
+
expect(component.definition.plans[1].flows.length).toEqual(2);
|
|
110
|
+
expect(component.definition.flows.length).toEqual(3);
|
|
111
|
+
});
|
|
112
|
+
test('should add flow plan', (done) => {
|
|
113
|
+
expect(component.definition.plans[1].flows.length).toEqual(3);
|
|
114
|
+
expect(component.getSelectedFlow()).toBeDefined();
|
|
115
|
+
component.flowSchema = {
|
|
116
|
+
type: 'object',
|
|
117
|
+
id: 'apim',
|
|
118
|
+
properties: {
|
|
119
|
+
name: {
|
|
120
|
+
title: 'Name',
|
|
121
|
+
description: 'The name of flow. If empty, the name will be generated with the path and methods',
|
|
122
|
+
type: 'string',
|
|
123
|
+
},
|
|
124
|
+
'path-operator': {
|
|
125
|
+
type: 'object',
|
|
126
|
+
title: 'Path',
|
|
127
|
+
properties: {
|
|
128
|
+
operator: {
|
|
129
|
+
title: 'Operator path',
|
|
130
|
+
description: 'The operator path',
|
|
131
|
+
type: 'string',
|
|
132
|
+
enum: ['EQUALS', 'STARTS_WITH'],
|
|
133
|
+
default: 'STARTS_WITH',
|
|
134
|
+
'x-schema-form': {
|
|
135
|
+
titleMap: {
|
|
136
|
+
EQUALS: 'Equals',
|
|
137
|
+
STARTS_WITH: 'Starts with',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
path: {
|
|
142
|
+
title: 'Path',
|
|
143
|
+
description: 'The path of flow (must start by /)',
|
|
144
|
+
type: 'string',
|
|
145
|
+
pattern: '^/',
|
|
146
|
+
default: '/',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
required: ['path', 'operator'],
|
|
150
|
+
},
|
|
151
|
+
methods: {
|
|
152
|
+
title: 'Methods',
|
|
153
|
+
description: 'The HTTP methods of flow (ALL if empty)',
|
|
154
|
+
type: 'array',
|
|
155
|
+
items: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
enum: ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
condition: {
|
|
161
|
+
title: 'Condition',
|
|
162
|
+
description: 'The extra condition of flow',
|
|
163
|
+
type: 'string',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
required: [],
|
|
167
|
+
disabled: [],
|
|
168
|
+
};
|
|
169
|
+
component.updateComplete
|
|
170
|
+
.then(() => component._onAddFlowPlan({ detail: { planIndex: 1 } }))
|
|
171
|
+
.then(() => component.updateComplete)
|
|
172
|
+
.then(() => {
|
|
173
|
+
expect(component.definition.plans[1].flows.length).toEqual(4);
|
|
174
|
+
const createdFlow = component.definition.plans[1].flows[3];
|
|
175
|
+
expect(createdFlow._dirty).toEqual(true);
|
|
176
|
+
expect(createdFlow.name).toEqual('');
|
|
177
|
+
expect(createdFlow.post).toEqual([]);
|
|
178
|
+
expect(createdFlow.pre).toEqual([]);
|
|
179
|
+
expect(createdFlow._id).toBeDefined();
|
|
180
|
+
expect(createdFlow['path-operator']).toBeDefined();
|
|
181
|
+
expect(createdFlow['path-operator'].operator).toBeDefined();
|
|
182
|
+
expect(createdFlow['path-operator'].path).toBeDefined();
|
|
183
|
+
expect(createdFlow.type).not.toBeDefined();
|
|
184
|
+
done();
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
test('should create element with definition', () => {
|
|
188
|
+
expect(component.definedFlows.length).toEqual(3);
|
|
189
|
+
expect(component.definedResources.length).toEqual(1);
|
|
190
|
+
expect(Object.keys(component.definedProperties).length).toEqual(3);
|
|
191
|
+
expect(component.definedFlows[0]._id).toBeDefined();
|
|
192
|
+
expect(component.definedResources[0]._id).toBeDefined();
|
|
193
|
+
expect(component.selectedFlowsId.length).toEqual(1);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
describe('F L O W S', () => {
|
|
197
|
+
test('should add flow', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
198
|
+
component.definition = { flows: [] };
|
|
199
|
+
component.flowSchema = {
|
|
200
|
+
type: 'object',
|
|
201
|
+
id: 'am',
|
|
202
|
+
properties: {
|
|
203
|
+
name: {
|
|
204
|
+
title: 'Name',
|
|
205
|
+
description: 'The name of flow. If empty, the name will be generated with the path and methods',
|
|
206
|
+
type: 'string',
|
|
207
|
+
default: 'New Flow',
|
|
208
|
+
},
|
|
209
|
+
type: {
|
|
210
|
+
title: 'Type',
|
|
211
|
+
description: 'The type of flow',
|
|
212
|
+
type: 'string',
|
|
213
|
+
default: 'ROOT',
|
|
214
|
+
enum: ['ROOT', 'LOGIN', 'CONSENT', 'REGISTER'],
|
|
215
|
+
},
|
|
216
|
+
condition: {
|
|
217
|
+
title: 'Condition',
|
|
218
|
+
description: 'The condition of flow',
|
|
219
|
+
type: 'string',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
required: [],
|
|
223
|
+
disabled: [],
|
|
224
|
+
};
|
|
225
|
+
yield component._onAddFlow();
|
|
226
|
+
expect(component.definition.flows.length).toEqual(1);
|
|
227
|
+
const createdFlow = component.definition.flows[0];
|
|
228
|
+
expect(createdFlow._dirty).toEqual(true);
|
|
229
|
+
expect(createdFlow._id).toBeDefined();
|
|
230
|
+
expect(createdFlow.name).toEqual('New Flow');
|
|
231
|
+
expect(createdFlow.post).toEqual([]);
|
|
232
|
+
expect(createdFlow.pre).toEqual([]);
|
|
233
|
+
expect(createdFlow.type).toEqual('ROOT');
|
|
234
|
+
expect(createdFlow['path-operator']).not.toBeDefined();
|
|
235
|
+
}));
|
|
236
|
+
test('should duplicate flow', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
237
|
+
const flow = { _id: 'f-1', name: 'ALL', post: [{ policy: 'rate-limit', name: 'Rate limit' }], pre: [] };
|
|
238
|
+
component.definition = { flows: [flow] };
|
|
239
|
+
yield component.updateComplete;
|
|
240
|
+
yield component._onDuplicateFlow({ detail: { content: Object.assign({}, flow) } });
|
|
241
|
+
const expected = Object.assign(Object.assign({}, flow), { _dirty: true, _id: expect.any(String), id: null, post: [{ _id: expect.any(String), policy: 'rate-limit', name: 'Rate limit' }] });
|
|
242
|
+
expect(component.definition.flows.length).toEqual(2);
|
|
243
|
+
expect(component.definition.flows[1]).toEqual(expected);
|
|
244
|
+
}));
|
|
245
|
+
test('should delete flow', () => {
|
|
246
|
+
const flow = { _id: 'foobar', name: 'ALL', post: [{ policy: 'rate-limit', name: 'Rate limit' }], pre: [] };
|
|
247
|
+
component.definition = { flows: [flow] };
|
|
248
|
+
component._onDeleteFlow({ detail: { content: Object.assign({}, flow) } });
|
|
249
|
+
expect(component.definition.flows.length).toEqual(0);
|
|
250
|
+
});
|
|
251
|
+
test('should update definition when submit schema form with updated flow', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
252
|
+
const _id = 'foobar';
|
|
253
|
+
const flow = { _id, name: 'New flow', condition: '#method == "POST"' };
|
|
254
|
+
component.definition = { flows: [flow] };
|
|
255
|
+
yield component._onSelectFlows({ detail: { flows: [flow._id] } });
|
|
256
|
+
const updatedFlow = {
|
|
257
|
+
name: 'Updated flow',
|
|
258
|
+
description: 'more....',
|
|
259
|
+
methods: ['GET', 'POST'],
|
|
260
|
+
'path-operator': { path: '/', operator: 'STARTS_WITH' },
|
|
261
|
+
};
|
|
262
|
+
component._onSubmitFlow({ detail: { values: updatedFlow } });
|
|
263
|
+
expect(component.definition.flows.length).toEqual(1);
|
|
264
|
+
expect(component.definition.flows[0]._dirty).toEqual(true);
|
|
265
|
+
expect(component.definition.flows[0]._id).toEqual(_id);
|
|
266
|
+
expect(component.definition.flows[0].name).toEqual(updatedFlow.name);
|
|
267
|
+
expect(component.definition.flows[0]['path-operator']).toEqual({ path: '/', operator: 'STARTS_WITH' });
|
|
268
|
+
expect(component.definition.flows[0].methods).toEqual(['GET', 'POST']);
|
|
269
|
+
}));
|
|
270
|
+
test('should update definition when submit flow schema', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
271
|
+
const _id = 'foobar';
|
|
272
|
+
const _stepId = 'f_0_pre_0';
|
|
273
|
+
const step = { _id: _stepId, name: 'step', description: 'step description', configuration: {}, policy: 'api-key' };
|
|
274
|
+
const flow = {
|
|
275
|
+
_id,
|
|
276
|
+
name: 'New flow',
|
|
277
|
+
description: 'test',
|
|
278
|
+
condition: '#method == "POST"',
|
|
279
|
+
pre: [step],
|
|
280
|
+
post: [],
|
|
281
|
+
};
|
|
282
|
+
component.definition = { flows: [flow] };
|
|
283
|
+
yield component._onSelectFlows({ detail: { flows: [flow._id] } });
|
|
284
|
+
const policy = policies.data.find((p) => p.id === 'policy-http-callout');
|
|
285
|
+
const flowStepSchema = component.buildSchema(policy);
|
|
286
|
+
const currentFlowStep = { flow, step, policy, group: 'pre', position: 0 };
|
|
287
|
+
yield component._setCurrentFlowStep(currentFlowStep, flowStepSchema);
|
|
288
|
+
const cases = [
|
|
289
|
+
['updated description', 'http://localhost', 'GET'],
|
|
290
|
+
['', 'http://localhost/api', 'POST'],
|
|
291
|
+
['simple description', 'http://localhost:8080', 'PUT'],
|
|
292
|
+
];
|
|
293
|
+
for (const [commonDescription, url, method] of cases) {
|
|
294
|
+
const values = { commonDescription, method, url };
|
|
295
|
+
yield component._onSubmitFlowStep({ detail: { values } });
|
|
296
|
+
expect(component.definition.flows.length).toEqual(1);
|
|
297
|
+
expect(component.definition.flows[0]._id).toEqual(_id);
|
|
298
|
+
expect([...component.definition.flows[0].pre]).toMatchObject([
|
|
299
|
+
Object.assign(Object.assign({}, step), { description: commonDescription, configuration: { method, url } }),
|
|
300
|
+
]);
|
|
301
|
+
}
|
|
302
|
+
}));
|
|
303
|
+
test('should reset field', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
304
|
+
component.flowSchema = apimFlowSchema;
|
|
305
|
+
const _id = 'foobar';
|
|
306
|
+
const _stepId = 'foobar-step';
|
|
307
|
+
const step = { _id: _stepId, name: 'step', description: 'step description', configuration: {}, policy: 'api-key' };
|
|
308
|
+
const flow = {
|
|
309
|
+
_id,
|
|
310
|
+
name: 'New flow',
|
|
311
|
+
description: 'test',
|
|
312
|
+
condition: '#method == "POST"',
|
|
313
|
+
pre: [step],
|
|
314
|
+
post: [],
|
|
315
|
+
};
|
|
316
|
+
const values = {
|
|
317
|
+
_id,
|
|
318
|
+
description: 'test',
|
|
319
|
+
pre: [step],
|
|
320
|
+
post: [],
|
|
321
|
+
};
|
|
322
|
+
component.definition = { flows: [flow] };
|
|
323
|
+
yield component._onSelectFlows({ detail: { flows: [flow._id] } });
|
|
324
|
+
// execute update
|
|
325
|
+
yield component._onSubmitFlow({ detail: { values } });
|
|
326
|
+
expect(component.definition.flows.length).toEqual(1);
|
|
327
|
+
expect(component.definition.flows[0]._id).toEqual(_id);
|
|
328
|
+
expect(component.definition.flows[0].name).toEqual('');
|
|
329
|
+
expect(component.definition.flows[0].condition).toEqual('');
|
|
330
|
+
}));
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
//# sourceMappingURL=gv-design.test.js.map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GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAElE,iBAAiB;YACjB,MAAM,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YAEtD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACvD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACvD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gv-design';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './gv-design';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/policy-studio/gv-design/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,aAAa,CAAC"}
|
|
@@ -80,9 +80,9 @@ export class GvFlow extends LitElement {
|
|
|
80
80
|
_onChangeStepState(flowKey: any, position: any, { detail }: {
|
|
81
81
|
detail: any;
|
|
82
82
|
}): void;
|
|
83
|
-
_renderDropStep(group: any, step: any, position: any): import("lit
|
|
83
|
+
_renderDropStep(group: any, step: any, position: any): import("lit").TemplateResult<1>;
|
|
84
84
|
onDragEnd(): void;
|
|
85
|
-
_getLabel(flowKey: any): "" | import("lit
|
|
85
|
+
_getLabel(flowKey: any): "" | import("lit").TemplateResult<1> | "response" | "request";
|
|
86
86
|
get collectionName(): any;
|
|
87
87
|
findPolicy(policyId: any): any;
|
|
88
88
|
}
|
|
@@ -123,10 +123,10 @@ export class GvFlowStep extends GvFlowStep_base {
|
|
|
123
123
|
_onChangeState({ detail }: {
|
|
124
124
|
detail: any;
|
|
125
125
|
}): void;
|
|
126
|
-
_renderDropdownMenu(): import("lit
|
|
126
|
+
_renderDropdownMenu(): import("lit").TemplateResult<1>;
|
|
127
127
|
resetConfirm(): void;
|
|
128
128
|
confirm: boolean | undefined;
|
|
129
|
-
render(): import("lit
|
|
129
|
+
render(): import("lit").TemplateResult<1>;
|
|
130
130
|
title: any;
|
|
131
131
|
}
|
|
132
132
|
export class PolicyDraggable {
|
|
@@ -331,10 +331,10 @@ export class GvPolicyStudio extends GvPolicyStudio_base {
|
|
|
331
331
|
_onDragStartFlowStep(flow: any, { detail }: {
|
|
332
332
|
detail: any;
|
|
333
333
|
}): void;
|
|
334
|
-
_renderFlowEmptyState(readonlyMode: any): import("lit
|
|
335
|
-
_renderFlow(index: number | undefined, hasEmptyState: boolean | undefined, readonlyMode: any): import("lit
|
|
334
|
+
_renderFlowEmptyState(readonlyMode: any): import("lit").TemplateResult<1>;
|
|
335
|
+
_renderFlow(index: number | undefined, hasEmptyState: boolean | undefined, readonlyMode: any): import("lit").TemplateResult<1>;
|
|
336
336
|
_onFetchResources(event: any): void;
|
|
337
|
-
_renderPolicy(readonlyMode: any): import("lit
|
|
337
|
+
_renderPolicy(readonlyMode: any): import("lit").TemplateResult<1>;
|
|
338
338
|
_getFlowStepForm(): any;
|
|
339
339
|
_onResetFlowStep(): void;
|
|
340
340
|
_generateFlowsId(list: any, force?: boolean): any;
|
|
@@ -345,7 +345,7 @@ export class GvPolicyStudio extends GvPolicyStudio_base {
|
|
|
345
345
|
getUpdateComplete(): Promise<void>;
|
|
346
346
|
shouldUpdate(changedProperties: any): any;
|
|
347
347
|
updated(props: any): void;
|
|
348
|
-
_renderFlowStepForm(readonlyMode: any): import("lit
|
|
348
|
+
_renderFlowStepForm(readonlyMode: any): import("lit").TemplateResult<1>;
|
|
349
349
|
_onCloseDocumentation(): void;
|
|
350
350
|
documentation: any;
|
|
351
351
|
_onDeleteFlow({ detail }: {
|
|
@@ -412,10 +412,10 @@ export class GvPolicyStudio extends GvPolicyStudio_base {
|
|
|
412
412
|
_onFilterPolicies({ detail }: {
|
|
413
413
|
detail: any;
|
|
414
414
|
}): void;
|
|
415
|
-
_renderDesign(readonlyMode: any): import("lit
|
|
416
|
-
_renderDebug(): import("lit
|
|
417
|
-
_renderConfigurationForm(readonlyMode: any): import("lit
|
|
418
|
-
_renderFlowForm(readonlyMode: any): import("lit
|
|
415
|
+
_renderDesign(readonlyMode: any): import("lit").TemplateResult<1>;
|
|
416
|
+
_renderDebug(): import("lit").TemplateResult<1>;
|
|
417
|
+
_renderConfigurationForm(readonlyMode: any): import("lit").TemplateResult<1>;
|
|
418
|
+
_renderFlowForm(readonlyMode: any): import("lit").TemplateResult<1> | undefined;
|
|
419
419
|
_onResourcesChange({ detail }: {
|
|
420
420
|
detail: any;
|
|
421
421
|
}): void;
|
|
@@ -428,7 +428,7 @@ export class GvPolicyStudio extends GvPolicyStudio_base {
|
|
|
428
428
|
_onSwitchEncryptedProperty({ detail }: {
|
|
429
429
|
detail: any;
|
|
430
430
|
}): void;
|
|
431
|
-
render(): import("lit
|
|
431
|
+
render(): import("lit").TemplateResult<1>;
|
|
432
432
|
/**
|
|
433
433
|
* Determine if the design view should be in readonly mode or not
|
|
434
434
|
* It is in readonly mode if:
|
|
@@ -372,6 +372,9 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
|
|
|
372
372
|
}
|
|
373
373
|
willUpdate(changedProperties) {
|
|
374
374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
375
|
+
if (changedProperties.has('services') && this.services == null) {
|
|
376
|
+
this.services = {};
|
|
377
|
+
}
|
|
375
378
|
if (changedProperties.has('configurationSchema') && this.configurationSchema) {
|
|
376
379
|
this._tabs.splice(1, 0, { id: 'settings', title: 'Configuration', icon: 'general:settings#2' });
|
|
377
380
|
}
|