Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/prod-beta' into prod-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Feb 15, 2022
2 parents 5af9abc + 984238a commit 7adc0c0
Show file tree
Hide file tree
Showing 28 changed files with 2,704 additions and 3,064 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"react/no-unescaped-entities": ["error", {"forbid": [">", "}"]}],
"spaced-comment": "error",
"use-isnan": "error",
"simple-import-sort/sort": "error"
"simple-import-sort/imports": "error"
},
"overrides": [{
"files": [ "src/locales/messages.ts" ],
Expand Down
975 changes: 472 additions & 503 deletions koku-ui-manifest

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions locales/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -11738,6 +11738,14 @@
}
]
},
"ibm_ocp": {
"value": [
{
"type": 0,
"value": "IBM Cloud filtered by OpenShift - Top 5 Costliest"
}
]
},
"ocp": {
"value": [
{
Expand Down Expand Up @@ -17716,6 +17724,14 @@
}
]
},
"ibm_ocp": {
"value": [
{
"type": 0,
"value": "IBM filtered by OpenShift"
}
]
},
"ocp": {
"value": [
{
Expand Down
4 changes: 2 additions & 2 deletions locales/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
"ErrorStateUnexpectedDesc": "We encountered an unexpected error. Contact your administrator.",
"ErrorStateUnexpectedTitle": "Oops!",
"ExamplesTitle": "Examples",
"ExplorerChartTitle": "{value, select, aws {Amazon Web Services - Top 5 Costliest} aws_ocp {Amazon Web Services filtered by OpenShift - Top 5 Costliest} azure {Microsoft Azure - Top 5 Costliest} azure_ocp {Microsoft Azure filtered by OpenShift - Top 5 Costliest} gcp {Google Cloud Platform - Top 5 Costliest} gcp_ocp {Google Cloud Platform filtered by OpenShift - Top 5 Costliest} ibm {IBM Cloud - Top 5 Costliest} ocp {All OpenShift - Top 5 Costliest} ocp_cloud {All cloud filtered by OpenShift - Top 5 Costliest} other {}}",
"ExplorerChartTitle": "{value, select, aws {Amazon Web Services - Top 5 Costliest} aws_ocp {Amazon Web Services filtered by OpenShift - Top 5 Costliest} azure {Microsoft Azure - Top 5 Costliest} azure_ocp {Microsoft Azure filtered by OpenShift - Top 5 Costliest} gcp {Google Cloud Platform - Top 5 Costliest} gcp_ocp {Google Cloud Platform filtered by OpenShift - Top 5 Costliest} ibm {IBM Cloud - Top 5 Costliest} ibm_ocp {IBM Cloud filtered by OpenShift - Top 5 Costliest} ocp {All OpenShift - Top 5 Costliest} ocp_cloud {All cloud filtered by OpenShift - Top 5 Costliest} other {}}",
"ExplorerDateColumn": "{month, select, 0 {Jan {date}} 1 {Feb {date}} 2 {Mar {date}} 3 {Apr {date}} 4 {May {date}} 5 {Jun {date}} 6 {Jul {date}} 7 {Aug {date}} 8 {Sep {date}} 9 {Oct {date}} 10 {Nov {date}} 11 {Dec {date}} other {}}",
"ExplorerDateRange": "{value, select, current_month_to_date {Month to date} last_ninety_days {Last 90 days} last_sixty_days {Last 60 days} last_thirty_days {Last 30 days} previous_month_to_date {Previous month and month to date} other {}}",
"ExplorerMonthDate": "{month} {date}",
Expand Down Expand Up @@ -387,7 +387,7 @@
"PercentSymbol": "%",
"PercentTotalCost": "{value} {units} ({percent} %)",
"Perspective": "Perspective",
"PerspectiveValues": "{value, select, aws {Amazon Web Services} aws_ocp {Amazon Web Services filtered by OpenShift} azure {Microsoft Azure} azure_ocp {Microsoft Azure filtered by OpenShift} gcp {Google Cloud Platform} gcp_ocp {Google Cloud Platform filtered by OpenShift} ibm {IBM Cloud} ocp {All OpenShift} ocp_cloud {All cloud filtered by OpenShift} other {}}",
"PerspectiveValues": "{value, select, aws {Amazon Web Services} aws_ocp {Amazon Web Services filtered by OpenShift} azure {Microsoft Azure} azure_ocp {Microsoft Azure filtered by OpenShift} gcp {Google Cloud Platform} gcp_ocp {Google Cloud Platform filtered by OpenShift} ibm {IBM Cloud} ibm_ocp {IBM filtered by OpenShift} ocp {All OpenShift} ocp_cloud {All cloud filtered by OpenShift} other {}}",
"PriceList": "Price list",
"PriceListAddRate": "Add rate",
"PriceListDeleteRate": "Delete rate",
Expand Down
142 changes: 70 additions & 72 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,97 +35,95 @@
"verify": "tsc --noEmit"
},
"dependencies": {
"@formatjs/cli": "4.2.12",
"@fortawesome/free-solid-svg-icons": "5.15.2",
"@formatjs/cli": "^4.8.2",
"@fortawesome/free-solid-svg-icons": "^6.0.0",
"@patternfly/patternfly": "^4.171.1",
"@patternfly/react-charts": "^6.45.14",
"@patternfly/react-core": "^4.192.14",
"@patternfly/react-icons": "^4.43.14",
"@patternfly/react-styles": "^4.42.14",
"@patternfly/react-table": "^4.61.14",
"@patternfly/react-tokens": "^4.44.14",
"@redhat-cloud-services/frontend-components": "^3.6.1",
"@redhat-cloud-services/frontend-components": "^3.7.0",
"@redhat-cloud-services/frontend-components-notifications": "^3.2.5",
"@redhat-cloud-services/frontend-components-translations": "^3.2.4",
"@redhat-cloud-services/frontend-components-utilities": "^3.2.8",
"@redhat-cloud-services/rbac-client": "^1.0.104",
"@types/date-fns": "2.6.0",
"@types/qs": "6.9.5",
"@types/react": "17.0.2",
"@types/react-dom": "17.0.1",
"@types/react-redux": "7.1.16",
"@types/react-router-dom": "5.1.7",
"@types/webpack": "5.28.0",
"axios": "0.25.0",
"cross-env": "7.0.3",
"date-fns": "2.17.0",
"hook-into-props": "4.0.1",
"human-date": "1.4.0",
"js-file-download": "0.4.12",
"lodash": "^4.17.20",
"qs": "6.9.6",
"react": "17.0.1",
"react-bootstrap": "1.5.0",
"react-dom": "17.0.1",
"react-intl": "5.20.12",
"react-redux": "7.2.2",
"react-router-dom": "5.2.0",
"redux": "4.0.5",
"redux-thunk": "2.3.0",
"typesafe-actions": "5.1.0",
"@types/qs": "^6.9.6",
"@types/react": "^17.0.35",
"@types/react-dom": "^17.0.9",
"@types/react-redux": "^7.1.20",
"@types/react-router-dom": "^5.3.2",
"@types/webpack": "^5.28.0",
"axios": "^0.26.0",
"cross-env": "^7.0.3",
"date-fns": "^2.28.0",
"hook-into-props": "^4.0.1",
"human-date": "^1.4.0",
"js-file-download": "^0.4.12",
"lodash": "^4.17.21",
"qs": "^6.10.3",
"react": "^17.0.2",
"react-bootstrap": "^2.1.2",
"react-dom": "^17.0.2",
"react-intl": "^5.24.6",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"typesafe-actions": "^5.1.0",
"typescript": "^4.5.5",
"victory-core": "^35.9.0",
"xstate": "4.16.2"
"victory-core": "^36.2.1",
"xstate": "^4.30.0"
},
"devDependencies": {
"@formatjs/cli": "4.2.12",
"@redhat-cloud-services/frontend-components-config-utilities": "^1.5.9",
"@testing-library/react": "11.2.5",
"@types/enzyme": "3.10.8",
"@types/jest": "26.0.20",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.4.1",
"@xstate/test": "0.4.2",
"@yarnpkg/lockfile": "1.1.0",
"aphrodite": "2.4.0",
"commander": "^8.1.0",
"copy-webpack-plugin": "9.0.1",
"css-loader": "6.3.0",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"enzyme-to-json": "3.6.1",
"eslint": "^7.28.0",
"eslint-plugin-formatjs": "^2.17.3",
"eslint-plugin-jsdoc": "^35.1.3",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-patternfly-react": "^4.1.5",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-simple-import-sort": "^5.0.3",
"@redhat-cloud-services/frontend-components-config-utilities": "^1.5.10",
"@testing-library/react": "^12.1.2",
"@types/enzyme": "^3.10.11",
"@types/jest": "^27.4.0",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
"@xstate/test": "^0.5.1",
"@yarnpkg/lockfile": "^1.1.0",
"aphrodite": "^2.4.0",
"commander": "^9.0.0",
"copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.6.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.6.2",
"eslint": "^8.9.0",
"eslint-plugin-formatjs": "^3.0.0",
"eslint-plugin-jsdoc": "^37.9.1",
"eslint-plugin-markdown": "^2.2.1",
"eslint-plugin-patternfly-react": "^4.37.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"git-revision-webpack-plugin": "3.0.6",
"glob": "^7.1.7",
"html-loader": "2.0.0",
"html-replace-webpack-plugin": "2.6.0",
"html-webpack-plugin": "5.3.2",
"git-revision-webpack-plugin": "^5.0.0",
"glob": "^7.2.0",
"html-loader": "^3.1.0",
"html-replace-webpack-plugin": "^2.6.0",
"html-webpack-plugin": "^5.5.0",
"https-proxy-agent": "^5.0.0",
"inquirer": "^8.1.0",
"jest": "27.2.4",
"inquirer": "^8.2.0",
"jest": "^27.5.1",
"jws": "^4.0.0",
"mini-css-extract-plugin": "^1.3.7",
"null-loader": "4.0.1",
"prettier": "2.3.2",
"mini-css-extract-plugin": "^2.5.3",
"null-loader": "^4.0.1",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"sass": "^1.32.7",
"sass-loader": "^11.0.1",
"ts-jest": "26.5.1",
"ts-loader": "8.0.17",
"tsconfig-paths-webpack-plugin": "3.5.1",
"webpack": "^5.57.1",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "4.6.0",
"webpack-log": "3.0.2"
"sass": "^1.49.7",
"sass-loader": "^12.6.0",
"ts-jest": "^27.1.3",
"ts-loader": "^9.2.6",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"webpack": "^5.69.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
},
"insights": {
"appname": "cost-management"
Expand Down
2 changes: 1 addition & 1 deletion src/api/forecasts/gcpOcpForecast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios';
import { Forecast, ForecastType } from './forecast';

export const ForecastTypePaths: Partial<Record<ForecastType, string>> = {
[ForecastType.cost]: 'forecasts/gcp/costs/',
[ForecastType.cost]: 'forecasts/openshift/infrastructures/gcp/costs/',
};

export function runForecast(forecastType: ForecastType, query: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/reports/gcpOcpReports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import { ReportType } from './report';
test('api run reports calls axios get', () => {
const query = 'filter[resolution]=daily';
runReport(ReportType.cost, query);
expect(axios.get).toBeCalledWith(`reports/gcp/costs/?${query}`);
expect(axios.get).toBeCalledWith(`reports/openshift/infrastructures/gcp/costs/?${query}`);
});
10 changes: 5 additions & 5 deletions src/api/reports/gcpOcpReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export interface GcpOcpReport extends Report {
}

export const ReportTypePaths: Partial<Record<ReportType, string>> = {
[ReportType.cost]: 'reports/gcp/costs/',
[ReportType.database]: 'reports/gcp/costs/',
[ReportType.network]: 'reports/gcp/costs/',
[ReportType.storage]: 'reports/gcp/storage/',
[ReportType.instanceType]: 'reports/gcp/instance-types/',
[ReportType.cost]: 'reports/openshift/infrastructures/gcp/costs/',
[ReportType.database]: 'reports/openshift/infrastructures/gcp/costs/',
[ReportType.network]: 'reports/openshift/infrastructures/gcp/costs/',
[ReportType.storage]: 'reports/openshift/infrastructures/gcp/storage/',
[ReportType.instanceType]: 'reports/openshift/infrastructures/gcp/instance-types/',
};

export function runReport(reportType: ReportType, query: string) {
Expand Down
7 changes: 1 addition & 6 deletions src/api/reports/gcpReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,18 @@ export interface GroupByServiceData extends Omit<GcpReportData, 'services'> {
service: string;
}

export interface GroupByGcpProjectData extends Omit<GcpReportData, 'projects'> {
export interface GroupByGcpProjectData extends Omit<GcpReportData, 'gcp_projects'> {
gcp_project: string;
}

export interface GroupByInstanceTypeData extends Omit<GcpReportData, 'instance_types'> {
instance_type: string;
}

export interface GroupByProjectData extends Omit<GcpReportData, 'projects'> {
project: string;
}

export interface GcpReportData extends ReportData {
accounts?: GroupByAccountData[];
gcp_projects?: GroupByGcpProjectData[];
instance_types?: GroupByInstanceTypeData[];
projects?: GroupByProjectData[];
regions?: GroupByRegionData[];
services?: GroupByServiceData[];
}
Expand Down
3 changes: 1 addition & 2 deletions src/api/resources/gcpResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Resource, ResourceType } from './resource';

export const ResourceTypePaths: Partial<Record<ResourceType, string>> = {
[ResourceType.account]: 'resource-types/gcp-accounts/',
[ResourceType.gcpProject]: 'resource-types/gcp-projects/',
[ResourceType.project]: 'resource-types/gcp-projects/',
[ResourceType.gcpProject]: 'resource-types/gcp-gcp-projects/',
[ResourceType.region]: 'resource-types/gcp-regions/',
[ResourceType.service]: 'resource-types/gcp-services/',
};
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const enum ResourcePathsType {
gcp = 'gcp',
gcpOcp = 'gcp_ocp',
ibm = 'ibm',
ibmOcp = 'ibm_ocp',
ocp = 'ocp',
ocpCloud = 'ocp_cloud',
}
2 changes: 2 additions & 0 deletions src/api/resources/resourceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export function isResourceTypeValid(resourcePathsType: ResourcePathsType, resour
resourcePathsType === ResourcePathsType.azure ||
resourcePathsType === ResourcePathsType.azureOcp ||
resourcePathsType === ResourcePathsType.gcp ||
resourcePathsType === ResourcePathsType.gcpOcp ||
resourcePathsType === ResourcePathsType.ibm ||
resourcePathsType === ResourcePathsType.ibmOcp ||
resourcePathsType === ResourcePathsType.ocp ||
resourcePathsType === ResourcePathsType.ocpCloud
) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/tags/gcpOcpTags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import { TagType } from './tag';
test('api run reports calls axios get', () => {
const query = 'filter[resolution]=daily';
runTag(TagType.tag, query);
expect(axios.get).toBeCalledWith(`tags/gcp/?${query}`);
expect(axios.get).toBeCalledWith(`tags/openshift/infrastructures/gcp/?${query}`);
});
2 changes: 1 addition & 1 deletion src/api/tags/gcpOcpTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Tag, TagType } from './tag';
export interface GcpOcpTag extends Tag {}

export const TagTypePaths: Partial<Record<TagType, string>> = {
[TagType.tag]: 'tags/gcp/',
[TagType.tag]: 'tags/openshift/infrastructures/gcp/',
};

export function runTag(tagType: TagType, query: string) {
Expand Down
2 changes: 2 additions & 0 deletions src/locales/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ export default defineMessages({
'gcp {Google Cloud Platform - Top 5 Costliest} ' +
'gcp_ocp {Google Cloud Platform filtered by OpenShift - Top 5 Costliest} ' +
'ibm {IBM Cloud - Top 5 Costliest} ' +
'ibm_ocp {IBM Cloud filtered by OpenShift - Top 5 Costliest} ' +
'ocp {All OpenShift - Top 5 Costliest} ' +
'ocp_cloud {All cloud filtered by OpenShift - Top 5 Costliest} ' +
'other {}}',
Expand Down Expand Up @@ -2729,6 +2730,7 @@ export default defineMessages({
'gcp {Google Cloud Platform} ' +
'gcp_ocp {Google Cloud Platform filtered by OpenShift} ' +
'ibm {IBM Cloud} ' +
'ibm_ocp {IBM filtered by OpenShift} ' +
'ocp {All OpenShift} ' +
'ocp_cloud {All cloud filtered by OpenShift} ' +
'other {}}',
Expand Down
Loading

0 comments on commit 7adc0c0

Please sign in to comment.