Remove Explorer.isEmulator (#256)

This commit is contained in:
Steve Faulkner 2020-10-09 11:18:50 -05:00 committed by GitHub
parent 5191ae3f3a
commit 14cdf19efb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 47 additions and 63 deletions

View File

@ -104,8 +104,7 @@ describe("SettingsComponent", () => {
expect(settingsComponentInstance.shouldShowKeyspaceSharedThroughputMessage()).toEqual(false); expect(settingsComponentInstance.shouldShowKeyspaceSharedThroughputMessage()).toEqual(false);
const newContainer = new Explorer({ const newContainer = new Explorer({
notificationsClient: undefined, notificationsClient: undefined
isEmulator: false
}); });
newContainer.isPreferredApiCassandra = ko.computed(() => true); newContainer.isPreferredApiCassandra = ko.computed(() => true);
@ -148,8 +147,7 @@ describe("SettingsComponent", () => {
expect(settingsComponentInstance.hasConflictResolution()).toEqual(undefined); expect(settingsComponentInstance.hasConflictResolution()).toEqual(undefined);
const newContainer = new Explorer({ const newContainer = new Explorer({
notificationsClient: undefined, notificationsClient: undefined
isEmulator: false
}); });
newContainer.databaseAccount = ko.observable({ newContainer.databaseAccount = ko.observable({
id: undefined, id: undefined,

View File

@ -13,8 +13,7 @@ import ko from "knockout";
describe("ScaleComponent", () => { describe("ScaleComponent", () => {
const nonNationalCloudContainer = new Explorer({ const nonNationalCloudContainer = new Explorer({
notificationsClient: undefined, notificationsClient: undefined
isEmulator: false
}); });
nonNationalCloudContainer.getPlatformType = () => PlatformType.Portal; nonNationalCloudContainer.getPlatformType = () => PlatformType.Portal;
nonNationalCloudContainer.isRunningOnNationalCloud = () => false; nonNationalCloudContainer.isRunningOnNationalCloud = () => false;
@ -89,8 +88,7 @@ describe("ScaleComponent", () => {
it("autoScale enabled", () => { it("autoScale enabled", () => {
const newContainer = new Explorer({ const newContainer = new Explorer({
notificationsClient: undefined, notificationsClient: undefined
isEmulator: false
}); });
newContainer.databaseAccount({ newContainer.databaseAccount({

View File

@ -19,6 +19,7 @@ import {
import { getMaxRUs, getMinRUs, hasDatabaseSharedThroughput } from "../SettingsUtils"; import { getMaxRUs, getMinRUs, hasDatabaseSharedThroughput } from "../SettingsUtils";
import * as AutoPilotUtils from "../../../../Utils/AutoPilotUtils"; import * as AutoPilotUtils from "../../../../Utils/AutoPilotUtils";
import { Text, TextField, Stack, Label, MessageBar, MessageBarType } from "office-ui-fabric-react"; import { Text, TextField, Stack, Label, MessageBar, MessageBarType } from "office-ui-fabric-react";
import { configContext, Platform } from "../../../../ConfigContext";
export interface ScaleComponentProps { export interface ScaleComponentProps {
collection: ViewModels.Collection; collection: ViewModels.Collection;
@ -43,7 +44,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
private isEmulator: boolean; private isEmulator: boolean;
constructor(props: ScaleComponentProps) { constructor(props: ScaleComponentProps) {
super(props); super(props);
this.isEmulator = this.props.container.isEmulator; this.isEmulator = configContext.platform === Platform.Emulator;
} }
public isAutoScaleEnabled = (): boolean => { public isAutoScaleEnabled = (): boolean => {

View File

@ -106,8 +106,7 @@ describe("SubSettingsComponent", () => {
it("partitionKey not visible", () => { it("partitionKey not visible", () => {
const newContainer = new Explorer({ const newContainer = new Explorer({
notificationsClient: undefined, notificationsClient: undefined
isEmulator: false
}); });
newContainer.isPreferredApiCassandra = ko.computed(() => true); newContainer.isPreferredApiCassandra = ko.computed(() => true);

View File

@ -4,8 +4,7 @@ import Explorer from "../../Explorer";
import ko from "knockout"; import ko from "knockout";
export const container = new Explorer({ export const container = new Explorer({
notificationsClient: undefined, notificationsClient: undefined
isEmulator: false
}); });
export const collection = ({ export const collection = ({

View File

@ -982,7 +982,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function], "isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function], "isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function], "isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function], "isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function], "isGalleryPublishEnabled": [Function],
@ -2296,7 +2295,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function], "isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function], "isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function], "isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function], "isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function], "isGalleryPublishEnabled": [Function],
@ -3623,7 +3621,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function], "isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function], "isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function], "isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function], "isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function], "isGalleryPublishEnabled": [Function],
@ -4937,7 +4934,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function], "isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function], "isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function], "isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function], "isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function], "isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function], "isGalleryPublishEnabled": [Function],

View File

@ -100,7 +100,6 @@ enum ShareAccessToggleState {
interface ExplorerOptions { interface ExplorerOptions {
notificationsClient: NotificationsClientBase; notificationsClient: NotificationsClientBase;
isEmulator: boolean;
} }
interface AdHocAccessData { interface AdHocAccessData {
readWriteUrl: string; readWriteUrl: string;
@ -135,7 +134,6 @@ export default class Explorer {
public isFixedCollectionWithSharedThroughputSupported: ko.Computed<boolean>; public isFixedCollectionWithSharedThroughputSupported: ko.Computed<boolean>;
public isEnableMongoCapabilityPresent: ko.Computed<boolean>; public isEnableMongoCapabilityPresent: ko.Computed<boolean>;
public isServerlessEnabled: ko.Computed<boolean>; public isServerlessEnabled: ko.Computed<boolean>;
public isEmulator: boolean;
public isAccountReady: ko.Observable<boolean>; public isAccountReady: ko.Observable<boolean>;
public canSaveQueries: ko.Computed<boolean>; public canSaveQueries: ko.Computed<boolean>;
public features: ko.Observable<any>; public features: ko.Observable<any>;
@ -378,7 +376,6 @@ export default class Explorer {
}); });
this.memoryUsageInfo = ko.observable<DataModels.MemoryUsageInfo>(); this.memoryUsageInfo = ko.observable<DataModels.MemoryUsageInfo>();
this.notificationsClient = options.notificationsClient; this.notificationsClient = options.notificationsClient;
this.isEmulator = options.isEmulator;
this.features = ko.observable(); this.features = ko.observable();
this.serverId = ko.observable<string>(); this.serverId = ko.observable<string>();

View File

@ -194,7 +194,7 @@ export class CommandBarComponentButtonFactory {
buttons.push(fullScreenButton); buttons.push(fullScreenButton);
} }
if (!container.hasOwnProperty("isEmulator") || !container.isEmulator) { if (configContext.platform !== Platform.Emulator) {
const label = "Feedback"; const label = "Feedback";
const feedbackButtonOptions: CommandButtonComponentProps = { const feedbackButtonOptions: CommandButtonComponentProps = {
iconSrc: FeedbackIcon, iconSrc: FeedbackIcon,

View File

@ -40,7 +40,7 @@ describe("Add Collection Pane", () => {
}; };
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true); explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true);
}); });

View File

@ -327,7 +327,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
this.canRequestSupport = ko.pureComputed(() => { this.canRequestSupport = ko.pureComputed(() => {
if ( if (
!this.container.isEmulator && configContext.platform !== Platform.Emulator &&
!this.container.isTryCosmosDBSubscription() && !this.container.isTryCosmosDBSubscription() &&
this.container.getPlatformType() !== PlatformType.Portal this.container.getPlatformType() !== PlatformType.Portal
) { ) {
@ -339,7 +339,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
}); });
this.costsVisible = ko.pureComputed(() => { this.costsVisible = ko.pureComputed(() => {
return !this.container.isEmulator; return configContext.platform !== Platform.Emulator;
}); });
this.maxCollectionsReached = ko.computed<boolean>(() => { this.maxCollectionsReached = ko.computed<boolean>(() => {

View File

@ -41,8 +41,7 @@ describe("Add Database Pane", () => {
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ explorer = new Explorer({
notificationsClient: null, notificationsClient: null
isEmulator: false
}); });
}); });

View File

@ -12,6 +12,7 @@ import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstan
import { ContextualPaneBase } from "./ContextualPaneBase"; import { ContextualPaneBase } from "./ContextualPaneBase";
import { createDatabase } from "../../Common/dataAccess/createDatabase"; import { createDatabase } from "../../Common/dataAccess/createDatabase";
import { PlatformType } from "../../PlatformType"; import { PlatformType } from "../../PlatformType";
import { configContext, Platform } from "../../ConfigContext";
export default class AddDatabasePane extends ContextualPaneBase { export default class AddDatabasePane extends ContextualPaneBase {
public defaultExperience: ko.Computed<string>; public defaultExperience: ko.Computed<string>;
@ -180,7 +181,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
this.canRequestSupport = ko.pureComputed(() => { this.canRequestSupport = ko.pureComputed(() => {
if ( if (
!this.container.isEmulator && configContext.platform !== Platform.Emulator &&
!this.container.isTryCosmosDBSubscription() && !this.container.isTryCosmosDBSubscription() &&
this.container.getPlatformType() !== PlatformType.Portal this.container.getPlatformType() !== PlatformType.Portal
) { ) {
@ -203,7 +204,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
}); });
this.costsVisible = ko.pureComputed(() => { this.costsVisible = ko.pureComputed(() => {
return !this.container.isEmulator; return configContext.platform !== Platform.Emulator;
}); });
this.throughputSpendAckVisible = ko.pureComputed<boolean>(() => { this.throughputSpendAckVisible = ko.pureComputed<boolean>(() => {

View File

@ -12,6 +12,7 @@ import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstan
import { CassandraAPIDataClient } from "../Tables/TableDataClient"; import { CassandraAPIDataClient } from "../Tables/TableDataClient";
import { ContextualPaneBase } from "./ContextualPaneBase"; import { ContextualPaneBase } from "./ContextualPaneBase";
import { HashMap } from "../../Common/HashMap"; import { HashMap } from "../../Common/HashMap";
import { configContext, Platform } from "../../ConfigContext";
export default class CassandraAddCollectionPane extends ContextualPaneBase { export default class CassandraAddCollectionPane extends ContextualPaneBase {
public createTableQuery: ko.Observable<string>; public createTableQuery: ko.Observable<string>;
@ -231,11 +232,11 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase {
}); });
this.costsVisible = ko.pureComputed(() => { this.costsVisible = ko.pureComputed(() => {
return !this.container.isEmulator; return configContext.platform !== Platform.Emulator;
}); });
this.canRequestSupport = ko.pureComputed(() => { this.canRequestSupport = ko.pureComputed(() => {
if (!this.container.isEmulator && !this.container.isTryCosmosDBSubscription()) { if (configContext.platform !== Platform.Emulator && !this.container.isTryCosmosDBSubscription()) {
const offerThroughput: number = this.throughput(); const offerThroughput: number = this.throughput();
return offerThroughput <= 100000; return offerThroughput <= 100000;
} }

View File

@ -17,7 +17,7 @@ describe("Delete Collection Confirmation Pane", () => {
let explorer: Explorer; let explorer: Explorer;
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
}); });
it("should be true if 1 database and 1 collection", () => { it("should be true if 1 database and 1 collection", () => {
@ -56,7 +56,7 @@ describe("Delete Collection Confirmation Pane", () => {
describe("shouldRecordFeedback()", () => { describe("shouldRecordFeedback()", () => {
it("should return true if last collection and database does not have shared throughput else false", () => { it("should return true if last collection and database does not have shared throughput else false", () => {
let fakeExplorer = new Explorer({ notificationsClient: null, isEmulator: false }); let fakeExplorer = new Explorer({ notificationsClient: null });
fakeExplorer.isNotificationConsoleExpanded = ko.observable<boolean>(false); fakeExplorer.isNotificationConsoleExpanded = ko.observable<boolean>(false);
fakeExplorer.refreshAllDatabases = () => Q.resolve(); fakeExplorer.refreshAllDatabases = () => Q.resolve();

View File

@ -22,7 +22,7 @@ describe("Delete Database Confirmation Pane", () => {
}); });
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
}); });
it("should be true if only 1 database", () => { it("should be true if only 1 database", () => {

View File

@ -7,7 +7,7 @@ describe("Settings Pane", () => {
let explorer: Explorer; let explorer: Explorer;
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
}); });
it("should be true for SQL API", () => { it("should be true for SQL API", () => {

View File

@ -20,6 +20,7 @@ import { updateOffer } from "../../Common/dataAccess/updateOffer";
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
import { userContext } from "../../UserContext"; import { userContext } from "../../UserContext";
import { updateOfferThroughputBeyondLimit } from "../../Common/dataAccess/updateOfferThroughputBeyondLimit"; import { updateOfferThroughputBeyondLimit } from "../../Common/dataAccess/updateOfferThroughputBeyondLimit";
import { configContext, Platform } from "../../ConfigContext";
const updateThroughputBeyondLimitWarningMessage: string = ` const updateThroughputBeyondLimitWarningMessage: string = `
You are about to request an increase in throughput beyond the pre-allocated capacity. You are about to request an increase in throughput beyond the pre-allocated capacity.
@ -196,7 +197,7 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
}); });
this.costsVisible = ko.computed(() => { this.costsVisible = ko.computed(() => {
return !this.container.isEmulator; return configContext.platform !== Platform.Emulator;
}); });
this.shouldDisplayPortalUsePrompt = ko.pureComputed<boolean>( this.shouldDisplayPortalUsePrompt = ko.pureComputed<boolean>(
@ -207,7 +208,7 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
); );
this.canRequestSupport = ko.pureComputed(() => { this.canRequestSupport = ko.pureComputed(() => {
if ( if (
!!this.container.isEmulator || configContext.platform === Platform.Emulator ||
this.container.getPlatformType() === PlatformType.Hosted || this.container.getPlatformType() === PlatformType.Hosted ||
this.canThroughputExceedMaximumValue() this.canThroughputExceedMaximumValue()
) { ) {

View File

@ -28,13 +28,11 @@ describe("Documents tab", () => {
describe("showPartitionKey", () => { describe("showPartitionKey", () => {
const explorer = new Explorer({ const explorer = new Explorer({
notificationsClient: null, notificationsClient: null
isEmulator: false
}); });
const mongoExplorer = new Explorer({ const mongoExplorer = new Explorer({
notificationsClient: null, notificationsClient: null
isEmulator: false
}); });
mongoExplorer.defaultExperience(Constants.DefaultAccountExperience.MongoDB); mongoExplorer.defaultExperience(Constants.DefaultAccountExperience.MongoDB);

View File

@ -49,7 +49,7 @@ describe("Query Tab", () => {
let explorer: Explorer; let explorer: Explorer;
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
}); });
it("should be true for accounts using SQL API", () => { it("should be true for accounts using SQL API", () => {
@ -69,7 +69,7 @@ describe("Query Tab", () => {
let explorer: Explorer; let explorer: Explorer;
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
}); });
it("should be visible when using a supported API", () => { it("should be visible when using a supported API", () => {

View File

@ -79,7 +79,7 @@ describe("Settings tab", () => {
}; };
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true); explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true);
}); });
@ -178,7 +178,7 @@ describe("Settings tab", () => {
let explorer: Explorer; let explorer: Explorer;
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true); explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true);
}); });
@ -256,7 +256,7 @@ describe("Settings tab", () => {
let explorer: Explorer; let explorer: Explorer;
beforeEach(() => { beforeEach(() => {
explorer = new Explorer({ notificationsClient: null, isEmulator: false }); explorer = new Explorer({ notificationsClient: null });
explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true); explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true);
}); });
@ -338,8 +338,7 @@ describe("Settings tab", () => {
function getCollection(defaultApi: string, partitionKeyOption: PartitionKeyOption) { function getCollection(defaultApi: string, partitionKeyOption: PartitionKeyOption) {
const explorer = new Explorer({ const explorer = new Explorer({
notificationsClient: null, notificationsClient: null
isEmulator: false
}); });
explorer.defaultExperience(defaultApi); explorer.defaultExperience(defaultApi);
explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true); explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true);
@ -471,8 +470,7 @@ describe("Settings tab", () => {
describe("AutoPilot", () => { describe("AutoPilot", () => {
function getCollection(autoPilotTier: DataModels.AutopilotTier) { function getCollection(autoPilotTier: DataModels.AutopilotTier) {
const explorer = new Explorer({ const explorer = new Explorer({
notificationsClient: null, notificationsClient: null
isEmulator: false
}); });
explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true); explorer.hasAutoPilotV2FeatureFlag = ko.computed<boolean>(() => true);

View File

@ -22,6 +22,7 @@ import { updateCollection } from "../../Common/dataAccess/updateCollection";
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
import { userContext } from "../../UserContext"; import { userContext } from "../../UserContext";
import { updateOfferThroughputBeyondLimit } from "../../Common/dataAccess/updateOfferThroughputBeyondLimit"; import { updateOfferThroughputBeyondLimit } from "../../Common/dataAccess/updateOfferThroughputBeyondLimit";
import { configContext, Platform } from "../../ConfigContext";
const ttlWarning: string = ` const ttlWarning: string = `
The system will automatically delete items based on the TTL value (in seconds) you provide, without needing a delete operation explicitly issued by a client application. The system will automatically delete items based on the TTL value (in seconds) you provide, without needing a delete operation explicitly issued by a client application.
@ -454,7 +455,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
}); });
this.rupmVisible = ko.computed(() => { this.rupmVisible = ko.computed(() => {
if (this.container.isEmulator) { if (configContext.platform === Platform.Emulator) {
return false; return false;
} }
if (this.container.isFeatureEnabled(Constants.Features.enableRupm)) { if (this.container.isFeatureEnabled(Constants.Features.enableRupm)) {
@ -484,7 +485,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
}); });
this.costsVisible = ko.computed(() => { this.costsVisible = ko.computed(() => {
return !this.container.isEmulator; return configContext.platform !== Platform.Emulator;
}); });
this.isTryCosmosDBSubscription = ko.computed<boolean>(() => { this.isTryCosmosDBSubscription = ko.computed<boolean>(() => {
@ -500,7 +501,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
}); });
this.canRequestSupport = ko.pureComputed(() => { this.canRequestSupport = ko.pureComputed(() => {
if (this.container.isEmulator) { if (configContext.platform === Platform.Emulator) {
return false; return false;
} }
@ -711,7 +712,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
} }
const isThroughputGreaterThanMaxRus = this.throughput() > this.maxRUs(); const isThroughputGreaterThanMaxRus = this.throughput() > this.maxRUs();
const isEmulator = this.container.isEmulator; const isEmulator = configContext.platform === Platform.Emulator;
if (isThroughputGreaterThanMaxRus && isEmulator) { if (isThroughputGreaterThanMaxRus && isEmulator) {
return false; return false;
} }
@ -881,7 +882,8 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
this.maxRUs() <= SharedConstants.CollectionCreation.DefaultCollectionRUs1Million && this.maxRUs() <= SharedConstants.CollectionCreation.DefaultCollectionRUs1Million &&
this.throughput() > SharedConstants.CollectionCreation.DefaultCollectionRUs1Million; this.throughput() > SharedConstants.CollectionCreation.DefaultCollectionRUs1Million;
const throughputExceedsMaxValue: boolean = !this.container.isEmulator && this.throughput() > this.maxRUs(); const throughputExceedsMaxValue: boolean =
configContext.platform !== Platform.Emulator && this.throughput() > this.maxRUs();
const ttlOptionDirty: boolean = this.timeToLive.editableIsDirty(); const ttlOptionDirty: boolean = this.timeToLive.editableIsDirty();
const ttlOrIndexingPolicyFieldsDirty: boolean = const ttlOrIndexingPolicyFieldsDirty: boolean =

View File

@ -16,7 +16,7 @@ describe("Tabs manager tests", () => {
let documentsTab: DocumentsTab; let documentsTab: DocumentsTab;
beforeAll(() => { beforeAll(() => {
explorer = new Explorer({ notificationsClient: undefined, isEmulator: false }); explorer = new Explorer({ notificationsClient: undefined });
explorer.databaseAccount = ko.observable<DataModels.DatabaseAccount>({ explorer.databaseAccount = ko.observable<DataModels.DatabaseAccount>({
id: "test", id: "test",
name: "test", name: "test",

View File

@ -7,8 +7,7 @@ import { NotificationsClient } from "./NotificationsClient";
export default class EmulatorExplorerFactory { export default class EmulatorExplorerFactory {
public static createExplorer(): Explorer { public static createExplorer(): Explorer {
const explorer: Explorer = new Explorer({ const explorer: Explorer = new Explorer({
notificationsClient: new NotificationsClient(), notificationsClient: new NotificationsClient()
isEmulator: true
}); });
explorer.databaseAccount({ explorer.databaseAccount({
name: "", name: "",

View File

@ -4,8 +4,7 @@ import { NotificationsClient } from "./NotificationsClient";
export default class HostedExplorerFactory { export default class HostedExplorerFactory {
public createExplorer(): Explorer { public createExplorer(): Explorer {
const explorer = new Explorer({ const explorer = new Explorer({
notificationsClient: new NotificationsClient(), notificationsClient: new NotificationsClient()
isEmulator: false
}); });
return explorer; return explorer;

View File

@ -4,8 +4,7 @@ import { NotificationsClient } from "./NotificationsClient";
export default class PortalExplorerFactory { export default class PortalExplorerFactory {
public createExplorer(): Explorer { public createExplorer(): Explorer {
var explorer = new Explorer({ var explorer = new Explorer({
notificationsClient: new NotificationsClient(), notificationsClient: new NotificationsClient()
isEmulator: false
}); });
return explorer; return explorer;

View File

@ -10,8 +10,7 @@ describe("TabRouteHandler", () => {
beforeAll(() => { beforeAll(() => {
(<any>window).dataExplorer = new Explorer({ (<any>window).dataExplorer = new Explorer({
notificationsClient: null, notificationsClient: null
isEmulator: false
}); // create a mock to avoid null refs }); // create a mock to avoid null refs
}); });