@finos/legend-application 3.0.3 → 4.0.2
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/application/LegendApplication.d.ts +2 -2
- package/lib/application/LegendApplication.d.ts.map +1 -1
- package/lib/application/LegendApplication.js +4 -4
- package/lib/application/LegendApplication.js.map +1 -1
- package/lib/application/LegendApplicationPluginManager.d.ts +3 -3
- package/lib/application/LegendApplicationPluginManager.d.ts.map +1 -1
- package/lib/components/ActionAlert.d.ts +1 -0
- package/lib/components/ActionAlert.d.ts.map +1 -1
- package/lib/components/ActionAlert.js +2 -2
- package/lib/components/ActionAlert.js.map +1 -1
- package/lib/components/ApplicationStoreProvider.d.ts +3 -3
- package/lib/components/ApplicationStoreProvider.d.ts.map +1 -1
- package/lib/components/ApplicationStoreProvider.js +2 -2
- package/lib/components/ApplicationStoreProvider.js.map +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts +5 -5
- package/lib/components/ApplicationStoreProviderTestUtils.d.ts.map +1 -1
- package/lib/components/ApplicationStoreProviderTestUtils.js +5 -4
- package/lib/components/ApplicationStoreProviderTestUtils.js.map +1 -1
- package/lib/components/ApplicationTestID.js +1 -1
- package/lib/components/ApplicationTestID.js.map +1 -1
- package/lib/components/BasicValueSpecificationEditor.d.ts +44 -0
- package/lib/components/BasicValueSpecificationEditor.d.ts.map +1 -0
- package/lib/components/BasicValueSpecificationEditor.js +276 -0
- package/lib/components/BasicValueSpecificationEditor.js.map +1 -0
- package/lib/components/BlockingAlert.d.ts +1 -0
- package/lib/components/BlockingAlert.d.ts.map +1 -1
- package/lib/components/BlockingAlert.js +1 -1
- package/lib/components/BlockingAlert.js.map +1 -1
- package/lib/components/CustomDatePicker.d.ts +38 -0
- package/lib/components/CustomDatePicker.d.ts.map +1 -0
- package/lib/components/CustomDatePicker.js +592 -0
- package/lib/components/CustomDatePicker.js.map +1 -0
- package/lib/components/DocumentationLink.d.ts +1 -1
- package/lib/components/DocumentationLink.js +2 -2
- package/lib/components/DocumentationLink.js.map +1 -1
- package/lib/components/LambdaEditor.d.ts +2 -1
- package/lib/components/LambdaEditor.d.ts.map +1 -1
- package/lib/components/LambdaEditor.js +3 -3
- package/lib/components/LambdaEditor.js.map +1 -1
- package/lib/components/LambdaParameterValuesEditor.d.ts +25 -0
- package/lib/components/LambdaParameterValuesEditor.d.ts.map +1 -0
- package/lib/components/LambdaParameterValuesEditor.js +52 -0
- package/lib/components/LambdaParameterValuesEditor.js.map +1 -0
- package/lib/components/LegendApplicationComponentFrameworkProvider.d.ts +1 -1
- package/lib/components/LegendApplicationComponentFrameworkProvider.js +3 -3
- package/lib/components/LegendApplicationComponentFrameworkProvider.js.map +1 -1
- package/lib/components/LegendApplicationNavigationContextServiceUtils.d.ts +32 -0
- package/lib/components/LegendApplicationNavigationContextServiceUtils.d.ts.map +1 -0
- package/lib/components/LegendApplicationNavigationContextServiceUtils.js +57 -0
- package/lib/components/LegendApplicationNavigationContextServiceUtils.js.map +1 -0
- package/lib/components/NotificationManager.d.ts +1 -0
- package/lib/components/NotificationManager.d.ts.map +1 -1
- package/lib/components/NotificationManager.js +2 -2
- package/lib/components/NotificationManager.js.map +1 -1
- package/lib/components/TextInputEditor.d.ts +2 -2
- package/lib/components/TextInputEditor.d.ts.map +1 -1
- package/lib/components/TextInputEditor.js +2 -2
- package/lib/components/TextInputEditor.js.map +1 -1
- package/lib/components/{AppHeader.d.ts → VirtualAssistant.d.ts} +5 -5
- package/lib/components/VirtualAssistant.d.ts.map +1 -0
- package/lib/components/VirtualAssistant.js +171 -0
- package/lib/components/VirtualAssistant.js.map +1 -0
- package/lib/components/WebApplicationNavigatorProvider.d.ts +2 -2
- package/lib/components/WebApplicationNavigatorProvider.d.ts.map +1 -1
- package/lib/components/WebApplicationNavigatorProvider.js +1 -1
- package/lib/components/WebApplicationNavigatorProvider.js.map +1 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts +2 -2
- package/lib/components/WebApplicationNavigatorProviderTestUtils.d.ts.map +1 -1
- package/lib/components/WebApplicationNavigatorProviderTestUtils.js +3 -2
- package/lib/components/WebApplicationNavigatorProviderTestUtils.js.map +1 -1
- package/lib/const.js +2 -2
- package/lib/const.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +30 -22
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +32 -22
- package/lib/index.js.map +1 -1
- package/lib/stores/ApplicationEvent.d.ts +9 -7
- package/lib/stores/ApplicationEvent.d.ts.map +1 -1
- package/lib/stores/ApplicationEvent.js +10 -8
- package/lib/stores/ApplicationEvent.js.map +1 -1
- package/lib/stores/ApplicationStore.d.ts +15 -9
- package/lib/stores/ApplicationStore.d.ts.map +1 -1
- package/lib/stores/ApplicationStore.js +26 -21
- package/lib/stores/ApplicationStore.js.map +1 -1
- package/lib/stores/ApplicationStoreTestUtils.d.ts +3 -3
- package/lib/stores/ApplicationStoreTestUtils.d.ts.map +1 -1
- package/lib/stores/ApplicationStoreTestUtils.js +2 -2
- package/lib/stores/ApplicationStoreTestUtils.js.map +1 -1
- package/lib/stores/ApplicationTelemetry.d.ts +1 -1
- package/lib/stores/ApplicationTelemetry.d.ts.map +1 -1
- package/lib/stores/ApplicationTelemetry.js +2 -2
- package/lib/stores/ApplicationTelemetry.js.map +1 -1
- package/lib/stores/CJS__Fuse.cjs +35 -0
- package/lib/stores/CJS__Fuse.cjs.map +1 -0
- package/lib/stores/CJS__Fuse.d.cts +28 -0
- package/lib/stores/CJS__Fuse.d.cts.map +1 -0
- package/lib/stores/LambdaParameterState.d.ts +59 -0
- package/lib/stores/LambdaParameterState.d.ts.map +1 -0
- package/lib/stores/LambdaParameterState.js +184 -0
- package/lib/stores/LambdaParameterState.js.map +1 -0
- package/lib/stores/LegendApplicationAssistantService.d.ts +63 -0
- package/lib/stores/LegendApplicationAssistantService.d.ts.map +1 -0
- package/lib/stores/LegendApplicationAssistantService.js +167 -0
- package/lib/stores/LegendApplicationAssistantService.js.map +1 -0
- package/lib/stores/LegendApplicationConfig.d.ts +5 -4
- package/lib/stores/LegendApplicationConfig.d.ts.map +1 -1
- package/lib/stores/LegendApplicationConfig.js +8 -3
- package/lib/stores/LegendApplicationConfig.js.map +1 -1
- package/lib/stores/LegendApplicationDocumentationService.d.ts +70 -0
- package/lib/stores/LegendApplicationDocumentationService.d.ts.map +1 -0
- package/lib/stores/LegendApplicationDocumentationService.js +152 -0
- package/lib/stores/LegendApplicationDocumentationService.js.map +1 -0
- package/lib/stores/LegendApplicationEventService.d.ts +22 -0
- package/lib/stores/LegendApplicationEventService.d.ts.map +1 -0
- package/lib/stores/LegendApplicationEventService.js +25 -0
- package/lib/stores/LegendApplicationEventService.js.map +1 -0
- package/lib/stores/LegendApplicationNavigationContextService.d.ts +74 -0
- package/lib/stores/LegendApplicationNavigationContextService.d.ts.map +1 -0
- package/lib/stores/LegendApplicationNavigationContextService.js +118 -0
- package/lib/stores/LegendApplicationNavigationContextService.js.map +1 -0
- package/lib/stores/LegendApplicationPlugin.d.ts +6 -2
- package/lib/stores/LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/stores/LegendApplicationPlugin.js.map +1 -1
- package/lib/stores/PureLanguageSupport.d.ts.map +1 -1
- package/lib/stores/PureLanguageSupport.js +8 -2
- package/lib/stores/PureLanguageSupport.js.map +1 -1
- package/lib/stores/ValueSpecificationModifierHelper.d.ts +27 -0
- package/lib/stores/ValueSpecificationModifierHelper.d.ts.map +1 -0
- package/lib/stores/ValueSpecificationModifierHelper.js +49 -0
- package/lib/stores/ValueSpecificationModifierHelper.js.map +1 -0
- package/package.json +24 -18
- package/src/application/LegendApplication.tsx +6 -6
- package/src/application/LegendApplicationPluginManager.tsx +3 -3
- package/src/components/ActionAlert.tsx +2 -2
- package/src/components/ApplicationStoreProvider.tsx +4 -4
- package/src/components/ApplicationStoreProviderTestUtils.tsx +7 -6
- package/src/components/BasicValueSpecificationEditor.tsx +703 -0
- package/src/components/BlockingAlert.tsx +1 -1
- package/src/components/CustomDatePicker.tsx +1235 -0
- package/src/components/DocumentationLink.tsx +2 -2
- package/src/components/LambdaEditor.tsx +4 -4
- package/src/components/LambdaParameterValuesEditor.tsx +114 -0
- package/src/components/LegendApplicationComponentFrameworkProvider.tsx +3 -3
- package/src/components/LegendApplicationNavigationContextServiceUtils.tsx +63 -0
- package/src/components/NotificationManager.tsx +2 -2
- package/src/components/TextInputEditor.tsx +2 -2
- package/src/components/VirtualAssistant.tsx +600 -0
- package/src/components/WebApplicationNavigatorProvider.tsx +1 -1
- package/src/components/WebApplicationNavigatorProviderTestUtils.tsx +3 -2
- package/src/index.ts +39 -28
- package/src/stores/ApplicationEvent.ts +11 -7
- package/src/stores/ApplicationStore.ts +29 -27
- package/src/stores/ApplicationStoreTestUtils.ts +4 -4
- package/src/stores/ApplicationTelemetry.ts +2 -2
- package/src/stores/CJS__Fuse.cts +28 -0
- package/src/stores/LambdaParameterState.ts +314 -0
- package/src/stores/LegendApplicationAssistantService.ts +218 -0
- package/src/stores/LegendApplicationConfig.ts +20 -6
- package/src/stores/LegendApplicationDocumentationService.ts +276 -0
- package/src/stores/LegendApplicationEventService.ts +32 -0
- package/src/stores/LegendApplicationNavigationContextService.ts +131 -0
- package/src/stores/LegendApplicationPlugin.ts +10 -2
- package/src/stores/PureLanguageSupport.ts +8 -2
- package/src/stores/ValueSpecificationModifierHelper.ts +104 -0
- package/tsconfig.json +18 -12
- package/lib/components/AppHeader.d.ts.map +0 -1
- package/lib/components/AppHeader.js +0 -26
- package/lib/components/AppHeader.js.map +0 -1
- package/lib/stores/LegendApplicationDocumentationRegistry.d.ts +0 -36
- package/lib/stores/LegendApplicationDocumentationRegistry.d.ts.map +0 -1
- package/lib/stores/LegendApplicationDocumentationRegistry.js +0 -47
- package/lib/stores/LegendApplicationDocumentationRegistry.js.map +0 -1
- package/src/components/AppHeader.tsx +0 -49
- package/src/stores/LegendApplicationDocumentationRegistry.ts +0 -81
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
+
|
|
17
|
+
import { IllegalStateError } from '@finos/legend-shared';
|
|
18
|
+
import { action, computed, makeObservable, observable } from 'mobx';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Context data refers to the area of the application that the user is
|
|
22
|
+
* currently navigating.
|
|
23
|
+
*
|
|
24
|
+
* NOTE: note that this is navigation-driven, do not associate places
|
|
25
|
+
* which present in the app screen that is not a direct consequence
|
|
26
|
+
* of user's navigation. e.g. the status bar is not a good area to
|
|
27
|
+
* be considered a context, the editor screen is because it means
|
|
28
|
+
* the user must have navigated to the editor screen from somewhere,
|
|
29
|
+
* for instance, the setup page.
|
|
30
|
+
*/
|
|
31
|
+
export class ApplicationNavigationContextData {
|
|
32
|
+
value: string;
|
|
33
|
+
/**
|
|
34
|
+
* There are 2 types of context data: `standard` and `transient`
|
|
35
|
+
* 1. standard context data represents an application context layer that
|
|
36
|
+
* would be pushed to the stack and the context will be popped as we leave
|
|
37
|
+
* the application, in other words, the context will be properly cleaned up
|
|
38
|
+
* e.g. when we go in an editor, we will push context data to the stack and
|
|
39
|
+
* pop it when we leave that editor
|
|
40
|
+
* 2. transient context does not guarantee to be cleaned up properly, this
|
|
41
|
+
* corresponds to application areas whose presense is transient and not stable:
|
|
42
|
+
* such as those triggered by on-flight events, whose exit-state is hard to capture
|
|
43
|
+
* e.g. user focuses on an input
|
|
44
|
+
*
|
|
45
|
+
* NOTE: transient context must not be mistakened as event, even in the example of
|
|
46
|
+
* user focusing on an input, that's an area of the application that we might want
|
|
47
|
+
* to get record of in terms of context. Events like a notification pop up, failure
|
|
48
|
+
* of some long-running processes are not considered application contexts
|
|
49
|
+
*/
|
|
50
|
+
isTransient = false;
|
|
51
|
+
|
|
52
|
+
private constructor(value: string, isTransient: boolean) {
|
|
53
|
+
this.value = value;
|
|
54
|
+
this.isTransient = isTransient;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static create(value: string): ApplicationNavigationContextData {
|
|
58
|
+
return new ApplicationNavigationContextData(value, false);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static createTransient(value: string): ApplicationNavigationContextData {
|
|
62
|
+
return new ApplicationNavigationContextData(value, true);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class LegendApplicationNavigationContextService {
|
|
67
|
+
contextStack: ApplicationNavigationContextData[] = [];
|
|
68
|
+
|
|
69
|
+
constructor() {
|
|
70
|
+
makeObservable(this, {
|
|
71
|
+
contextStack: observable,
|
|
72
|
+
currentContext: computed,
|
|
73
|
+
push: action,
|
|
74
|
+
pop: action,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get currentContext(): ApplicationNavigationContextData | undefined {
|
|
79
|
+
return this.contextStack.length
|
|
80
|
+
? this.contextStack[this.contextStack.length - 1]
|
|
81
|
+
: undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Add the context to the stack.
|
|
86
|
+
*
|
|
87
|
+
* If the context is already if the context is already part of the stack
|
|
88
|
+
* we will throw an error. This is to make sure we context is unique in the stack
|
|
89
|
+
* and we do proper context stack cleanups on navigation.
|
|
90
|
+
*/
|
|
91
|
+
push(context: ApplicationNavigationContextData): void {
|
|
92
|
+
// first, filter out all transient contexts, so we can be sure that
|
|
93
|
+
// all of the remaining contexts are standard and they should be cleaned up properly
|
|
94
|
+
// this makes our duplication meaningful
|
|
95
|
+
const newContextStack = this.contextStack.filter((ctx) => !ctx.isTransient);
|
|
96
|
+
if (newContextStack.find((ctx) => ctx.value === context.value)) {
|
|
97
|
+
throw new IllegalStateError(
|
|
98
|
+
`Found multiple context '${context.value}' in application navigation context stack`,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
newContextStack.push(context);
|
|
102
|
+
this.contextStack = newContextStack;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Remove the context from the stack.
|
|
107
|
+
*
|
|
108
|
+
* NOTE: we will check from bottom of the stack up, for the specified context,
|
|
109
|
+
* if it's found in the context stack, we will pop until the specified context.
|
|
110
|
+
* This is to allow popping deeper context layers from very high up in the application
|
|
111
|
+
* context stack, e.g. removing a context of an element editor when leaving the editor
|
|
112
|
+
* to go to setup page.
|
|
113
|
+
*/
|
|
114
|
+
pop(context: ApplicationNavigationContextData): void {
|
|
115
|
+
const existingCtx = this.contextStack.find(
|
|
116
|
+
(ctx) => ctx.value === context.value,
|
|
117
|
+
);
|
|
118
|
+
if (!existingCtx) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// NOTE: since we should not have any duplicated contexts
|
|
122
|
+
// it's safe to search from bottom to top of the stack
|
|
123
|
+
const idx = this.contextStack.indexOf(existingCtx);
|
|
124
|
+
if (idx !== -1) {
|
|
125
|
+
this.contextStack = this.contextStack
|
|
126
|
+
.slice(0, idx)
|
|
127
|
+
// remove all transient contexts
|
|
128
|
+
.filter((ctx) => !ctx.isTransient);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -15,11 +15,19 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { AbstractPlugin } from '@finos/legend-shared';
|
|
18
|
-
import type {
|
|
18
|
+
import type {
|
|
19
|
+
LegendApplicationKeyedContextualDocumentationEntry,
|
|
20
|
+
LegendApplicationKeyedDocumentationEntry,
|
|
21
|
+
} from './LegendApplicationDocumentationService.js';
|
|
19
22
|
|
|
20
23
|
export abstract class LegendApplicationPlugin extends AbstractPlugin {
|
|
21
24
|
/**
|
|
22
|
-
* Get the list of keyed documentation entries to be
|
|
25
|
+
* Get the list of keyed documentation entries to be registered with documentation service.
|
|
23
26
|
*/
|
|
24
27
|
getExtraKeyedDocumentationEntries?(): LegendApplicationKeyedDocumentationEntry[];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the list of keyed contextual documentation entries to be registered with documentation service.
|
|
31
|
+
*/
|
|
32
|
+
getExtraKeyedContextualDocumentationEntries?(): LegendApplicationKeyedContextualDocumentationEntry[];
|
|
25
33
|
}
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
editor as monacoEditorAPI,
|
|
27
27
|
languages as monacoLanguagesAPI,
|
|
28
28
|
} from 'monaco-editor';
|
|
29
|
-
import { EDITOR_LANGUAGE, EDITOR_THEME } from '../const';
|
|
29
|
+
import { EDITOR_LANGUAGE, EDITOR_THEME } from '../const.js';
|
|
30
30
|
|
|
31
31
|
const theme: monacoEditorAPI.IStandaloneThemeData = {
|
|
32
32
|
base: 'vs-dark', // can also be vs-dark or hc-black
|
|
@@ -86,6 +86,12 @@ const configuration: monacoLanguagesAPI.LanguageConfiguration = {
|
|
|
86
86
|
*
|
|
87
87
|
* The way SQL monarch definition is organized is good and worth learning from
|
|
88
88
|
* See https://github.com/microsoft/monaco-languages/blob/master/src/sql/sql.ts
|
|
89
|
+
*
|
|
90
|
+
* NOTE: using `monarch` only allows fairly very basic syntax-highlighting
|
|
91
|
+
* to actually do full AST analysis, we might need something more serious like
|
|
92
|
+
* using TextMate grammar which is used by VSCode itself
|
|
93
|
+
* See https://github.com/microsoft/monaco-editor#faq
|
|
94
|
+
* See https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
|
|
89
95
|
*/
|
|
90
96
|
const generateLanguageMonarch = (
|
|
91
97
|
extraKeywords: string[],
|
|
@@ -183,7 +189,7 @@ const generateLanguageMonarch = (
|
|
|
183
189
|
PURE_PARSER.FLATDATA,
|
|
184
190
|
PURE_PARSER.RELATIONAL,
|
|
185
191
|
PURE_PARSER.GENERATION_SPECIFICATION,
|
|
186
|
-
PURE_PARSER.
|
|
192
|
+
PURE_PARSER.FILE_GENERATION_SPECIFICATION,
|
|
187
193
|
PURE_PARSER.DATA,
|
|
188
194
|
] as string[]
|
|
189
195
|
)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
+
|
|
17
|
+
import {
|
|
18
|
+
type GenericType,
|
|
19
|
+
type Type,
|
|
20
|
+
type Multiplicity,
|
|
21
|
+
type FunctionExpression,
|
|
22
|
+
type ValueSpecification,
|
|
23
|
+
type ObserverContext,
|
|
24
|
+
type VariableExpression,
|
|
25
|
+
type InstanceValue,
|
|
26
|
+
type GraphFetchTree,
|
|
27
|
+
type AbstractPropertyExpression,
|
|
28
|
+
observe_ValueSpecification,
|
|
29
|
+
} from '@finos/legend-graph';
|
|
30
|
+
import { addUniqueEntry, deleteEntry } from '@finos/legend-shared';
|
|
31
|
+
import { action } from 'mobx';
|
|
32
|
+
|
|
33
|
+
export const genericType_setRawType = action(
|
|
34
|
+
(genericType: GenericType, type: Type): void => {
|
|
35
|
+
genericType.rawType = type;
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export const multiplicity_setLowerBound = action(
|
|
40
|
+
(_m: Multiplicity, val: number): void => {
|
|
41
|
+
_m.lowerBound = val;
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
export const multiplicity_setUpperBound = action(
|
|
45
|
+
(_m: Multiplicity, val: number | undefined): void => {
|
|
46
|
+
_m.upperBound = val;
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const functionExpression_setParametersValues = action(
|
|
51
|
+
(
|
|
52
|
+
functionExpression: FunctionExpression,
|
|
53
|
+
val: ValueSpecification[],
|
|
54
|
+
context: ObserverContext,
|
|
55
|
+
): void => {
|
|
56
|
+
functionExpression.parametersValues = val.map((v) =>
|
|
57
|
+
observe_ValueSpecification(v, context),
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
export const variableExpression_setName = action(
|
|
63
|
+
(v: VariableExpression, val: string): void => {
|
|
64
|
+
v.name = val;
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export const instanceValue_changeValue = action(
|
|
69
|
+
(instanceValue: InstanceValue, val: unknown, idx: number) => {
|
|
70
|
+
instanceValue.values[idx] = val;
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const instanceValue_changeValues = action(
|
|
75
|
+
(instanceValue: InstanceValue, val: unknown[]) => {
|
|
76
|
+
instanceValue.values = val;
|
|
77
|
+
},
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const graphFetchTree_addSubTree = action(
|
|
81
|
+
(tree: GraphFetchTree, val: GraphFetchTree): void => {
|
|
82
|
+
addUniqueEntry(tree.subTrees, val);
|
|
83
|
+
},
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const graphFetchTree_removeSubTree = action(
|
|
87
|
+
(tree: GraphFetchTree, val: GraphFetchTree): void => {
|
|
88
|
+
deleteEntry(tree.subTrees, val);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
export const propertyExpression_setParametersValue = action(
|
|
93
|
+
(
|
|
94
|
+
propertyExpression: AbstractPropertyExpression,
|
|
95
|
+
idx: number,
|
|
96
|
+
val: ValueSpecification,
|
|
97
|
+
context: ObserverContext,
|
|
98
|
+
): void => {
|
|
99
|
+
propertyExpression.parametersValues[idx] = observe_ValueSpecification(
|
|
100
|
+
val,
|
|
101
|
+
context,
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
);
|
package/tsconfig.json
CHANGED
|
@@ -12,14 +12,11 @@
|
|
|
12
12
|
"declarationMap": true,
|
|
13
13
|
"sourceMap": true,
|
|
14
14
|
"target": "esnext",
|
|
15
|
-
"module": "
|
|
15
|
+
"module": "nodenext",
|
|
16
16
|
"skipLibCheck": true,
|
|
17
|
-
"moduleResolution": "node",
|
|
18
17
|
"resolveJsonModule": true,
|
|
19
18
|
"isolatedModules": true,
|
|
20
19
|
"importsNotUsedAsValues": "error",
|
|
21
|
-
"esModuleInterop": true,
|
|
22
|
-
"allowSyntheticDefaultImports": true,
|
|
23
20
|
"strict": true,
|
|
24
21
|
"noImplicitOverride": true,
|
|
25
22
|
"noUncheckedIndexedAccess": true,
|
|
@@ -39,36 +36,45 @@
|
|
|
39
36
|
"./src/stores/ApplicationStoreTestUtils.ts",
|
|
40
37
|
"./src/stores/ApplicationTelemetry.ts",
|
|
41
38
|
"./src/stores/LambdaEditorState.ts",
|
|
39
|
+
"./src/stores/LambdaParameterState.ts",
|
|
40
|
+
"./src/stores/LegendApplicationAssistantService.ts",
|
|
42
41
|
"./src/stores/LegendApplicationConfig.ts",
|
|
43
|
-
"./src/stores/
|
|
42
|
+
"./src/stores/LegendApplicationDocumentationService.ts",
|
|
43
|
+
"./src/stores/LegendApplicationEventService.ts",
|
|
44
|
+
"./src/stores/LegendApplicationNavigationContextService.ts",
|
|
44
45
|
"./src/stores/LegendApplicationPlugin.ts",
|
|
45
46
|
"./src/stores/PackageableElementOption.ts",
|
|
46
47
|
"./src/stores/PureLanguageSupport.ts",
|
|
48
|
+
"./src/stores/ValueSpecificationModifierHelper.ts",
|
|
47
49
|
"./src/stores/WebApplicationNavigator.ts",
|
|
48
50
|
"./src/application/LegendApplication.tsx",
|
|
49
51
|
"./src/application/LegendApplicationPluginManager.tsx",
|
|
50
52
|
"./src/components/ActionAlert.tsx",
|
|
51
|
-
"./src/components/AppHeader.tsx",
|
|
52
53
|
"./src/components/ApplicationStoreProvider.tsx",
|
|
53
54
|
"./src/components/ApplicationStoreProviderTestUtils.tsx",
|
|
55
|
+
"./src/components/BasicValueSpecificationEditor.tsx",
|
|
54
56
|
"./src/components/BlockingAlert.tsx",
|
|
57
|
+
"./src/components/CustomDatePicker.tsx",
|
|
55
58
|
"./src/components/DocumentationLink.tsx",
|
|
56
59
|
"./src/components/LambdaEditor.tsx",
|
|
60
|
+
"./src/components/LambdaParameterValuesEditor.tsx",
|
|
57
61
|
"./src/components/LegendApplicationComponentFrameworkProvider.tsx",
|
|
62
|
+
"./src/components/LegendApplicationNavigationContextServiceUtils.tsx",
|
|
58
63
|
"./src/components/NotificationManager.tsx",
|
|
59
64
|
"./src/components/TextInputEditor.tsx",
|
|
65
|
+
"./src/components/VirtualAssistant.tsx",
|
|
60
66
|
"./src/components/WebApplicationNavigatorProvider.tsx",
|
|
61
|
-
"./src/components/WebApplicationNavigatorProviderTestUtils.tsx"
|
|
67
|
+
"./src/components/WebApplicationNavigatorProviderTestUtils.tsx",
|
|
68
|
+
"./src/stores/CJS__Fuse.cts"
|
|
62
69
|
],
|
|
63
70
|
"include": [
|
|
64
71
|
"src/**/*.ts",
|
|
65
72
|
"src/**/*.tsx",
|
|
66
|
-
"src/**/*.json"
|
|
73
|
+
"src/**/*.json",
|
|
74
|
+
"src/**/*.cts"
|
|
67
75
|
],
|
|
68
76
|
"exclude": [
|
|
69
|
-
"src/**/__tests__
|
|
70
|
-
"src/**/
|
|
71
|
-
"src/**/__mocks__/**/*.ts",
|
|
72
|
-
"src/**/__mocks__/**/*.tsx"
|
|
77
|
+
"src/**/__tests__/**/*.*",
|
|
78
|
+
"src/**/__mocks__/**/*.*"
|
|
73
79
|
]
|
|
74
80
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../src/components/AppHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAMH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CA0BA,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Link } from 'react-router-dom';
|
|
18
|
-
import { LegendLogo } from '@finos/legend-art';
|
|
19
|
-
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
20
|
-
export const AppHeader = (props) => {
|
|
21
|
-
const { children } = props;
|
|
22
|
-
const applicationStore = useApplicationStore();
|
|
23
|
-
const config = applicationStore.config;
|
|
24
|
-
return (_jsx("div", { className: "app__header", children: _jsxs("div", { className: "app__header__content", children: [_jsxs("div", { className: "app__header__title", children: [_jsx(Link, { to: "/", children: _jsx(LegendLogo, { className: "app__header__logo" }) }), _jsx(Link, { to: "/", children: _jsx("div", { className: "app__header__tag app__header__app-name", children: config.appName.toUpperCase() }) }), _jsx("div", { className: "app__header__tag app__header__tag__name", children: "env" }), _jsx("div", { className: "app__header__tag app__header__tag__value app__header__env", children: config.env ? config.env.toUpperCase() : 'UNKNOWN' })] }), _jsx("div", { className: "app__header__actions", children: children })] }) }));
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=AppHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../../src/components/AppHeader.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,SAAS,GAEjB,CAAC,KAAK,EAAE,EAAE;IACb,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAEvC,OAAO,CACL,cAAK,SAAS,EAAC,aAAa,YAC1B,eAAK,SAAS,EAAC,sBAAsB,aACnC,eAAK,SAAS,EAAC,oBAAoB,aACjC,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,YACV,KAAC,UAAU,IAAC,SAAS,EAAC,mBAAmB,GAAG,GACvC,EACP,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,YACV,cAAK,SAAS,EAAC,wCAAwC,YACpD,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,GACzB,GACD,EACP,cAAK,SAAS,EAAC,yCAAyC,oBAAU,EAClE,cAAK,SAAS,EAAC,2DAA2D,YACvE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,GAC9C,IACF,EACN,cAAK,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAO,IAClD,GACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
-
import { type MarkdownText, type PlainObject, SerializationFactory } from '@finos/legend-shared';
|
|
17
|
-
export declare class LegendApplicationDocumentationEntry {
|
|
18
|
-
markdownText?: MarkdownText | undefined;
|
|
19
|
-
title?: string | undefined;
|
|
20
|
-
text?: string | undefined;
|
|
21
|
-
url?: string | undefined;
|
|
22
|
-
static readonly serialization: SerializationFactory<LegendApplicationDocumentationEntry>;
|
|
23
|
-
}
|
|
24
|
-
export interface LegendApplicationKeyedDocumentationEntry {
|
|
25
|
-
key: string;
|
|
26
|
-
content: LegendApplicationDocumentationEntry;
|
|
27
|
-
}
|
|
28
|
-
export declare const collectKeyedDocumnetationEntriesFromConfig: (rawEntries: Record<string, PlainObject<LegendApplicationDocumentationEntry>>) => LegendApplicationKeyedDocumentationEntry[];
|
|
29
|
-
export declare class LegendApplicationDocumentationRegistry {
|
|
30
|
-
url?: string | undefined;
|
|
31
|
-
private registry;
|
|
32
|
-
registerEntry(key: string, value: LegendApplicationDocumentationEntry): void;
|
|
33
|
-
getEntry(key: string): LegendApplicationDocumentationEntry | undefined;
|
|
34
|
-
hasEntry(key: string): boolean;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=LegendApplicationDocumentationRegistry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegendApplicationDocumentationRegistry.d.ts","sourceRoot":"","sources":["../../src/stores/LegendApplicationDocumentationRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAS9B,qBAAa,mCAAmC;IAC9C,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzB,MAAM,CAAC,QAAQ,CAAC,aAAa,4DAU3B;CACH;AAED,MAAM,WAAW,wCAAwC;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,mCAAmC,CAAC;CAC9C;AAED,eAAO,MAAM,0CAA0C,eACzC,OAAO,MAAM,EAAE,YAAY,mCAAmC,CAAC,CAAC,KAC3E,wCAAwC,EAMtC,CAAC;AAEN,qBAAa,sCAAsC;IACjD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAA0D;IAE1E,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,mCAAmC,GAAG,IAAI;IAI5E,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,mCAAmC,GAAG,SAAS;IAItE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAG/B"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
-
import { deserializeMarkdownText, SerializationFactory, } from '@finos/legend-shared';
|
|
17
|
-
import { createModelSchema, custom, optional, primitive, SKIP, } from 'serializr';
|
|
18
|
-
export class LegendApplicationDocumentationEntry {
|
|
19
|
-
markdownText;
|
|
20
|
-
title;
|
|
21
|
-
text;
|
|
22
|
-
url;
|
|
23
|
-
static serialization = new SerializationFactory(createModelSchema(LegendApplicationDocumentationEntry, {
|
|
24
|
-
markdownText: custom(() => SKIP, (val) => deserializeMarkdownText(val)),
|
|
25
|
-
title: optional(primitive()),
|
|
26
|
-
text: optional(primitive()),
|
|
27
|
-
url: optional(primitive()),
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
export const collectKeyedDocumnetationEntriesFromConfig = (rawEntries) => Object.entries(rawEntries).map((entry) => ({
|
|
31
|
-
key: entry[0],
|
|
32
|
-
content: LegendApplicationDocumentationEntry.serialization.fromJson(entry[1]),
|
|
33
|
-
}));
|
|
34
|
-
export class LegendApplicationDocumentationRegistry {
|
|
35
|
-
url;
|
|
36
|
-
registry = new Map();
|
|
37
|
-
registerEntry(key, value) {
|
|
38
|
-
this.registry.set(key, value);
|
|
39
|
-
}
|
|
40
|
-
getEntry(key) {
|
|
41
|
-
return this.registry.get(key);
|
|
42
|
-
}
|
|
43
|
-
hasEntry(key) {
|
|
44
|
-
return this.registry.has(key);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=LegendApplicationDocumentationRegistry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegendApplicationDocumentationRegistry.js","sourceRoot":"","sources":["../../src/stores/LegendApplicationDocumentationRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,GACL,MAAM,WAAW,CAAC;AAEnB,MAAM,OAAO,mCAAmC;IAC9C,YAAY,CAA4B;IACxC,KAAK,CAAsB;IAC3B,IAAI,CAAsB;IAC1B,GAAG,CAAsB;IAEzB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,mCAAmC,EAAE;QACrD,YAAY,EAAE,MAAM,CAClB,GAAG,EAAE,CAAC,IAAI,EACV,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,CAAC,CACtC;QACD,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC5B,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC3B,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;KAC3B,CAAC,CACH,CAAC;;AAQJ,MAAM,CAAC,MAAM,0CAA0C,GAAG,CACxD,UAA4E,EAChC,EAAE,CAC9C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACzC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACb,OAAO,EAAE,mCAAmC,CAAC,aAAa,CAAC,QAAQ,CACjE,KAAK,CAAC,CAAC,CAAC,CACT;CACF,CAAC,CAAC,CAAC;AAEN,MAAM,OAAO,sCAAsC;IACjD,GAAG,CAAsB;IAEjB,QAAQ,GAAG,IAAI,GAAG,EAA+C,CAAC;IAE1E,aAAa,CAAC,GAAW,EAAE,KAA0C;QACnE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
-
|
|
17
|
-
import { Link } from 'react-router-dom';
|
|
18
|
-
import { LegendLogo } from '@finos/legend-art';
|
|
19
|
-
import { useApplicationStore } from './ApplicationStoreProvider';
|
|
20
|
-
|
|
21
|
-
export const AppHeader: React.FC<{
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
}> = (props) => {
|
|
24
|
-
const { children } = props;
|
|
25
|
-
const applicationStore = useApplicationStore();
|
|
26
|
-
const config = applicationStore.config;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div className="app__header">
|
|
30
|
-
<div className="app__header__content">
|
|
31
|
-
<div className="app__header__title">
|
|
32
|
-
<Link to="/">
|
|
33
|
-
<LegendLogo className="app__header__logo" />
|
|
34
|
-
</Link>
|
|
35
|
-
<Link to="/">
|
|
36
|
-
<div className="app__header__tag app__header__app-name">
|
|
37
|
-
{config.appName.toUpperCase()}
|
|
38
|
-
</div>
|
|
39
|
-
</Link>
|
|
40
|
-
<div className="app__header__tag app__header__tag__name">env</div>
|
|
41
|
-
<div className="app__header__tag app__header__tag__value app__header__env">
|
|
42
|
-
{config.env ? config.env.toUpperCase() : 'UNKNOWN'}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
<div className="app__header__actions">{children}</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, Goldman Sachs
|
|
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
|
-
|
|
17
|
-
import {
|
|
18
|
-
type MarkdownText,
|
|
19
|
-
type PlainObject,
|
|
20
|
-
deserializeMarkdownText,
|
|
21
|
-
SerializationFactory,
|
|
22
|
-
} from '@finos/legend-shared';
|
|
23
|
-
import {
|
|
24
|
-
createModelSchema,
|
|
25
|
-
custom,
|
|
26
|
-
optional,
|
|
27
|
-
primitive,
|
|
28
|
-
SKIP,
|
|
29
|
-
} from 'serializr';
|
|
30
|
-
|
|
31
|
-
export class LegendApplicationDocumentationEntry {
|
|
32
|
-
markdownText?: MarkdownText | undefined;
|
|
33
|
-
title?: string | undefined;
|
|
34
|
-
text?: string | undefined;
|
|
35
|
-
url?: string | undefined;
|
|
36
|
-
|
|
37
|
-
static readonly serialization = new SerializationFactory(
|
|
38
|
-
createModelSchema(LegendApplicationDocumentationEntry, {
|
|
39
|
-
markdownText: custom(
|
|
40
|
-
() => SKIP,
|
|
41
|
-
(val) => deserializeMarkdownText(val),
|
|
42
|
-
),
|
|
43
|
-
title: optional(primitive()),
|
|
44
|
-
text: optional(primitive()),
|
|
45
|
-
url: optional(primitive()),
|
|
46
|
-
}),
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface LegendApplicationKeyedDocumentationEntry {
|
|
51
|
-
key: string;
|
|
52
|
-
content: LegendApplicationDocumentationEntry;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const collectKeyedDocumnetationEntriesFromConfig = (
|
|
56
|
-
rawEntries: Record<string, PlainObject<LegendApplicationDocumentationEntry>>,
|
|
57
|
-
): LegendApplicationKeyedDocumentationEntry[] =>
|
|
58
|
-
Object.entries(rawEntries).map((entry) => ({
|
|
59
|
-
key: entry[0],
|
|
60
|
-
content: LegendApplicationDocumentationEntry.serialization.fromJson(
|
|
61
|
-
entry[1],
|
|
62
|
-
),
|
|
63
|
-
}));
|
|
64
|
-
|
|
65
|
-
export class LegendApplicationDocumentationRegistry {
|
|
66
|
-
url?: string | undefined;
|
|
67
|
-
|
|
68
|
-
private registry = new Map<string, LegendApplicationDocumentationEntry>();
|
|
69
|
-
|
|
70
|
-
registerEntry(key: string, value: LegendApplicationDocumentationEntry): void {
|
|
71
|
-
this.registry.set(key, value);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
getEntry(key: string): LegendApplicationDocumentationEntry | undefined {
|
|
75
|
-
return this.registry.get(key);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
hasEntry(key: string): boolean {
|
|
79
|
-
return this.registry.has(key);
|
|
80
|
-
}
|
|
81
|
-
}
|