mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-19 21:09:46 +01:00
Renaming Materialized views builder blade text to Global secondary indexes for NoSql API (#1991)
* GSI changes * GSI changes * GSI changes * updating GlobalSecondaryIndexesBuilder.json * Changes * Update cost text keys based on user context API type * Refactor Materialized Views Builder code for improved readability and consistency in API type checks * Update links in Materialized Views Builder for consistency and accuracy * Update Global Secondary Indexes links and descriptions for clarity and accuracy based on API type * Update portal notification message keys based on user context API type for Materialized Views Builder * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Fix capitalization and wording inconsistencies in Materialized Views Builder localization strings * Fix capitalization and wording inconsistencies in localization strings for Materialized Views Builder * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> * Update src/Localization/en/MaterializedViewsBuilder.json Co-authored-by: Justine Cocchi <justine@cocchi.org> --------- Co-authored-by: Justine Cocchi <justine@cocchi.org>
This commit is contained in:
@@ -6,9 +6,9 @@ import { RefreshResult } from "../SelfServeTypes";
|
||||
import MaterializedViewsBuilder from "./MaterializedViewsBuilder";
|
||||
import {
|
||||
FetchPricesResponse,
|
||||
MaterializedViewsBuilderServiceResource,
|
||||
PriceMapAndCurrencyCode,
|
||||
RegionsResponse,
|
||||
MaterializedViewsBuilderServiceResource,
|
||||
UpdateMaterializedViewsBuilderRequestParameters,
|
||||
} from "./MaterializedViewsBuilderTypes";
|
||||
|
||||
@@ -123,11 +123,23 @@ export const refreshMaterializedViewsBuilderProvisioning = async (): Promise<Ref
|
||||
if (response.properties.status === ResourceStatus.Running.toString()) {
|
||||
return { isUpdateInProgress: false, updateInProgressMessageTKey: undefined };
|
||||
} else if (response.properties.status === ResourceStatus.Creating.toString()) {
|
||||
return { isUpdateInProgress: true, updateInProgressMessageTKey: "CreateMessage" };
|
||||
return {
|
||||
isUpdateInProgress: true,
|
||||
updateInProgressMessageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesCreateMessage" : "CreateMessage",
|
||||
};
|
||||
} else if (response.properties.status === ResourceStatus.Deleting.toString()) {
|
||||
return { isUpdateInProgress: true, updateInProgressMessageTKey: "DeleteMessage" };
|
||||
return {
|
||||
isUpdateInProgress: true,
|
||||
updateInProgressMessageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesDeleteMessage" : "DeleteMessage",
|
||||
};
|
||||
} else {
|
||||
return { isUpdateInProgress: true, updateInProgressMessageTKey: "UpdateMessage" };
|
||||
return {
|
||||
isUpdateInProgress: true,
|
||||
updateInProgressMessageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesUpdateMessage" : "UpdateMessage",
|
||||
};
|
||||
}
|
||||
} catch {
|
||||
//TODO differentiate between different failures
|
||||
|
||||
@@ -29,17 +29,20 @@ import {
|
||||
updateMaterializedViewsBuilderResource,
|
||||
} from "./MaterializedViewsBuilder.rp";
|
||||
|
||||
import { userContext } from "../../UserContext";
|
||||
|
||||
const costPerHourDefaultValue: Description = {
|
||||
textTKey: "CostText",
|
||||
textTKey: userContext.apiType === "SQL" ? "GlobalsecondaryindexesCostText" : "CostText",
|
||||
type: DescriptionType.Text,
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing",
|
||||
textTKey: "MaterializedviewsBuilderPricing",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesBuilderPricing" : "MaterializedviewsBuilderPricing",
|
||||
},
|
||||
};
|
||||
|
||||
const metricsStringValue: Description = {
|
||||
textTKey: "MetricsText",
|
||||
textTKey: userContext.apiType === "SQL" ? "GlobalsecondaryindexesMetricsText" : "MetricsText",
|
||||
type: DescriptionType.Text,
|
||||
link: {
|
||||
href: generateBladeLink(BladeType.Metrics),
|
||||
@@ -76,7 +79,8 @@ const onNumberOfInstancesChange = (
|
||||
textTKey: "WarningBannerOnUpdate",
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing",
|
||||
textTKey: "MaterializedviewsBuilderPricing",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesBuilderPricing" : "MaterializedviewsBuilderPricing",
|
||||
},
|
||||
} as Description,
|
||||
hidden: false,
|
||||
@@ -116,7 +120,8 @@ const onEnableMaterializedViewsBuilderChange = (
|
||||
textTKey: "WarningBannerOnUpdate",
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing",
|
||||
textTKey: "MaterializedviewsBuilderPricing",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesBuilderPricing" : "MaterializedviewsBuilderPricing",
|
||||
},
|
||||
} as Description,
|
||||
hidden: false,
|
||||
@@ -129,10 +134,17 @@ const onEnableMaterializedViewsBuilderChange = (
|
||||
} else {
|
||||
currentValues.set("warningBanner", {
|
||||
value: {
|
||||
textTKey: "WarningBannerOnDelete",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesWarningBannerOnDelete" : "WarningBannerOnDelete",
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviews",
|
||||
textTKey: "DeprovisioningDetailsText",
|
||||
href:
|
||||
userContext.apiType === "SQL"
|
||||
? "https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/materialized-views"
|
||||
: "https://learn.microsoft.com/en-us/azure/cosmos-db/cassandra/materialized-views",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL"
|
||||
? "GlobalsecondaryindexesDeprovisioningDetailsText"
|
||||
: "DeprovisioningDetailsText",
|
||||
},
|
||||
} as Description,
|
||||
hidden: false,
|
||||
@@ -182,18 +194,19 @@ const getInstancesMax = async (): Promise<number> => {
|
||||
};
|
||||
|
||||
const NumberOfInstancesDropdownInfo: Info = {
|
||||
messageTKey: "ResizingDecisionText",
|
||||
messageTKey: userContext.apiType === "SQL" ? "GlobalsecondaryindexesResizingDecisionText" : "ResizingDecisionText",
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviewsbuilder-size",
|
||||
textTKey: "ResizingDecisionLink",
|
||||
textTKey: userContext.apiType === "SQL" ? "GlobalsecondaryindexesesizingDecisionLink" : "ResizingDecisionLink",
|
||||
},
|
||||
};
|
||||
|
||||
const ApproximateCostDropDownInfo: Info = {
|
||||
messageTKey: "CostText",
|
||||
messageTKey: userContext.apiType === "SQL" ? "GlobalsecondaryindexesCostText" : "CostText",
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviewsbuilder-pricing",
|
||||
textTKey: "MaterializedviewsBuilderPricing",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesBuilderPricing" : "MaterializedviewsBuilderPricing",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -268,15 +281,20 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
||||
portalNotification: {
|
||||
initialize: {
|
||||
titleTKey: "DeleteInitializeTitle",
|
||||
messageTKey: "DeleteInitializeMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL"
|
||||
? "GlobalsecondaryindexesDeleteInitializeMessage"
|
||||
: "DeleteInitializeMessage",
|
||||
},
|
||||
success: {
|
||||
titleTKey: "DeleteSuccessTitle",
|
||||
messageTKey: "DeleteSuccesseMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesDeleteSuccesseMessage" : "DeleteSuccesseMessage",
|
||||
},
|
||||
failure: {
|
||||
titleTKey: "DeleteFailureTitle",
|
||||
messageTKey: "DeleteFailureMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesDeleteFailureMessage" : "DeleteFailureMessage",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -289,15 +307,20 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
||||
portalNotification: {
|
||||
initialize: {
|
||||
titleTKey: "UpdateInitializeTitle",
|
||||
messageTKey: "UpdateInitializeMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL"
|
||||
? "GlobalsecondaryindexesUpdateInitializeMessage"
|
||||
: "UpdateInitializeMessage",
|
||||
},
|
||||
success: {
|
||||
titleTKey: "UpdateSuccessTitle",
|
||||
messageTKey: "UpdateSuccesseMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesUpdateSuccesseMessage" : "UpdateSuccesseMessage",
|
||||
},
|
||||
failure: {
|
||||
titleTKey: "UpdateFailureTitle",
|
||||
messageTKey: "UpdateFailureMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesUpdateFailureMessage" : "UpdateFailureMessage",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -311,15 +334,20 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
||||
portalNotification: {
|
||||
initialize: {
|
||||
titleTKey: "CreateInitializeTitle",
|
||||
messageTKey: "CreateInitializeMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL"
|
||||
? "GlobalsecondaryindexesCreateInitializeMessage"
|
||||
: "CreateInitializeMessage",
|
||||
},
|
||||
success: {
|
||||
titleTKey: "CreateSuccessTitle",
|
||||
messageTKey: "CreateSuccesseMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesCreateSuccesseMessage" : "CreateSuccesseMessage",
|
||||
},
|
||||
failure: {
|
||||
titleTKey: "CreateFailureTitle",
|
||||
messageTKey: "CreateFailureMessage",
|
||||
messageTKey:
|
||||
userContext.apiType === "SQL" ? "GlobalsecondaryindexesCreateFailureMessage" : "CreateFailureMessage",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -366,11 +394,17 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
||||
|
||||
@Values({
|
||||
description: {
|
||||
textTKey: "MaterializedViewsBuilderDescription",
|
||||
textTKey:
|
||||
userContext.apiType === "SQL"
|
||||
? "GlobalsecondaryindexesBuilderDescription"
|
||||
: "MaterializedViewsBuilderDescription",
|
||||
type: DescriptionType.Text,
|
||||
link: {
|
||||
href: "https://aka.ms/cosmos-db-materializedviews",
|
||||
textTKey: "LearnAboutMaterializedViews",
|
||||
href:
|
||||
userContext.apiType === "SQL"
|
||||
? "https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/materialized-views"
|
||||
: "https://learn.microsoft.com/en-us/azure/cosmos-db/cassandra/materialized-views",
|
||||
textTKey: userContext.apiType === "SQL" ? "LearnAboutGlobalSecondaryIndexes" : "LearnAboutMaterializedViews",
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -378,7 +412,7 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
||||
|
||||
@OnChange(onEnableMaterializedViewsBuilderChange)
|
||||
@Values({
|
||||
labelTKey: "MaterializedViewsBuilder",
|
||||
labelTKey: userContext.apiType === "SQL" ? "GlobalSecondaryIndexesBuilder" : "MaterializedViewsBuilder",
|
||||
trueLabelTKey: "Provisioned",
|
||||
falseLabelTKey: "Deprovisioned",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user