diff --git a/src/Contracts/MessageTypes.ts b/src/Contracts/MessageTypes.ts index 4550d2a53..a5952e098 100644 --- a/src/Contracts/MessageTypes.ts +++ b/src/Contracts/MessageTypes.ts @@ -41,7 +41,6 @@ export enum MessageTypes { OpenPostgreSQLPasswordReset, OpenPostgresNetworkingBlade, OpenCosmosDBNetworkingBlade, - DisplayNPSSurvey, OpenVCoreMongoNetworkingBlade, OpenVCoreMongoConnectionStringsBlade, GetAuthorizationToken, // unused. Can be removed if the portal uses the same list of enums. diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index dea7f7e95..8740ee616 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -35,7 +35,7 @@ import { PhoenixClient } from "../Phoenix/PhoenixClient"; import * as ExplorerSettings from "../Shared/ExplorerSettings"; import { Action, ActionModifiers } from "../Shared/Telemetry/TelemetryConstants"; import * as TelemetryProcessor from "../Shared/Telemetry/TelemetryProcessor"; -import { isAccountNewerThanThresholdInMs, updateUserContext, userContext } from "../UserContext"; +import { updateUserContext, userContext } from "../UserContext"; import { getCollectionName, getUploadName } from "../Utils/APITypeUtils"; import { stringToBlob } from "../Utils/BlobUtils"; import { isCapabilityEnabled } from "../Utils/CapabilityUtils"; @@ -278,37 +278,6 @@ export default class Explorer { } } - public openNPSSurveyDialog(): void { - if (!Platform.Portal || !["Postgres", "SQL", "Mongo"].includes(userContext.apiType)) { - return; - } - - const ONE_DAY_IN_MS = 86400000; - const SEVEN_DAYS_IN_MS = 604800000; - - // Try Cosmos DB subscription - survey shown to 100% of users at day 1 in Data Explorer. - if (userContext.isTryCosmosDBSubscription) { - if (isAccountNewerThanThresholdInMs(userContext.databaseAccount?.systemData?.createdAt || "", ONE_DAY_IN_MS)) { - Logger.logInfo( - `Sending message to Portal to check if NPS Survey can be displayed in Try Cosmos DB ${userContext.apiType}`, - "Explorer/openNPSSurveyDialog", - ); - sendMessage({ type: MessageTypes.DisplayNPSSurvey }); - } - } else { - // Show survey when an existing account is older than 7 days - if ( - !isAccountNewerThanThresholdInMs(userContext.databaseAccount?.systemData?.createdAt || "", SEVEN_DAYS_IN_MS) - ) { - Logger.logInfo( - `Sending message to Portal to check if NPS Survey can be displayed for existing ${userContext.apiType} account older than 7 days`, - "Explorer/openNPSSurveyDialog", - ); - sendMessage({ type: MessageTypes.DisplayNPSSurvey }); - } - } - } - public async openCESCVAFeedbackBlade(): Promise { sendMessage({ type: MessageTypes.OpenCESCVAFeedbackBlade }); Logger.logInfo( diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index fd4cda809..3eacd9577 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -96,7 +96,6 @@ export function useKnockoutExplorer(platform: Platform): Explorer { useEffect(() => { if (explorer) { applyExplorerBindings(explorer); - explorer.openNPSSurveyDialog(); } }, [explorer]);