move frontend types back into cost-insights
Signed-off-by: Andrew Thauer <athauer@wealthsimple.com>
This commit is contained in:
@@ -15,13 +15,9 @@
|
||||
*/
|
||||
|
||||
export * from './ChangeStatistic';
|
||||
export * from './ChartData';
|
||||
export * from './Cost';
|
||||
export * from './DateAggregation';
|
||||
export * from './Duration';
|
||||
export * from './Currency';
|
||||
export * from './Entity';
|
||||
export * from './Filters';
|
||||
export * from './Group';
|
||||
export * from './Maybe';
|
||||
export * from './MetricData';
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"@backstage/config": "^1.0.1",
|
||||
"@backstage/core-components": "^0.9.6-next.1",
|
||||
"@backstage/core-plugin-api": "^1.0.3",
|
||||
"@backstage/plugin-cost-insights-common": "^0.0.1",
|
||||
"@backstage/plugin-cost-insights-common": "^0.0.0",
|
||||
"@backstage/theme": "^0.2.16-next.0",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
|
||||
@@ -15,11 +15,8 @@
|
||||
*/
|
||||
|
||||
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
||||
import {
|
||||
ChangeStatistic,
|
||||
Duration,
|
||||
Maybe,
|
||||
} from '@backstage/plugin-cost-insights-common';
|
||||
import { ChangeStatistic, Maybe } from '@backstage/plugin-cost-insights-common';
|
||||
import { Duration } from './Duration';
|
||||
|
||||
/**
|
||||
* Generic alert type with required fields for display. The `element` field will be rendered in
|
||||
|
||||
@@ -14,9 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export enum CurrencyType {
|
||||
USD = 'USD',
|
||||
CarbonOffsetTons = 'CARBON_OFFSET_TONS',
|
||||
Beers = 'BEERS',
|
||||
IceCream = 'PINTS_OF_ICE_CREAM',
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface Currency {
|
||||
kind: string | null;
|
||||
label: string;
|
||||
unit: string;
|
||||
prefix?: string;
|
||||
rate?: number;
|
||||
}
|
||||
|
||||
+5
-9
@@ -14,13 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface Currency {
|
||||
kind: string | null;
|
||||
label: string;
|
||||
unit: string;
|
||||
prefix?: string;
|
||||
rate?: number;
|
||||
export enum CurrencyType {
|
||||
USD = 'USD',
|
||||
CarbonOffsetTons = 'CARBON_OFFSET_TONS',
|
||||
Beers = 'BEERS',
|
||||
IceCream = 'PINTS_OF_ICE_CREAM',
|
||||
}
|
||||
+1
-14
@@ -14,17 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Time periods for cost comparison; slight abuse of ISO 8601 periods. We take P3M to mean
|
||||
* 'last completed quarter', and P30D/P90D to be '[month|quarter] relative to today'. So if
|
||||
* it's September 15, P3M represents costs for Q2 and P30D represents August 16 -
|
||||
* September 15.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export enum Duration {
|
||||
P7D = 'P7D',
|
||||
P30D = 'P30D',
|
||||
P90D = 'P90D',
|
||||
P3M = 'P3M',
|
||||
}
|
||||
export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd';
|
||||
@@ -14,4 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd';
|
||||
/**
|
||||
* Time periods for cost comparison; slight abuse of ISO 8601 periods. We take P3M to mean
|
||||
* 'last completed quarter', and P30D/P90D to be '[month|quarter] relative to today'. So if
|
||||
* it's September 15, P3M represents costs for Q2 and P30D represents August 16 -
|
||||
* September 15.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export enum Duration {
|
||||
P7D = 'P7D',
|
||||
P30D = 'P30D',
|
||||
P90D = 'P90D',
|
||||
P3M = 'P3M',
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Maybe } from './Maybe';
|
||||
import { Maybe } from '@backstage/plugin-cost-insights-common';
|
||||
import { Duration } from './Duration';
|
||||
|
||||
/**
|
||||
@@ -14,15 +14,40 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// @deprecated - use types from `@backstage/plugin-cost-insights-common` instead.
|
||||
export * from '@backstage/plugin-cost-insights-common';
|
||||
import * as common from '@backstage/plugin-cost-insights-common';
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type ChangeStatistic = common.ChangeStatistic;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Cost = common.Cost;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type DateAggregation = common.DateAggregation;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Entity = common.Entity;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Group = common.Group;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Maybe<T> = common.Maybe<T>;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Metric = common.Metric;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type MetricData = common.MetricData;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Product = common.Product;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Project = common.Project;
|
||||
/** * @deprecated use the same type from @backstage/plugin-cost-insights-common instead */
|
||||
export type Trendline = common.Trendline;
|
||||
|
||||
// TODO: Split some of these up into `@backstage/plugin-cost-insights-react` for presentation types
|
||||
// and `@backstage/plugin-cost-insights-common` for data transfer object types.
|
||||
export * from './Alert';
|
||||
export * from './ChangeStatistic';
|
||||
export * from './ChartData';
|
||||
export * from './Currency';
|
||||
export * from './CurrencyType';
|
||||
export * from './DateFormat';
|
||||
export * from './Duration';
|
||||
export * from './Filters';
|
||||
export * from './Icon';
|
||||
export * from './Loading';
|
||||
export * from './Theme';
|
||||
|
||||
Reference in New Issue
Block a user