mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-05 18:47:41 +00:00
Users/srnara/mongo index (#229)
* added placeholder * Added check box * Added tolltip width constant * Add telemetry * formatting error * formatting error * support only for mongo v 3.6 accounts * resolved comment
This commit is contained in:
committed by
GitHub
parent
70c7d84bdb
commit
4b0b63b56b
@@ -133,6 +133,7 @@ export default class Explorer {
|
||||
public isPreferredApiGraph: ko.Computed<boolean>;
|
||||
public isPreferredApiTable: ko.Computed<boolean>;
|
||||
public isFixedCollectionWithSharedThroughputSupported: ko.Computed<boolean>;
|
||||
public isEnableMongoCapabilityPresent: ko.Computed<boolean>;
|
||||
public isServerlessEnabled: ko.Computed<boolean>;
|
||||
public isEmulator: boolean;
|
||||
public isAccountReady: ko.Observable<boolean>;
|
||||
@@ -522,22 +523,7 @@ export default class Explorer {
|
||||
return false;
|
||||
}
|
||||
|
||||
const capabilities = this.databaseAccount().properties && this.databaseAccount().properties.capabilities;
|
||||
|
||||
if (!capabilities) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < capabilities.length; i++) {
|
||||
if (typeof capabilities[i] === "object") {
|
||||
if (capabilities[i].name === Constants.CapabilityNames.EnableMongo) {
|
||||
// version 3.6
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return this.isEnableMongoCapabilityPresent();
|
||||
});
|
||||
|
||||
this.isServerlessEnabled = ko.computed(
|
||||
@@ -569,6 +555,21 @@ export default class Explorer {
|
||||
return false;
|
||||
});
|
||||
|
||||
this.isEnableMongoCapabilityPresent = ko.computed(() => {
|
||||
const capabilities = this.databaseAccount && this.databaseAccount()?.properties?.capabilities;
|
||||
if (!capabilities) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < capabilities.length; i++) {
|
||||
if (typeof capabilities[i] === "object" && capabilities[i].name === Constants.CapabilityNames.EnableMongo) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
this.isHostedDataExplorerEnabled = ko.computed<boolean>(
|
||||
() =>
|
||||
this.getPlatformType() === PlatformType.Portal &&
|
||||
|
||||
Reference in New Issue
Block a user