mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-07-02 10:05:12 +01:00
Fix default values to work with current fabric clients
This commit is contained in:
parent
26e3de49d0
commit
aff4ac2aa8
@ -139,6 +139,10 @@ async function configureFabric(): Promise<Explorer> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Default values points to MIRRORED. This is for old fabric clients to explitly settings these values
|
||||||
|
data.message.artifactType = data.message.artifactType ?? CosmosDbArtifactType.MIRRORED;
|
||||||
|
data.message.isReadOnly = data.message.isReadOnly ?? true;
|
||||||
|
|
||||||
explorer = createExplorerFabric(data.message);
|
explorer = createExplorerFabric(data.message);
|
||||||
|
|
||||||
if (data.message.artifactType === CosmosDbArtifactType.MIRRORED) {
|
if (data.message.artifactType === CosmosDbArtifactType.MIRRORED) {
|
||||||
@ -432,20 +436,18 @@ const createExplorerFabric = (params: {
|
|||||||
artifactType?: CosmosDbArtifactType;
|
artifactType?: CosmosDbArtifactType;
|
||||||
nativeConnectionInfo?: FabricNativeDatabaseConnectionInfo;
|
nativeConnectionInfo?: FabricNativeDatabaseConnectionInfo;
|
||||||
}): Explorer => {
|
}): Explorer => {
|
||||||
const artifactType = params.artifactType ?? CosmosDbArtifactType.MIRRORED;
|
|
||||||
|
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
fabricContext: {
|
fabricContext: {
|
||||||
connectionId: params.connectionId,
|
connectionId: params.connectionId,
|
||||||
mirroredConnectionInfo: undefined,
|
mirroredConnectionInfo: undefined,
|
||||||
isReadOnly: params.isReadOnly ?? true,
|
isReadOnly: params.isReadOnly,
|
||||||
isVisible: params.isVisible ?? true,
|
isVisible: params.isVisible,
|
||||||
artifactType,
|
artifactType: params.artifactType,
|
||||||
nativeConnectionInfo: params.nativeConnectionInfo,
|
nativeConnectionInfo: params.nativeConnectionInfo,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (artifactType === CosmosDbArtifactType.MIRRORED) {
|
if (params.artifactType === CosmosDbArtifactType.MIRRORED) {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
authType: AuthType.ConnectionString, // TODO: will need its own type and Mirroring could be using AAD
|
authType: AuthType.ConnectionString, // TODO: will need its own type and Mirroring could be using AAD
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
@ -459,7 +461,7 @@ const createExplorerFabric = (params: {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (artifactType === CosmosDbArtifactType.NATIVE) {
|
} else if (params.artifactType === CosmosDbArtifactType.NATIVE) {
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
id: "",
|
id: "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user