From 14c76ebade2ceb61f812ca3b524f6dcf41f8be19 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 6 Jan 2021 00:49:41 -0500 Subject: [PATCH 1/7] Remove unused prod dependency --- plugins/cost-insights/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index a38a07a3a0..0cfdf8342a 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -32,7 +32,6 @@ "dependencies": { "@backstage/config": "^0.1.2", "@backstage/core": "^0.4.3", - "@backstage/test-utils": "^0.1.5", "@backstage/theme": "^0.2.2", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", From f9fc4f43ac00e84364ab8d1936441e36d669bb11 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 6 Jan 2021 00:54:08 -0500 Subject: [PATCH 2/7] Update wording --- .../src/components/ProductInsights/ProductInsights.test.tsx | 2 +- .../components/ProductInsightsCard/ProductInsightsCard.test.tsx | 2 +- .../src/components/ProductInsightsCard/ProductInsightsCard.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx index 45d0946f86..3719bc8f6c 100644 --- a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx +++ b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx @@ -170,7 +170,7 @@ describe('', () => { } it('should render each product panel', async () => { - const noComputeEngineCostsRgx = /There are no Compute Engine costs within this timeframe for your team's projects./; + const noComputeEngineCostsRgx = /There are no Compute Engine costs within this time frame for your team's projects./; const { getByText } = await renderInContext( ', () => { aggregation: [0, 0], change: { ratio: 0, amount: 0 }, }; - const subheader = `There are no ${MockComputeEngine.name} costs within this timeframe for your team's projects.`; + const subheader = `There are no ${MockComputeEngine.name} costs within this time frame for your team's projects.`; const rendered = await renderProductInsightsCardInTestApp( entity, MockComputeEngine, diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx index 534ef490c3..1d15b4f427 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx @@ -132,7 +132,7 @@ export const ProductInsightsCard = ({ /> ) : ( - There are no {product.name} costs within this timeframe for your + There are no {product.name} costs within this time frame for your team's projects. )} From c8278bb934d9341f3b9e542b1f8ed651edfeeeb6 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 6 Jan 2021 00:54:16 -0500 Subject: [PATCH 3/7] Update JSDocs and wording --- plugins/cost-insights/src/api/CostInsightsApi.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index 26676be8b7..1f86ea2386 100644 --- a/plugins/cost-insights/src/api/CostInsightsApi.ts +++ b/plugins/cost-insights/src/api/CostInsightsApi.ts @@ -61,6 +61,8 @@ export type CostInsightsApi = { * if a user has multiple groups, they are able to switch between groups to see costs for each. * * This method should be removed once the Backstage identity plugin provides the same concept. + * + * @param userId The login id for the current user */ getUserGroups(userId: string): Promise; @@ -68,11 +70,13 @@ export type CostInsightsApi = { * Get a list of cloud billing entities that belong to this group (projects in GCP, AWS has a * similar concept in billing accounts). These act as filters for the displayed costs, users can * choose whether they see all costs for a group, or those from a particular owned project. + * + * @param group The group id from getUserGroups or query parameters */ getGroupProjects(group: string): Promise; /** - * Get daily cost aggregations for a given group and interval timeframe. + * Get daily cost aggregations for a given group and interval time frame. * * The return type includes an array of daily cost aggregations as well as statistics about the * change in cost over the intervals. Calculating these statistics requires us to bucket costs @@ -90,7 +94,7 @@ export type CostInsightsApi = { /** * Get daily cost aggregations for a given billing entity (project in GCP, AWS has a similar - * concept in billing accounts) and interval timeframe. + * concept in billing accounts) and interval time frame. * * The return type includes an array of daily cost aggregations as well as statistics about the * change in cost over the intervals. Calculating these statistics requires us to bucket costs @@ -107,7 +111,7 @@ export type CostInsightsApi = { getProjectDailyCost(project: string, intervals: string): Promise; /** - * Get aggregations for a particular metric and interval timeframe. Teams + * Get aggregations for a particular metric and interval time frame. Teams * can see metrics important to their business in comparison to the growth * (or reduction) of a project or group's daily costs. * @@ -118,7 +122,7 @@ export type CostInsightsApi = { getDailyMetricData(metric: string, intervals: string): Promise; /** - * Get cost aggregations for a particular cloud product and interval timeframe. This includes + * Get cost aggregations for a particular cloud product and interval time frame. This includes * total cost for the product, as well as a breakdown of particular entities that incurred cost * in this product. The type of entity depends on the product - it may be deployed services, * storage buckets, managed database instances, etc. @@ -129,7 +133,7 @@ export type CostInsightsApi = { * The time period is supplied as a Duration rather than intervals, since this is always expected * to return data for two bucketed time period (e.g. month vs month, or quarter vs quarter). * - * @param options Options to use when fetching insights for a particular cloud product and interval timeframe. + * @param options Options to use when fetching insights for a particular cloud product and interval time frame. */ getProductInsights(options: ProductInsightsOptions): Promise; From 9e9504ce43653c770bb180aa6a5f3e062350ea04 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 6 Jan 2021 00:55:58 -0500 Subject: [PATCH 4/7] Add changeset --- .changeset/spicy-nails-impress.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spicy-nails-impress.md diff --git a/.changeset/spicy-nails-impress.md b/.changeset/spicy-nails-impress.md new file mode 100644 index 0000000000..774c2fe0dd --- /dev/null +++ b/.changeset/spicy-nails-impress.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-cost-insights': patch +--- + +Remove unused dev package dependency for production From 29038bafb607751bfcb093a390cdd800f2faf5b3 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 6 Jan 2021 01:07:12 -0500 Subject: [PATCH 5/7] Fix prettier --- plugins/cost-insights/src/api/CostInsightsApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index 1f86ea2386..b1331656bb 100644 --- a/plugins/cost-insights/src/api/CostInsightsApi.ts +++ b/plugins/cost-insights/src/api/CostInsightsApi.ts @@ -133,7 +133,8 @@ export type CostInsightsApi = { * The time period is supplied as a Duration rather than intervals, since this is always expected * to return data for two bucketed time period (e.g. month vs month, or quarter vs quarter). * - * @param options Options to use when fetching insights for a particular cloud product and interval time frame. + * @param options Options to use when fetching insights for a particular cloud product and + * interval time frame. */ getProductInsights(options: ProductInsightsOptions): Promise; From 19ecba1403524198ad4c5f4547cd17eb3c83432c Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 6 Jan 2021 01:12:55 -0500 Subject: [PATCH 6/7] Fix prettier --- plugins/cost-insights/src/api/CostInsightsApi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index b1331656bb..5e94c4647b 100644 --- a/plugins/cost-insights/src/api/CostInsightsApi.ts +++ b/plugins/cost-insights/src/api/CostInsightsApi.ts @@ -61,7 +61,7 @@ export type CostInsightsApi = { * if a user has multiple groups, they are able to switch between groups to see costs for each. * * This method should be removed once the Backstage identity plugin provides the same concept. - * + * * @param userId The login id for the current user */ getUserGroups(userId: string): Promise; From 8038498047660e93233722a7d386275f7cd84bb3 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 7 Jan 2021 10:28:13 -0500 Subject: [PATCH 7/7] Update changeset --- .changeset/spicy-nails-impress.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/spicy-nails-impress.md b/.changeset/spicy-nails-impress.md index 774c2fe0dd..d06b88b43b 100644 --- a/.changeset/spicy-nails-impress.md +++ b/.changeset/spicy-nails-impress.md @@ -2,4 +2,4 @@ '@backstage/plugin-cost-insights': patch --- -Remove unused dev package dependency for production +Minor wording change in UI