@finos/legend-application-studio 28.2.3 → 28.2.4
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/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +34 -24
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +5 -5
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorGraphState.d.ts +4 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +17 -0
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +2 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts +23 -21
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js +36 -24
- package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js.map +1 -1
- package/package.json +4 -4
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +84 -56
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +17 -15
- package/src/stores/editor/EditorGraphState.ts +30 -0
- package/src/stores/editor/EditorStore.ts +2 -1
- package/src/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.ts +65 -27
package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx
CHANGED
@@ -18,8 +18,6 @@ import { observer } from 'mobx-react-lite';
|
|
18
18
|
import { useState } from 'react';
|
19
19
|
import {
|
20
20
|
type RelationalDatabaseConnectionValueState,
|
21
|
-
CORE_AUTHENTICATION_STRATEGY_TYPE,
|
22
|
-
CORE_DATASOURCE_SPEC_TYPE,
|
23
21
|
RELATIONAL_DATABASE_TAB_TYPE,
|
24
22
|
POST_PROCESSOR_TYPE,
|
25
23
|
} from '../../../../stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js';
|
@@ -61,6 +59,8 @@ import {
|
|
61
59
|
type RelationalDatabaseConnection,
|
62
60
|
type Store,
|
63
61
|
type PostProcessor,
|
62
|
+
type DatasourceSpecification,
|
63
|
+
type AuthenticationStrategy,
|
64
64
|
DatabaseType,
|
65
65
|
DelegatedKerberosAuthenticationStrategy,
|
66
66
|
OAuthAuthenticationStrategy,
|
@@ -165,6 +165,7 @@ import {
|
|
165
165
|
import { MapperPostProcessorEditor } from './post-processor-editor/MapperPostProcessorEditor.js';
|
166
166
|
import { UnsupportedEditorPanel } from '../UnsupportedElementEditor.js';
|
167
167
|
import type { MapperPostProcessorEditorState } from '../../../../stores/editor/editor-state/element-editor-state/connection/PostProcessorEditorState.js';
|
168
|
+
import { prettyCONSTName, uniq } from '@finos/legend-shared';
|
168
169
|
|
169
170
|
const LocalH2DatasourceSpecificationEditor = observer(
|
170
171
|
(props: {
|
@@ -1575,43 +1576,58 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1575
1576
|
const connection = connectionValueState.connection;
|
1576
1577
|
const editorStore = useEditorStore();
|
1577
1578
|
const plugins = editorStore.pluginManager.getApplicationPlugins();
|
1579
|
+
const databseTypeConfigs =
|
1580
|
+
connectionValueState.editorStore.graphState
|
1581
|
+
.relationalDatabseTypeConfigurations;
|
1582
|
+
const availableDbTypes = databseTypeConfigs
|
1583
|
+
? // Currently H2 Flow is not returned in relational configs. We will remove this once it is properly returned as a supported flow in engine
|
1584
|
+
uniq([DatabaseType.H2, ...databseTypeConfigs.map((e) => e.type)])
|
1585
|
+
: Object.values(DatabaseType);
|
1578
1586
|
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
label: type,
|
1587
|
+
const dbTypes = availableDbTypes.map((dbType) => ({
|
1588
|
+
value: dbType,
|
1589
|
+
label: dbType,
|
1583
1590
|
}));
|
1584
|
-
|
1591
|
+
|
1592
|
+
const selectedDbType = {
|
1585
1593
|
value: connection.type,
|
1586
1594
|
label: connection.type,
|
1587
1595
|
};
|
1596
|
+
|
1588
1597
|
const onTypeChange = (
|
1589
1598
|
val: { label: string; value: string } | null,
|
1590
1599
|
): void => {
|
1591
1600
|
dBConnection_setType(connection, val?.value ?? DatabaseType.H2);
|
1601
|
+
if (connectionValueState.selectedValidDatasources[0]) {
|
1602
|
+
connectionValueState.changeDatasourceSpec(
|
1603
|
+
connectionValueState.selectedValidDatasources[0],
|
1604
|
+
);
|
1605
|
+
}
|
1606
|
+
if (connectionValueState.selectedValidAuthenticationStrategies[0]) {
|
1607
|
+
connectionValueState.changeAuthenticationStrategy(
|
1608
|
+
connectionValueState.selectedValidAuthenticationStrategies[0],
|
1609
|
+
);
|
1610
|
+
}
|
1592
1611
|
};
|
1593
1612
|
|
1594
1613
|
// source spec type
|
1595
|
-
const sourceSpecOptions = (
|
1596
|
-
|
1597
|
-
)
|
1598
|
-
.concat(
|
1599
|
-
plugins.flatMap(
|
1600
|
-
(plugin) =>
|
1601
|
-
(
|
1602
|
-
plugin as STO_Relational_LegendStudioApplicationPlugin_Extension
|
1603
|
-
).getExtraDatasourceSpecificationTypes?.() ?? [],
|
1604
|
-
),
|
1605
|
-
)
|
1606
|
-
.map((type) => ({
|
1614
|
+
const sourceSpecOptions = connectionValueState.selectedValidDatasources.map(
|
1615
|
+
(type) => ({
|
1607
1616
|
value: type,
|
1608
|
-
label: type,
|
1609
|
-
})
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
}
|
1617
|
+
label: prettyCONSTName(type),
|
1618
|
+
}),
|
1619
|
+
);
|
1620
|
+
|
1621
|
+
const selectedSourceSpec = (
|
1622
|
+
spec: DatasourceSpecification,
|
1623
|
+
): { label: string; value: string | undefined } => ({
|
1624
|
+
label: prettyCONSTName(
|
1625
|
+
connectionValueState.selectedDatasourceSpecificationType(spec) ??
|
1626
|
+
'Unknown',
|
1627
|
+
),
|
1628
|
+
value: connectionValueState.selectedDatasourceSpecificationType(spec),
|
1629
|
+
});
|
1630
|
+
|
1615
1631
|
const onSourceSpecChange = (
|
1616
1632
|
val: { label: string; value: string | undefined } | null,
|
1617
1633
|
): void => {
|
@@ -1621,26 +1637,24 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1621
1637
|
};
|
1622
1638
|
|
1623
1639
|
// auth type
|
1624
|
-
const authOptions =
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
value: connectionValueState.selectedAuthenticationStrategyType,
|
1643
|
-
};
|
1640
|
+
const authOptions =
|
1641
|
+
connectionValueState.selectedValidAuthenticationStrategies.map(
|
1642
|
+
(type) => ({
|
1643
|
+
value: type,
|
1644
|
+
label: prettyCONSTName(type),
|
1645
|
+
}),
|
1646
|
+
);
|
1647
|
+
|
1648
|
+
const selectedAuth = (
|
1649
|
+
auth: AuthenticationStrategy,
|
1650
|
+
): { label: string; value: string | undefined } => ({
|
1651
|
+
label: prettyCONSTName(
|
1652
|
+
connectionValueState.selectedAuthenticationStrategyType(auth) ??
|
1653
|
+
'Unknown',
|
1654
|
+
),
|
1655
|
+
value: connectionValueState.selectedAuthenticationStrategyType(auth),
|
1656
|
+
});
|
1657
|
+
|
1644
1658
|
const onAuthStrategyChange = (
|
1645
1659
|
val: { label: string; value: string | undefined } | null,
|
1646
1660
|
): void => {
|
@@ -1661,9 +1675,9 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1661
1675
|
Database Type
|
1662
1676
|
</div>
|
1663
1677
|
<CustomSelectorInput
|
1664
|
-
options={
|
1678
|
+
options={dbTypes}
|
1665
1679
|
onChange={onTypeChange}
|
1666
|
-
value={
|
1680
|
+
value={selectedDbType}
|
1667
1681
|
darkMode={true}
|
1668
1682
|
/>
|
1669
1683
|
</PanelFormSection>
|
@@ -1685,9 +1699,9 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1685
1699
|
Database Type
|
1686
1700
|
</div>
|
1687
1701
|
<CustomSelectorInput
|
1688
|
-
options={
|
1702
|
+
options={dbTypes}
|
1689
1703
|
onChange={onTypeChange}
|
1690
|
-
value={
|
1704
|
+
value={selectedDbType}
|
1691
1705
|
darkMode={true}
|
1692
1706
|
/>
|
1693
1707
|
</PanelFormSection>
|
@@ -1712,13 +1726,20 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1712
1726
|
<PanelHeader title="datasource specification"></PanelHeader>
|
1713
1727
|
<PanelContent className="relational-connection-editor__auth__content">
|
1714
1728
|
<PanelFormSection>
|
1715
|
-
<div
|
1716
|
-
|
1729
|
+
<div style={{ width: '100%' }}>
|
1730
|
+
<div
|
1731
|
+
style={{ display: 'inline-block', width: '10px' }}
|
1732
|
+
className="panel__content__form__section__header__label"
|
1733
|
+
>
|
1734
|
+
Datasource
|
1735
|
+
</div>
|
1717
1736
|
</div>
|
1718
1737
|
<CustomSelectorInput
|
1719
1738
|
options={sourceSpecOptions}
|
1720
1739
|
onChange={onSourceSpecChange}
|
1721
|
-
value={selectedSourceSpec
|
1740
|
+
value={selectedSourceSpec(
|
1741
|
+
connection.datasourceSpecification,
|
1742
|
+
)}
|
1722
1743
|
darkMode={true}
|
1723
1744
|
/>
|
1724
1745
|
</PanelFormSection>
|
@@ -1739,13 +1760,20 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1739
1760
|
<PanelHeader title="authentication strategy"></PanelHeader>
|
1740
1761
|
<PanelContent className="relational-connection-editor__source__content">
|
1741
1762
|
<PanelFormSection>
|
1742
|
-
<div
|
1743
|
-
|
1763
|
+
<div style={{ width: '100%' }}>
|
1764
|
+
<div
|
1765
|
+
style={{ display: 'inline-block', width: '10px' }}
|
1766
|
+
className="panel__content__form__section__header__label"
|
1767
|
+
>
|
1768
|
+
Authentication
|
1769
|
+
</div>
|
1744
1770
|
</div>
|
1745
1771
|
<CustomSelectorInput
|
1746
1772
|
options={authOptions}
|
1747
1773
|
onChange={onAuthStrategyChange}
|
1748
|
-
value={selectedAuth
|
1774
|
+
value={selectedAuth(
|
1775
|
+
connection.authenticationStrategy,
|
1776
|
+
)}
|
1749
1777
|
darkMode={true}
|
1750
1778
|
/>
|
1751
1779
|
</PanelFormSection>
|
package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx
CHANGED
@@ -615,10 +615,24 @@ export const ServiceTestDataEditor = observer(
|
|
615
615
|
tooltipText="Click to add connection test data"
|
616
616
|
/>
|
617
617
|
)}
|
618
|
+
<PanelLoadingIndicator
|
619
|
+
isLoading={
|
620
|
+
Boolean(
|
621
|
+
testDataState.selectedDataState?.generatingTestDataState
|
622
|
+
.isInProgress,
|
623
|
+
) ||
|
624
|
+
Boolean(
|
625
|
+
testDataState.selectedDataState?.generateSchemaQueryState
|
626
|
+
.isInProgress,
|
627
|
+
)
|
628
|
+
}
|
629
|
+
/>
|
618
630
|
{hideExplorer && selectedDataState ? (
|
619
|
-
|
620
|
-
|
621
|
-
|
631
|
+
<>
|
632
|
+
<ConnectionTestDataEditor
|
633
|
+
connectionTestDataState={selectedDataState}
|
634
|
+
/>
|
635
|
+
</>
|
622
636
|
) : (
|
623
637
|
<ResizablePanelGroup orientation="vertical">
|
624
638
|
<ResizablePanel minSize={100}>
|
@@ -661,18 +675,6 @@ export const ServiceTestDataEditor = observer(
|
|
661
675
|
<ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
|
662
676
|
</ResizablePanelSplitter>
|
663
677
|
<ResizablePanel minSize={600}>
|
664
|
-
<PanelLoadingIndicator
|
665
|
-
isLoading={
|
666
|
-
Boolean(
|
667
|
-
testDataState.selectedDataState?.generatingTestDataState
|
668
|
-
.isInProgress,
|
669
|
-
) ||
|
670
|
-
Boolean(
|
671
|
-
testDataState.selectedDataState?.generateSchemaQueryState
|
672
|
-
.isInProgress,
|
673
|
-
)
|
674
|
-
}
|
675
|
-
/>
|
676
678
|
{testDataState.selectedDataState && (
|
677
679
|
<ConnectionTestDataEditor
|
678
680
|
connectionTestDataState={testDataState.selectedDataState}
|
@@ -86,6 +86,7 @@ import {
|
|
86
86
|
createGraphBuilderReport,
|
87
87
|
ExecutionEnvironmentInstance,
|
88
88
|
type FunctionActivatorConfiguration,
|
89
|
+
type RelationalDatabaseTypeConfiguration,
|
89
90
|
} from '@finos/legend-graph';
|
90
91
|
import { CONFIGURATION_EDITOR_TAB } from './editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js';
|
91
92
|
import { PACKAGEABLE_ELEMENT_TYPE } from './utils/ModelClassifierUtils.js';
|
@@ -126,6 +127,9 @@ export class EditorGraphState {
|
|
126
127
|
isUpdatingApplication = false; // including graph update and async operations such as change detection
|
127
128
|
|
128
129
|
functionActivatorConfigurations: FunctionActivatorConfiguration[] = [];
|
130
|
+
relationalDatabseTypeConfigurations:
|
131
|
+
| RelationalDatabaseTypeConfiguration[]
|
132
|
+
| undefined;
|
129
133
|
|
130
134
|
warnings: CompilationWarning[] = [];
|
131
135
|
error: EngineError | undefined;
|
@@ -151,12 +155,14 @@ export class EditorGraphState {
|
|
151
155
|
warnings: observable,
|
152
156
|
error: observable,
|
153
157
|
enableStrictMode: observable,
|
158
|
+
relationalDatabseTypeConfigurations: observable,
|
154
159
|
problems: computed,
|
155
160
|
areProblemsStale: computed,
|
156
161
|
isApplicationUpdateOperationIsRunning: computed,
|
157
162
|
clearProblems: action,
|
158
163
|
setEnableStrictMode: action,
|
159
164
|
setMostRecentCompilationGraphHash: action,
|
165
|
+
fetchAvailableRelationalDatabseTypeConfigurations: flow,
|
160
166
|
fetchAvailableFunctionActivatorConfigurations: flow,
|
161
167
|
buildGraph: flow,
|
162
168
|
loadEntityChangesToGraph: flow,
|
@@ -289,6 +295,30 @@ export class EditorGraphState {
|
|
289
295
|
}
|
290
296
|
}
|
291
297
|
|
298
|
+
*fetchAvailableRelationalDatabseTypeConfigurations(): GeneratorFn<void> {
|
299
|
+
try {
|
300
|
+
this.relationalDatabseTypeConfigurations =
|
301
|
+
(yield this.editorStore.graphManagerState.graphManager.getAvailableRelationalDatabaseTypeConfigurations()) as
|
302
|
+
| RelationalDatabaseTypeConfiguration[]
|
303
|
+
| undefined;
|
304
|
+
} catch (error) {
|
305
|
+
assertErrorThrown(error);
|
306
|
+
this.editorStore.applicationStore.logService.error(
|
307
|
+
LogEvent.create(LEGEND_STUDIO_APP_EVENT.GENERIC_FAILURE),
|
308
|
+
error,
|
309
|
+
);
|
310
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
findRelationalDatabaseTypeConfiguration(
|
315
|
+
type: string,
|
316
|
+
): RelationalDatabaseTypeConfiguration | undefined {
|
317
|
+
return this.relationalDatabseTypeConfigurations?.find(
|
318
|
+
(aFlow) => aFlow.type === type,
|
319
|
+
);
|
320
|
+
}
|
321
|
+
|
292
322
|
*buildGraph(entities: Entity[]): GeneratorFn<GraphBuilderResult> {
|
293
323
|
try {
|
294
324
|
this.isInitializingGraph = true;
|
@@ -277,7 +277,6 @@ export class EditorStore implements CommandRegistrar {
|
|
277
277
|
this,
|
278
278
|
this.sdlcState,
|
279
279
|
);
|
280
|
-
|
281
280
|
// extensions
|
282
281
|
this.extensionStates = this.pluginManager
|
283
282
|
.getApplicationPlugins()
|
@@ -727,6 +726,7 @@ export class EditorStore implements CommandRegistrar {
|
|
727
726
|
this.graphState.graphGenerationState.globalFileGenerationState.fetchAvailableFileGenerationDescriptions(),
|
728
727
|
this.graphState.graphGenerationState.externalFormatState.fetchExternalFormatDescriptions(),
|
729
728
|
this.graphState.fetchAvailableFunctionActivatorConfigurations(),
|
729
|
+
this.graphState.fetchAvailableRelationalDatabseTypeConfigurations(),
|
730
730
|
this.sdlcState.fetchProjectVersions(),
|
731
731
|
this.sdlcState.fetchPublishedProjectVersions(),
|
732
732
|
]);
|
@@ -768,6 +768,7 @@ export class EditorStore implements CommandRegistrar {
|
|
768
768
|
this.graphState.graphGenerationState.globalFileGenerationState.fetchAvailableFileGenerationDescriptions(),
|
769
769
|
this.graphState.graphGenerationState.externalFormatState.fetchExternalFormatDescriptions(),
|
770
770
|
this.graphState.fetchAvailableFunctionActivatorConfigurations(),
|
771
|
+
this.graphState.fetchAvailableRelationalDatabseTypeConfigurations(),
|
771
772
|
this.sdlcState.fetchProjectVersions(),
|
772
773
|
this.sdlcState.fetchPublishedProjectVersions(),
|
773
774
|
]);
|
package/src/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.ts
CHANGED
@@ -27,7 +27,6 @@ import {
|
|
27
27
|
type PackageableElement,
|
28
28
|
type Connection,
|
29
29
|
type ValidationIssue,
|
30
|
-
type AuthenticationStrategy,
|
31
30
|
type DatasourceSpecification,
|
32
31
|
PackageableConnection,
|
33
32
|
JsonModelConnection,
|
@@ -57,6 +56,7 @@ import {
|
|
57
56
|
isStubbed_PackageableElement,
|
58
57
|
type PostProcessor,
|
59
58
|
MapperPostProcessor,
|
59
|
+
type AuthenticationStrategy,
|
60
60
|
} from '@finos/legend-graph';
|
61
61
|
import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../../../../extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
|
62
62
|
import {
|
@@ -87,15 +87,16 @@ export enum RELATIONAL_DATABASE_TAB_TYPE {
|
|
87
87
|
POST_PROCESSORS = 'Post Processors',
|
88
88
|
}
|
89
89
|
|
90
|
+
// Please do not change these values unless they change in the backend
|
90
91
|
export enum CORE_DATASOURCE_SPEC_TYPE {
|
91
|
-
STATIC = '
|
92
|
-
H2_LOCAL = '
|
93
|
-
H2_EMBEDDED = '
|
94
|
-
DATABRICKS = '
|
95
|
-
SNOWFLAKE = '
|
96
|
-
REDSHIFT = '
|
97
|
-
BIGQUERY = '
|
98
|
-
SPANNER = '
|
92
|
+
STATIC = 'static',
|
93
|
+
H2_LOCAL = 'h2Local',
|
94
|
+
H2_EMBEDDED = 'h2Embedded',
|
95
|
+
DATABRICKS = 'databricks',
|
96
|
+
SNOWFLAKE = 'snowflake',
|
97
|
+
REDSHIFT = 'redshift',
|
98
|
+
BIGQUERY = 'bigQuery',
|
99
|
+
SPANNER = 'spanner',
|
99
100
|
TRINO = 'Trino',
|
100
101
|
}
|
101
102
|
|
@@ -103,17 +104,18 @@ export enum POST_PROCESSOR_TYPE {
|
|
103
104
|
MAPPER = 'Mapper',
|
104
105
|
}
|
105
106
|
|
107
|
+
// Please do not change these values unless they change in the backend
|
106
108
|
export enum CORE_AUTHENTICATION_STRATEGY_TYPE {
|
107
|
-
DELEGATED_KERBEROS = '
|
108
|
-
H2_DEFAULT = '
|
109
|
-
SNOWFLAKE_PUBLIC = '
|
110
|
-
GCP_APPLICATION_DEFAULT_CREDENTIALS = '
|
111
|
-
API_TOKEN = '
|
112
|
-
OAUTH = '
|
113
|
-
USERNAME_PASSWORD = '
|
114
|
-
GCP_WORKLOAD_IDENTITY_FEDERATION = '
|
115
|
-
MIDDLE_TIER_USERNAME_PASSWORD = '
|
116
|
-
TRINO_DELEGATED_KERBEROS = '
|
109
|
+
DELEGATED_KERBEROS = 'delegatedKerberos',
|
110
|
+
H2_DEFAULT = 'h2Default',
|
111
|
+
SNOWFLAKE_PUBLIC = 'snowflakePublic',
|
112
|
+
GCP_APPLICATION_DEFAULT_CREDENTIALS = 'gcpApplicationDefaultCredentials',
|
113
|
+
API_TOKEN = 'apiToken',
|
114
|
+
OAUTH = 'oauth',
|
115
|
+
USERNAME_PASSWORD = 'userNamePassword',
|
116
|
+
GCP_WORKLOAD_IDENTITY_FEDERATION = 'gcpWorkloadIdentityFederation',
|
117
|
+
MIDDLE_TIER_USERNAME_PASSWORD = 'middleTierUserNamePassword',
|
118
|
+
TRINO_DELEGATED_KERBEROS = 'TrinoDelegatedKerberosAuth',
|
117
119
|
}
|
118
120
|
|
119
121
|
export class RelationalDatabaseConnectionValueState extends ConnectionValueState {
|
@@ -121,7 +123,6 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
121
123
|
localMode = false;
|
122
124
|
selectedTab = RELATIONAL_DATABASE_TAB_TYPE.GENERAL;
|
123
125
|
postProcessorState: PostProcessorEditorState | undefined;
|
124
|
-
|
125
126
|
constructor(
|
126
127
|
editorStore: EditorStore,
|
127
128
|
connection: RelationalDatabaseConnection,
|
@@ -131,13 +132,12 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
131
132
|
localMode: observable,
|
132
133
|
selectedTab: observable,
|
133
134
|
postProcessorState: observable,
|
134
|
-
|
135
|
-
|
135
|
+
selectedValidDatasources: computed,
|
136
|
+
connection: observable,
|
136
137
|
setLocalMode: action,
|
137
138
|
setSelectedTab: action,
|
138
139
|
selectPostProcessor: action,
|
139
140
|
});
|
140
|
-
|
141
141
|
this.connection = connection;
|
142
142
|
}
|
143
143
|
|
@@ -188,8 +188,9 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
188
188
|
return `${this.connection.type} connection`;
|
189
189
|
}
|
190
190
|
|
191
|
-
|
192
|
-
|
191
|
+
selectedDatasourceSpecificationType(
|
192
|
+
spec: DatasourceSpecification,
|
193
|
+
): string | undefined {
|
193
194
|
if (spec instanceof StaticDatasourceSpecification) {
|
194
195
|
return CORE_DATASOURCE_SPEC_TYPE.STATIC;
|
195
196
|
} else if (spec instanceof EmbeddedH2DatasourceSpecification) {
|
@@ -227,6 +228,42 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
227
228
|
return undefined;
|
228
229
|
}
|
229
230
|
|
231
|
+
get selectedValidDatasources(): string[] {
|
232
|
+
return (
|
233
|
+
this.editorStore.graphState.findRelationalDatabaseTypeConfiguration(
|
234
|
+
this.connection.type,
|
235
|
+
)?.compatibleDataSources ??
|
236
|
+
(Object.values(CORE_DATASOURCE_SPEC_TYPE) as string[]).concat(
|
237
|
+
this.editorStore.pluginManager
|
238
|
+
.getApplicationPlugins()
|
239
|
+
.flatMap(
|
240
|
+
(plugin) =>
|
241
|
+
(
|
242
|
+
plugin as STO_Relational_LegendStudioApplicationPlugin_Extension
|
243
|
+
).getExtraDatasourceSpecificationTypes?.() ?? [],
|
244
|
+
),
|
245
|
+
)
|
246
|
+
);
|
247
|
+
}
|
248
|
+
|
249
|
+
get selectedValidAuthenticationStrategies(): string[] {
|
250
|
+
return (
|
251
|
+
this.editorStore.graphState.findRelationalDatabaseTypeConfiguration(
|
252
|
+
this.connection.type,
|
253
|
+
)?.compatibleAuthStrategies ??
|
254
|
+
(Object.values(CORE_AUTHENTICATION_STRATEGY_TYPE) as string[]).concat(
|
255
|
+
this.editorStore.pluginManager
|
256
|
+
.getApplicationPlugins()
|
257
|
+
.flatMap(
|
258
|
+
(plugin) =>
|
259
|
+
(
|
260
|
+
plugin as STO_Relational_LegendStudioApplicationPlugin_Extension
|
261
|
+
).getExtraAuthenticationStrategyTypes?.() ?? [],
|
262
|
+
),
|
263
|
+
)
|
264
|
+
);
|
265
|
+
}
|
266
|
+
|
230
267
|
changeDatasourceSpec(type: string): void {
|
231
268
|
const observerContext =
|
232
269
|
this.editorStore.changeDetectionState.observerContext;
|
@@ -314,8 +351,9 @@ export class RelationalDatabaseConnectionValueState extends ConnectionValueState
|
|
314
351
|
);
|
315
352
|
}
|
316
353
|
|
317
|
-
|
318
|
-
|
354
|
+
selectedAuthenticationStrategyType(
|
355
|
+
auth: AuthenticationStrategy,
|
356
|
+
): string | undefined {
|
319
357
|
if (auth instanceof DelegatedKerberosAuthenticationStrategy) {
|
320
358
|
return CORE_AUTHENTICATION_STRATEGY_TYPE.DELEGATED_KERBEROS;
|
321
359
|
} else if (auth instanceof DefaultH2AuthenticationStrategy) {
|