@finos/legend-application-studio 26.1.3 → 26.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendStudioNavigation.d.ts +4 -0
- package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioNavigation.js +4 -0
- package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
- package/lib/components/editor/ActivityBar.d.ts.map +1 -1
- package/lib/components/editor/ActivityBar.js +5 -1
- package/lib/components/editor/ActivityBar.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.js +17 -11
- package/lib/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +7 -9
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js +14 -10
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js.map +1 -1
- package/lib/components/editor/panel-group/DevToolPanel.d.ts.map +1 -1
- package/lib/components/editor/panel-group/DevToolPanel.js +7 -2
- package/lib/components/editor/panel-group/DevToolPanel.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +9 -2
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +0 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -27
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +12 -12
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.d.ts +0 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js +0 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.d.ts.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.js +9 -2
- package/lib/stores/project-view/ProjectViewerStore.js.map +1 -1
- package/package.json +10 -10
- package/src/__lib__/LegendStudioNavigation.ts +16 -0
- package/src/components/editor/ActivityBar.tsx +12 -1
- package/src/components/editor/editor-group/service-editor/BulkServiceRegistrationEditor.tsx +117 -106
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +8 -30
- package/src/components/editor/editor-group/service-editor/ServiceRegistrationEditor.tsx +123 -110
- package/src/components/editor/panel-group/DevToolPanel.tsx +34 -2
- package/src/index.ts +1 -4
- package/src/stores/editor/EditorStore.ts +22 -0
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -57
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +17 -16
- package/src/stores/editor/sidebar-state/BulkServiceRegistrationState.ts +0 -2
- package/src/stores/project-view/ProjectViewerStore.ts +25 -1
@@ -29,6 +29,8 @@ import { ServiceExecutionMode } from '@finos/legend-graph';
|
|
29
29
|
import { flowResult } from 'mobx';
|
30
30
|
import { useEditorStore } from '../../EditorStoreProvider.js';
|
31
31
|
import { useApplicationStore } from '@finos/legend-application';
|
32
|
+
import { MASTER_SNAPSHOT_ALIAS } from '@finos/legend-server-depot';
|
33
|
+
import { LATEST_PROJECT_REVISION } from '../../../../stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js';
|
32
34
|
|
33
35
|
export const ServiceRegistrationEditor = observer(() => {
|
34
36
|
const editorStore = useEditorStore();
|
@@ -74,7 +76,10 @@ export const ServiceRegistrationEditor = observer(() => {
|
|
74
76
|
// version
|
75
77
|
const selectedVersion = registrationState.projectVersion
|
76
78
|
? {
|
77
|
-
label:
|
79
|
+
label:
|
80
|
+
registrationState.projectVersion === MASTER_SNAPSHOT_ALIAS
|
81
|
+
? LATEST_PROJECT_REVISION
|
82
|
+
: registrationState.projectVersion,
|
78
83
|
value: registrationState.projectVersion,
|
79
84
|
}
|
80
85
|
: null;
|
@@ -151,145 +156,153 @@ export const ServiceRegistrationEditor = observer(() => {
|
|
151
156
|
<PanelLoadingIndicator
|
152
157
|
isLoading={registrationState.registrationState.isInProgress}
|
153
158
|
/>
|
154
|
-
<div className="
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
)}
|
160
|
-
<div className="panel__content__form__section">
|
161
|
-
<div className="panel__content__form__section__header__label">
|
162
|
-
Activate Service
|
163
|
-
</div>
|
164
|
-
<div
|
165
|
-
className="panel__content__form__section__toggler"
|
166
|
-
onClick={toggleActivatePostRegistration}
|
167
|
-
>
|
168
|
-
<button
|
169
|
-
className={clsx('panel__content__form__section__toggler__btn', {
|
170
|
-
'panel__content__form__section__toggler__btn--toggled':
|
171
|
-
registrationState.activatePostRegistration,
|
172
|
-
})}
|
173
|
-
tabIndex={-1}
|
174
|
-
>
|
175
|
-
{registrationState.activatePostRegistration ? (
|
176
|
-
<CheckSquareIcon />
|
177
|
-
) : (
|
178
|
-
<SquareIcon />
|
179
|
-
)}
|
180
|
-
</button>
|
181
|
-
<div className="panel__content__form__section__toggler__prompt">
|
182
|
-
Activates service after registration
|
159
|
+
<div className="panel__content">
|
160
|
+
<div className="panel__content__form">
|
161
|
+
{registrationState.registrationState.message && (
|
162
|
+
<div className="service-registration-editor__progress-msg">
|
163
|
+
{`${registrationState.registrationState.message}...`}
|
183
164
|
</div>
|
184
|
-
|
185
|
-
</div>
|
186
|
-
<div className="panel__content__form__section">
|
187
|
-
<div className="panel__content__form__section__header__label">
|
188
|
-
Execution Server
|
189
|
-
</div>
|
190
|
-
<div className="panel__content__form__section__header__prompt">
|
191
|
-
The execution server where your service will be registered
|
192
|
-
</div>
|
193
|
-
<CustomSelectorInput
|
194
|
-
options={envOptions}
|
195
|
-
onChange={onServerEnvChange}
|
196
|
-
value={selectedEnvOption}
|
197
|
-
darkMode={true}
|
198
|
-
/>
|
199
|
-
</div>
|
200
|
-
<div className="panel__content__form__section">
|
201
|
-
<div className="panel__content__form__section__header__label">
|
202
|
-
Service Type
|
203
|
-
</div>
|
204
|
-
<div className="panel__content__form__section__header__prompt">
|
205
|
-
The kind of service you want to register. Used to determine how the
|
206
|
-
metadata will be fetched
|
207
|
-
</div>
|
208
|
-
<CustomSelectorInput
|
209
|
-
options={serviceTypesOptions}
|
210
|
-
onChange={onServiceTypeSelectionChange}
|
211
|
-
value={selectedServiceType}
|
212
|
-
darkMode={true}
|
213
|
-
/>
|
214
|
-
</div>
|
215
|
-
{registrationState.serviceExecutionMode ===
|
216
|
-
ServiceExecutionMode.FULL_INTERACTIVE && (
|
165
|
+
)}
|
217
166
|
<div className="panel__content__form__section">
|
218
167
|
<div className="panel__content__form__section__header__label">
|
219
|
-
|
168
|
+
Activate Service
|
220
169
|
</div>
|
221
170
|
<div
|
222
171
|
className="panel__content__form__section__toggler"
|
223
|
-
onClick={
|
172
|
+
onClick={toggleActivatePostRegistration}
|
224
173
|
>
|
225
174
|
<button
|
226
175
|
className={clsx('panel__content__form__section__toggler__btn', {
|
227
176
|
'panel__content__form__section__toggler__btn--toggled':
|
228
|
-
registrationState.
|
177
|
+
registrationState.activatePostRegistration,
|
229
178
|
})}
|
230
179
|
tabIndex={-1}
|
231
180
|
>
|
232
|
-
{registrationState.
|
181
|
+
{registrationState.activatePostRegistration ? (
|
233
182
|
<CheckSquareIcon />
|
234
183
|
) : (
|
235
184
|
<SquareIcon />
|
236
185
|
)}
|
237
186
|
</button>
|
238
187
|
<div className="panel__content__form__section__toggler__prompt">
|
239
|
-
|
188
|
+
Activates service after registration
|
240
189
|
</div>
|
241
190
|
</div>
|
242
191
|
</div>
|
243
|
-
)}
|
244
|
-
{
|
245
192
|
<div className="panel__content__form__section">
|
246
193
|
<div className="panel__content__form__section__header__label">
|
247
|
-
|
194
|
+
Execution Server
|
248
195
|
</div>
|
249
|
-
<div
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
196
|
+
<div className="panel__content__form__section__header__prompt">
|
197
|
+
The execution server where your service will be registered
|
198
|
+
</div>
|
199
|
+
<CustomSelectorInput
|
200
|
+
options={envOptions}
|
201
|
+
onChange={onServerEnvChange}
|
202
|
+
value={selectedEnvOption}
|
203
|
+
darkMode={true}
|
204
|
+
/>
|
205
|
+
</div>
|
206
|
+
<div className="panel__content__form__section">
|
207
|
+
<div className="panel__content__form__section__header__label">
|
208
|
+
Service Type
|
209
|
+
</div>
|
210
|
+
<div className="panel__content__form__section__header__prompt">
|
211
|
+
The kind of service you want to register. Used to determine how
|
212
|
+
the metadata will be fetched
|
213
|
+
</div>
|
214
|
+
<CustomSelectorInput
|
215
|
+
options={serviceTypesOptions}
|
216
|
+
onChange={onServiceTypeSelectionChange}
|
217
|
+
value={selectedServiceType}
|
218
|
+
darkMode={true}
|
219
|
+
/>
|
220
|
+
</div>
|
221
|
+
{registrationState.serviceExecutionMode ===
|
222
|
+
ServiceExecutionMode.FULL_INTERACTIVE && (
|
223
|
+
<div className="panel__content__form__section">
|
224
|
+
<div className="panel__content__form__section__header__label">
|
225
|
+
Store Model
|
226
|
+
</div>
|
227
|
+
<div
|
228
|
+
className="panel__content__form__section__toggler"
|
229
|
+
onClick={toggleUseStoreModel}
|
259
230
|
>
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
231
|
+
<button
|
232
|
+
className={clsx(
|
233
|
+
'panel__content__form__section__toggler__btn',
|
234
|
+
{
|
235
|
+
'panel__content__form__section__toggler__btn--toggled':
|
236
|
+
registrationState.TEMPORARY__useStoreModel,
|
237
|
+
},
|
238
|
+
)}
|
239
|
+
tabIndex={-1}
|
240
|
+
>
|
241
|
+
{registrationState.TEMPORARY__useStoreModel ? (
|
242
|
+
<CheckSquareIcon />
|
243
|
+
) : (
|
244
|
+
<SquareIcon />
|
245
|
+
)}
|
246
|
+
</button>
|
247
|
+
<div className="panel__content__form__section__toggler__prompt">
|
248
|
+
Use Store Model (slower)
|
249
|
+
</div>
|
268
250
|
</div>
|
269
251
|
</div>
|
270
|
-
|
271
|
-
|
252
|
+
)}
|
253
|
+
{
|
254
|
+
<div className="panel__content__form__section">
|
255
|
+
<div className="panel__content__form__section__header__label">
|
256
|
+
Generate Lineage
|
257
|
+
</div>
|
258
|
+
<div
|
259
|
+
className="panel__content__form__section__toggler"
|
260
|
+
onClick={toggleUseGenerateLineage}
|
261
|
+
>
|
262
|
+
<button
|
263
|
+
className={clsx(
|
264
|
+
'panel__content__form__section__toggler__btn',
|
265
|
+
{
|
266
|
+
'panel__content__form__section__toggler__btn--toggled':
|
267
|
+
registrationState.TEMPORARY__useGenerateLineage,
|
268
|
+
},
|
269
|
+
)}
|
270
|
+
tabIndex={-1}
|
271
|
+
>
|
272
|
+
{registrationState.TEMPORARY__useGenerateLineage ? (
|
273
|
+
<CheckSquareIcon />
|
274
|
+
) : (
|
275
|
+
<SquareIcon />
|
276
|
+
)}
|
277
|
+
</button>
|
278
|
+
<div className="panel__content__form__section__toggler__prompt">
|
279
|
+
Generate Lineage (slower)
|
280
|
+
</div>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
}
|
272
284
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
285
|
+
<div className="panel__content__form__section">
|
286
|
+
<div className="panel__content__form__section__header__label">
|
287
|
+
Project Version
|
288
|
+
</div>
|
289
|
+
<div className="panel__content__form__section__header__prompt">
|
290
|
+
The version of your project you want to use for registration. Only
|
291
|
+
relevant for semi-interactive and production services.
|
292
|
+
</div>
|
293
|
+
<CustomSelectorInput
|
294
|
+
options={registrationState.versionOptions ?? []}
|
295
|
+
onChange={onVersionSelectionChange}
|
296
|
+
value={selectedVersion}
|
297
|
+
darkMode={true}
|
298
|
+
disabled={registrationState.versionOptions === undefined}
|
299
|
+
placeholder={versionPlaceholder}
|
300
|
+
isLoading={
|
301
|
+
editorStore.sdlcState.fetchPublishedProjectVersionsState
|
302
|
+
.isInProgress
|
303
|
+
}
|
304
|
+
/>
|
280
305
|
</div>
|
281
|
-
<CustomSelectorInput
|
282
|
-
options={registrationState.versionOptions ?? []}
|
283
|
-
onChange={onVersionSelectionChange}
|
284
|
-
value={selectedVersion}
|
285
|
-
darkMode={true}
|
286
|
-
disabled={registrationState.versionOptions === undefined}
|
287
|
-
placeholder={versionPlaceholder}
|
288
|
-
isLoading={
|
289
|
-
editorStore.sdlcState.fetchPublishedProjectVersionsState
|
290
|
-
.isInProgress
|
291
|
-
}
|
292
|
-
/>
|
293
306
|
</div>
|
294
307
|
</div>
|
295
308
|
</div>
|
@@ -34,7 +34,11 @@ export const DevToolPanel = observer(() => {
|
|
34
34
|
engineConfig.setUseClientRequestPayloadCompression(
|
35
35
|
!engineConfig.useClientRequestPayloadCompression,
|
36
36
|
);
|
37
|
-
const
|
37
|
+
const toggleEngineClientRequestPayloadDebugging = (): void =>
|
38
|
+
engineConfig.setEnableDebuggingPayload(
|
39
|
+
!engineConfig.enableDebuggingPayload,
|
40
|
+
);
|
41
|
+
const toggleEngineClientDataURLEncoding = (): void =>
|
38
42
|
engineConfig.setUseBase64ForAdhocConnectionDataUrls(
|
39
43
|
!engineConfig.useBase64ForAdhocConnectionDataUrls,
|
40
44
|
);
|
@@ -59,6 +63,13 @@ export const DevToolPanel = observer(() => {
|
|
59
63
|
isReadOnly={false}
|
60
64
|
update={toggleEngineClientRequestPayloadCompression}
|
61
65
|
/>
|
66
|
+
<PanelFormBooleanField
|
67
|
+
name="Engine client request payload debug"
|
68
|
+
prompt="Specifies if request payload should be downloaded for debugging purpose"
|
69
|
+
value={engineConfig.enableDebuggingPayload}
|
70
|
+
isReadOnly={false}
|
71
|
+
update={toggleEngineClientRequestPayloadDebugging}
|
72
|
+
/>
|
62
73
|
<PanelFormTextField
|
63
74
|
name="Engine client base URL"
|
64
75
|
value={engineConfig.baseUrl ?? ''}
|
@@ -70,12 +81,33 @@ export const DevToolPanel = observer(() => {
|
|
70
81
|
!isValidUrl(engineConfig.baseUrl ?? '') ? 'Invalid URL' : ''
|
71
82
|
}
|
72
83
|
/>
|
84
|
+
{Boolean(
|
85
|
+
editorStore.applicationStore.config.options
|
86
|
+
.TEMPORARY__serviceRegistrationConfig.length,
|
87
|
+
) && (
|
88
|
+
<PanelFormTextField
|
89
|
+
name="Engine client service registration base URL"
|
90
|
+
value={engineConfig.baseUrlForServiceRegistration ?? ''}
|
91
|
+
isReadOnly={false}
|
92
|
+
update={(value: string | undefined): void =>
|
93
|
+
engineConfig.setBaseUrlForServiceRegistration(
|
94
|
+
value === '' ? undefined : value,
|
95
|
+
)
|
96
|
+
}
|
97
|
+
errorMessage={
|
98
|
+
Boolean(engineConfig.baseUrlForServiceRegistration) &&
|
99
|
+
!isValidUrl(engineConfig.baseUrlForServiceRegistration ?? '')
|
100
|
+
? 'Invalid URL'
|
101
|
+
: ''
|
102
|
+
}
|
103
|
+
/>
|
104
|
+
)}
|
73
105
|
<PanelFormBooleanField
|
74
106
|
name="Engine execution runner"
|
75
107
|
prompt="Use Base64 encoding for adhoc connection data URLs"
|
76
108
|
value={engineConfig.useBase64ForAdhocConnectionDataUrls}
|
77
109
|
isReadOnly={false}
|
78
|
-
update={
|
110
|
+
update={toggleEngineClientDataURLEncoding}
|
79
111
|
/>
|
80
112
|
<PanelFormBooleanField
|
81
113
|
name="Graph builder strict mode"
|
package/src/index.ts
CHANGED
@@ -94,10 +94,7 @@ export * from './stores/extensions/DSL_Generation_LegendStudioApplicationPlugin_
|
|
94
94
|
export * from './stores/extensions/STO_Relational_LegendStudioApplicationPlugin_Extension.js';
|
95
95
|
|
96
96
|
export { MINIMUM_SERVICE_OWNERS } from './stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js';
|
97
|
-
export {
|
98
|
-
LATEST_PROJECT_REVISION,
|
99
|
-
generateServiceManagementUrl,
|
100
|
-
} from './stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js';
|
97
|
+
export { generateServiceManagementUrl } from './stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js';
|
101
98
|
export { ServicePureExecutionState } from './stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js';
|
102
99
|
export { NewServiceModal } from './components/editor/editor-group/service-editor/NewServiceModal.js';
|
103
100
|
export { FileSystem_File as GenerationFile } from './stores/editor/utils/FileSystemTreeUtils.js';
|
@@ -56,6 +56,10 @@ import {
|
|
56
56
|
AssertionError,
|
57
57
|
guaranteeType,
|
58
58
|
type Clazz,
|
59
|
+
returnUndefOnError,
|
60
|
+
downloadFileUsingDataURI,
|
61
|
+
formatDate,
|
62
|
+
ContentType,
|
59
63
|
} from '@finos/legend-shared';
|
60
64
|
import { EditorSDLCState } from './EditorSDLCState.js';
|
61
65
|
import { ModelImporterState } from './editor-state/ModelImporterState.js';
|
@@ -85,6 +89,7 @@ import {
|
|
85
89
|
ActionAlertType,
|
86
90
|
APPLICATION_EVENT,
|
87
91
|
DEFAULT_TAB_SIZE,
|
92
|
+
DEFAULT_DATE_TIME_FORMAT,
|
88
93
|
} from '@finos/legend-application';
|
89
94
|
import { LEGEND_STUDIO_APP_EVENT } from '../../__lib__/LegendStudioEvent.js';
|
90
95
|
import type { EditorMode } from './EditorMode.js';
|
@@ -663,6 +668,23 @@ export class EditorStore implements CommandRegistrar {
|
|
663
668
|
baseUrl: this.applicationStore.config.engineServerUrl,
|
664
669
|
queryBaseUrl: this.applicationStore.config.engineQueryServerUrl,
|
665
670
|
enableCompression: true,
|
671
|
+
payloadDebugger: (payload: unknown, identifier: string) => {
|
672
|
+
const content =
|
673
|
+
returnUndefOnError(() =>
|
674
|
+
JSON.stringify(payload, undefined, 2),
|
675
|
+
) ??
|
676
|
+
returnUndefOnError(() => `${payload}`) ??
|
677
|
+
'';
|
678
|
+
// TODO: we can also copy the debug content to clipboard
|
679
|
+
downloadFileUsingDataURI(
|
680
|
+
`PAYLOAD_DEBUG__${identifier}__${formatDate(
|
681
|
+
new Date(Date.now()),
|
682
|
+
DEFAULT_DATE_TIME_FORMAT,
|
683
|
+
)}.json`,
|
684
|
+
content,
|
685
|
+
ContentType.TEXT_PLAIN,
|
686
|
+
);
|
687
|
+
},
|
666
688
|
},
|
667
689
|
},
|
668
690
|
{
|
package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts
CHANGED
@@ -30,10 +30,6 @@ import {
|
|
30
30
|
decorateRuntimeWithNewMapping,
|
31
31
|
RuntimeEditorState,
|
32
32
|
} from '../../../editor-state/element-editor-state/RuntimeEditorState.js';
|
33
|
-
import {
|
34
|
-
generatePath,
|
35
|
-
generateExtensionUrlPattern,
|
36
|
-
} from '@finos/legend-application/browser';
|
37
33
|
import {
|
38
34
|
type ServiceExecution,
|
39
35
|
type PureExecution,
|
@@ -63,10 +59,7 @@ import {
|
|
63
59
|
type LightQuery,
|
64
60
|
QuerySearchSpecification,
|
65
61
|
} from '@finos/legend-graph';
|
66
|
-
import {
|
67
|
-
parseGACoordinates,
|
68
|
-
generateGAVCoordinates,
|
69
|
-
} from '@finos/legend-storage';
|
62
|
+
import { parseGACoordinates } from '@finos/legend-storage';
|
70
63
|
import { runtime_addMapping } from '../../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
|
71
64
|
import type { EditorStore } from '../../../EditorStore.js';
|
72
65
|
import {
|
@@ -94,22 +87,6 @@ import {
|
|
94
87
|
} from '@finos/legend-query-builder';
|
95
88
|
import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
|
96
89
|
|
97
|
-
enum DSL_SERVICE_PATH_PARAM_TOKEN {
|
98
|
-
PROJECT_ID = 'projectId',
|
99
|
-
GROUP_WORKSPACE_ID = 'groupWorkspaceId',
|
100
|
-
SERVICE_PATH = 'servicePath',
|
101
|
-
}
|
102
|
-
|
103
|
-
enum LEGEND_QUERY_PATH_PARAM_TOKEN {
|
104
|
-
GAV = 'gav',
|
105
|
-
SERVICE_PATH = 'servicePath',
|
106
|
-
}
|
107
|
-
|
108
|
-
const QUERY_ROUTE_PATTERN = Object.freeze({
|
109
|
-
CREATE_FROM_SERVICE_QUERY: `/create-from-service/:${LEGEND_QUERY_PATH_PARAM_TOKEN.GAV}/:${LEGEND_QUERY_PATH_PARAM_TOKEN.SERVICE_PATH}`,
|
110
|
-
UPDATE_PROJECT_SERVICE_QUERY: `/update-project-service-query/:${DSL_SERVICE_PATH_PARAM_TOKEN.PROJECT_ID}/:${DSL_SERVICE_PATH_PARAM_TOKEN.GROUP_WORKSPACE_ID}/:${DSL_SERVICE_PATH_PARAM_TOKEN.SERVICE_PATH}`,
|
111
|
-
});
|
112
|
-
|
113
90
|
export class ServiceExecutionParametersState extends LambdaParametersState {
|
114
91
|
executionState: ServicePureExecutionState;
|
115
92
|
|
@@ -777,39 +754,6 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
|
|
777
754
|
updateExecutionQuery(): void {
|
778
755
|
pureExecution_setFunction(this.execution, this.queryState.query);
|
779
756
|
}
|
780
|
-
|
781
|
-
generateServiceQueryCreatorRoute = (
|
782
|
-
baseUrl: string,
|
783
|
-
groupId: string,
|
784
|
-
artifactId: string,
|
785
|
-
versionId: string,
|
786
|
-
servicePath: string,
|
787
|
-
): string =>
|
788
|
-
baseUrl +
|
789
|
-
generatePath(QUERY_ROUTE_PATTERN.CREATE_FROM_SERVICE_QUERY, {
|
790
|
-
[LEGEND_QUERY_PATH_PARAM_TOKEN.GAV]: generateGAVCoordinates(
|
791
|
-
groupId,
|
792
|
-
artifactId,
|
793
|
-
versionId,
|
794
|
-
),
|
795
|
-
[LEGEND_QUERY_PATH_PARAM_TOKEN.SERVICE_PATH]: servicePath,
|
796
|
-
});
|
797
|
-
|
798
|
-
generateProjectServiceQueryUpdaterRoute = (
|
799
|
-
projectId: string,
|
800
|
-
groupWorkspaceId: string,
|
801
|
-
servicePath: string,
|
802
|
-
): string =>
|
803
|
-
generatePath(
|
804
|
-
generateExtensionUrlPattern(
|
805
|
-
QUERY_ROUTE_PATTERN.UPDATE_PROJECT_SERVICE_QUERY,
|
806
|
-
),
|
807
|
-
{
|
808
|
-
[DSL_SERVICE_PATH_PARAM_TOKEN.PROJECT_ID]: projectId,
|
809
|
-
[DSL_SERVICE_PATH_PARAM_TOKEN.GROUP_WORKSPACE_ID]: groupWorkspaceId,
|
810
|
-
[DSL_SERVICE_PATH_PARAM_TOKEN.SERVICE_PATH]: servicePath,
|
811
|
-
},
|
812
|
-
);
|
813
757
|
}
|
814
758
|
|
815
759
|
export class InlineServicePureExecutionState extends ServicePureExecutionState {
|
package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts
CHANGED
@@ -49,11 +49,10 @@ import {
|
|
49
49
|
ActionAlertType,
|
50
50
|
} from '@finos/legend-application';
|
51
51
|
import { compareSemVerVersions } from '@finos/legend-storage';
|
52
|
+
import { MASTER_SNAPSHOT_ALIAS } from '@finos/legend-server-depot';
|
52
53
|
|
53
54
|
export const LATEST_PROJECT_REVISION = 'Latest Project Revision';
|
54
55
|
|
55
|
-
const PROD_SERVICE_EXECUTION_SERVER = 'PROD';
|
56
|
-
|
57
56
|
export const PROJECT_SEMANTIC_VERSION_PATTERN = /^[0-9]*.[0-9]*.[0-9]*$/;
|
58
57
|
|
59
58
|
export const generateServiceManagementUrl = (
|
@@ -163,24 +162,23 @@ export class ServiceConfigState {
|
|
163
162
|
this.enableModesWithVersioning &&
|
164
163
|
this.serviceExecutionMode !== ServiceExecutionMode.FULL_INTERACTIVE
|
165
164
|
) {
|
166
|
-
const
|
167
|
-
.
|
168
|
-
|
165
|
+
const semanticVersions =
|
166
|
+
this.editorStore.sdlcState.projectPublishedVersions
|
167
|
+
.filter((version) => version.match(PROJECT_SEMANTIC_VERSION_PATTERN))
|
168
|
+
.sort((v1, v2) => compareSemVerVersions(v2, v1));
|
169
169
|
const snapshotVersions =
|
170
170
|
this.editorStore.sdlcState.projectPublishedVersions
|
171
|
-
.filter((
|
171
|
+
.filter((version) => !version.match(PROJECT_SEMANTIC_VERSION_PATTERN))
|
172
172
|
.sort((v1, v2) => v1.localeCompare(v2));
|
173
173
|
const options: ServiceVersionOption[] = snapshotVersions
|
174
|
-
.concat(
|
174
|
+
.concat(semanticVersions)
|
175
175
|
.map((version) => ({
|
176
176
|
label: version,
|
177
177
|
value: version,
|
178
178
|
}));
|
179
|
-
if (
|
180
|
-
|
181
|
-
|
182
|
-
) {
|
183
|
-
return semVerVersions.map((version) => ({
|
179
|
+
if (this.serviceEnv && this.serviceEnv.toUpperCase() === 'PROD') {
|
180
|
+
// NOTE: we disallow registering against snapshot versions in PROD
|
181
|
+
return semanticVersions.map((version) => ({
|
184
182
|
label: version,
|
185
183
|
value: version,
|
186
184
|
}));
|
@@ -188,10 +186,12 @@ export class ServiceConfigState {
|
|
188
186
|
if (this.serviceExecutionMode !== ServiceExecutionMode.PROD) {
|
189
187
|
return [
|
190
188
|
{
|
191
|
-
label:
|
192
|
-
value:
|
189
|
+
label: LATEST_PROJECT_REVISION,
|
190
|
+
value: MASTER_SNAPSHOT_ALIAS,
|
193
191
|
},
|
194
|
-
...options
|
192
|
+
...options.filter(
|
193
|
+
(option) => option.value !== MASTER_SNAPSHOT_ALIAS,
|
194
|
+
),
|
195
195
|
];
|
196
196
|
}
|
197
197
|
}
|
@@ -228,7 +228,7 @@ export class ServiceConfigState {
|
|
228
228
|
|
229
229
|
updateVersion(): void {
|
230
230
|
if (this.serviceExecutionMode === ServiceExecutionMode.SEMI_INTERACTIVE) {
|
231
|
-
this.projectVersion =
|
231
|
+
this.projectVersion = MASTER_SNAPSHOT_ALIAS;
|
232
232
|
} else if (this.serviceExecutionMode === ServiceExecutionMode.PROD) {
|
233
233
|
this.projectVersion =
|
234
234
|
this.editorStore.sdlcState.projectPublishedVersions[0];
|
@@ -259,6 +259,7 @@ export class ServiceRegistrationState extends ServiceConfigState {
|
|
259
259
|
enableModesWithVersioning: boolean,
|
260
260
|
) {
|
261
261
|
super(editorStore, registrationOptions, enableModesWithVersioning);
|
262
|
+
|
262
263
|
makeObservable(this, {
|
263
264
|
activatePostRegistration: observable,
|
264
265
|
setActivatePostRegistration: action,
|
@@ -37,8 +37,6 @@ import {
|
|
37
37
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
|
38
38
|
import { type ServiceRegistrationEnvironmentConfig } from '../../../application/LegendStudioApplicationConfig.js';
|
39
39
|
|
40
|
-
export const LATEST_PROJECT_REVISION = 'Latest Project Revision';
|
41
|
-
|
42
40
|
export enum REGISTRATION_RESULT {
|
43
41
|
DID_NOT_RUN = 'DID_NOT_RUN',
|
44
42
|
FAILED = 'FAILED',
|
@@ -24,6 +24,10 @@ import {
|
|
24
24
|
LogEvent,
|
25
25
|
IllegalStateError,
|
26
26
|
StopWatch,
|
27
|
+
returnUndefOnError,
|
28
|
+
downloadFileUsingDataURI,
|
29
|
+
formatDate,
|
30
|
+
ContentType,
|
27
31
|
} from '@finos/legend-shared';
|
28
32
|
import {
|
29
33
|
type ProjectViewerPathParams,
|
@@ -46,7 +50,10 @@ import {
|
|
46
50
|
Workspace,
|
47
51
|
} from '@finos/legend-server-sdlc';
|
48
52
|
import { LEGEND_STUDIO_APP_EVENT } from '../../__lib__/LegendStudioEvent.js';
|
49
|
-
import {
|
53
|
+
import {
|
54
|
+
DEFAULT_DATE_TIME_FORMAT,
|
55
|
+
DEFAULT_TAB_SIZE,
|
56
|
+
} from '@finos/legend-application';
|
50
57
|
import { resolveVersion, StoreProjectData } from '@finos/legend-server-depot';
|
51
58
|
import {
|
52
59
|
type WorkflowManagerState,
|
@@ -365,6 +372,23 @@ export class ProjectViewerStore {
|
|
365
372
|
queryBaseUrl:
|
366
373
|
this.editorStore.applicationStore.config.engineQueryServerUrl,
|
367
374
|
enableCompression: true,
|
375
|
+
payloadDebugger: (payload: unknown, identifier: string) => {
|
376
|
+
const content =
|
377
|
+
returnUndefOnError(() =>
|
378
|
+
JSON.stringify(payload, undefined, 2),
|
379
|
+
) ??
|
380
|
+
returnUndefOnError(() => `${payload}`) ??
|
381
|
+
'';
|
382
|
+
// TODO: we can also copy the debug content to clipboard
|
383
|
+
downloadFileUsingDataURI(
|
384
|
+
`PAYLOAD_DEBUG__${identifier}__${formatDate(
|
385
|
+
new Date(Date.now()),
|
386
|
+
DEFAULT_DATE_TIME_FORMAT,
|
387
|
+
)}.json`,
|
388
|
+
content,
|
389
|
+
ContentType.TEXT_PLAIN,
|
390
|
+
);
|
391
|
+
},
|
368
392
|
},
|
369
393
|
},
|
370
394
|
{
|