Merge pull request #3934 from adamdmharvey/cost-insights-tweaks

cost-insights: Minor wording change in UI and JSDoc additions
This commit is contained in:
Ben Lambert
2021-01-07 16:44:00 +01:00
committed by GitHub
5 changed files with 18 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-cost-insights': patch
---
Minor wording change in UI
@@ -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<Group[]>;
@@ -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<Project[]>;
/**
* 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<Cost>;
/**
* 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<MetricData>;
/**
* 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,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 timeframe.
* @param options Options to use when fetching insights for a particular cloud product and
* interval time frame.
*/
getProductInsights(options: ProductInsightsOptions): Promise<Entity>;
@@ -170,7 +170,7 @@ describe('<ProductInsights />', () => {
}
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(
<ProductInsights
onLoaded={jest.fn()}
@@ -109,7 +109,7 @@ describe('<ProductInsightsCard/>', () => {
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,
@@ -132,7 +132,7 @@ export const ProductInsightsCard = ({
/>
) : (
<Typography>
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.
</Typography>
)}