Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/qa-stable' into prod-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Jun 4, 2021
2 parents 0202e6a + 5af73fb commit 340d598
Show file tree
Hide file tree
Showing 63 changed files with 2,309 additions and 1,679 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Javascript builds
node_modules
public
dist
.DS_Store
coverage

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ node_modules/
.env

public/
dist/
.DS_Store
.idea
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ env:
- REPO="git@github.com:RedHatInsights/cost-management-build"
- REPO_DIR="cost-management-build"
- BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- APP_BUILD_DIR="public"
- APP_BUILD_DIR="dist"
862 changes: 201 additions & 661 deletions LICENSE

Large diffs are not rendered by default.

File renamed without changes.
7 changes: 0 additions & 7 deletions config/chrome-render-loader.js

This file was deleted.

55 changes: 0 additions & 55 deletions config/chunk-mapper.js

This file was deleted.

10 changes: 1 addition & 9 deletions config/spandx.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*global module*/
const localhost =
process.env.PLATFORM === 'linux' ? 'localhost' : 'host.docker.internal';
const localhost = process.env.PLATFORM === 'linux' ? 'localhost' : 'host.docker.internal';

module.exports = {
routes: {
Expand All @@ -10,12 +8,6 @@ module.exports = {
'/beta/apps/cost-management': {
host: `http://${localhost}:8002`,
},
'/cost-management': {
host: `http://${localhost}:8002`,
},
'/beta/cost-management': {
host: `http://${localhost}:8002`,
},
// New URLs
'/openshift/cost-management': {
host: `http://${localhost}:8002`,
Expand Down
8 changes: 2 additions & 6 deletions config/spandx.config.local.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* global exports */
const localhost =
process.env.PLATFORM === 'linux' ? 'localhost' : 'host.docker.internal';
const localKokuPort = process.env.LOCAL_API_PORT
? process.env.LOCAL_API_PORT
: '80';
const localhost = process.env.PLATFORM === 'linux' ? 'localhost' : 'host.docker.internal';
const localKokuPort = process.env.LOCAL_API_PORT ? process.env.LOCAL_API_PORT : '80';
const localKoku = 'http://' + process.env.LOCAL_API + ':' + localKokuPort;
exports.routes = {
'/api/cost-management/': {
Expand Down
240 changes: 175 additions & 65 deletions koku-ui-manifest

Large diffs are not rendered by default.

46 changes: 26 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"build": "yarn build:client",
"build:client": "yarn clean && node --max_old_space_size=8192 node_modules/.bin/webpack --mode=production",
"clean": "rimraf public/",
"clean": "rimraf dist/",
"lint": "yarn lint:locales && yarn lint:ts",
"lint:locales": "node scripts/syncLocales --check",
"lint:locales:fix": "node scripts/syncLocales",
Expand All @@ -19,8 +19,9 @@
"i18n:key:check:full": "scripts/utils/i18n_key_tool.py --json-file src/locales/en.json --search-path src --exclude-file scripts/utils/i18n_excludes",
"i18n:key:check:notfound": "scripts/utils/i18n_key_tool.py --Xreport-found --json-file src/locales/en.json --search-path src --exclude-file scripts/utils/i18n_excludes",
"i18n:key:check:duplicates": "scripts/utils/i18n_key_tool.py --find-duplicates --Xreport-found --Xreport-not-found --json-file src/locales/en.json --search-path src --exclude-file scripts/utils/i18n_excludes",
"start": "NODE_OPTIONS=--max-old-space-size=8192 webpack serve -c ./webpack.config.js",
"start:beta": "BETA_ENV=true yarn start",
"i18n:key:check:excludes": "scripts/utils/i18n_key_tool.py --validate-excludes --Xreport-found --Xreport-not-found --json-file src/locales/en.json --search-path src --exclude-file scripts/utils/i18n_excludes",
"start": "node scripts/start-dev-server.js",
"start:dev": "NODE_OPTIONS=--max-old-space-size=8192 webpack serve -c ./webpack.config.js",
"stats": "yarn build:client --profile --json > stats.json",
"test": "jest",
"manifest:update": "node scripts/createManifest",
Expand All @@ -31,17 +32,17 @@
},
"dependencies": {
"@fortawesome/free-solid-svg-icons": "5.15.2",
"@patternfly/patternfly": "4.102.1",
"@patternfly/react-charts": "^6.14.16",
"@patternfly/react-core": "4.115.1",
"@patternfly/react-icons": "4.10.1",
"@patternfly/react-styles": "4.10.1",
"@patternfly/react-table": "4.26.6",
"@patternfly/react-tokens": "4.11.2",
"@redhat-cloud-services/frontend-components": "^3.1.7",
"@patternfly/patternfly": "4.103.6",
"@patternfly/react-charts": "6.14.22",
"@patternfly/react-core": "4.121.0",
"@patternfly/react-icons": "4.10.7",
"@patternfly/react-styles": "4.10.7",
"@patternfly/react-table": "4.27.6",
"@patternfly/react-tokens": "4.11.8",
"@redhat-cloud-services/frontend-components": "^3.1.11",
"@redhat-cloud-services/frontend-components-notifications": "^3.1.0",
"@redhat-cloud-services/frontend-components-utilities": "^3.1.1",
"@redhat-cloud-services/rbac-client": "^1.0.96",
"@redhat-cloud-services/frontend-components-utilities": "^3.1.2",
"@redhat-cloud-services/rbac-client": "^1.0.97",
"@types/date-fns": "2.6.0",
"@types/i18next": "13.0.0",
"@types/i18next-xhr-backend": "1.4.2",
Expand All @@ -65,7 +66,7 @@
"react": "17.0.1",
"react-bootstrap": "1.5.0",
"react-dom": "17.0.1",
"react-i18next": "11.8.7",
"react-i18next": "11.8.15",
"react-redux": "7.2.2",
"react-router-dom": "5.2.0",
"redux": "4.0.5",
Expand All @@ -76,6 +77,7 @@
"xstate": "4.16.2"
},
"devDependencies": {
"@redhat-cloud-services/frontend-components-config-utilities": "^1.1.1",
"@testing-library/react": "11.2.5",
"@types/enzyme": "3.10.8",
"@types/jest": "26.0.20",
Expand All @@ -86,24 +88,28 @@
"@yarnpkg/lockfile": "1.1.0",
"aphrodite": "2.4.0",
"copy-webpack-plugin": "7.0.0",
"css-loader": "5.0.2",
"css-loader": "5.2.4",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"enzyme-to-json": "3.6.1",
"eslint": "^7.20.0",
"eslint-plugin-jsdoc": "^32.0.1",
"eslint-plugin-markdown": "^2.0.0",
"eslint-plugin-markdown": "^2.1.0",
"eslint-plugin-patternfly-react": "^4.1.5",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-simple-import-sort": "^5.0.3",
"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.1.0",
"i18next-json-sync": "^2.3.1",
"inquirer": "^8.1.0",
"jest": "26.6.3",
"jws": "^4.0.0",
"mini-css-extract-plugin": "^1.3.7",
"nodesi": "^1.15.0",
"null-loader": "4.0.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
Expand All @@ -112,12 +118,12 @@
"ts-jest": "26.5.1",
"ts-loader": "8.0.17",
"tsconfig-paths-webpack-plugin": "^3.3.0",
"webpack": "^5.24.3",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^4.0.0-beta.2",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2",
"webpack-log": "^3.0.1"
},
"insights": {
"appname": "cost-management"
}
}
}
52 changes: 52 additions & 0 deletions scripts/start-dev-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* eslint-disable no-console */
const inquirer = require('inquirer');
const { resolve } = require('path');
const { spawn } = require('child_process');

async function setEnv() {
return inquirer
.prompt([
{ type: 'list', name: 'uiEnv', message: 'Which UI environment you want to use?', choices: ['beta', 'stable'] },
{
type: 'list',
name: 'clouddotEnv',
message: 'Which platform environment you want to use',
choices: ['ci', 'qa', 'prod'],
},
{
name: 'insightsProxy',
message: 'Do you want to use the Insights proxy?',
type: 'confirm',
default: false,
},
// {
// name: 'localApi',
// message: 'Do you want to use local api?',
// type: 'confirm',
// default: false,
// },
])
.then(answers => {
const { uiEnv, clouddotEnv, insightsProxy, localApi } = answers;

process.env.BETA_ENV = uiEnv === 'beta' ? 'true' : 'false';
process.env.CLOUDOT_ENV = clouddotEnv;
process.env.USE_PROXY = (!insightsProxy).toString(); // Set 'true' for webpack proxy
// process.env.USE_LOCAL_ROUTES = localApi.toString();
});
}

async function run() {
await setEnv();
const child = spawn('yarn', ['start:dev'], {
stdio: [process.stdout, process.stdout, process.stdout],
cwd: resolve(__dirname, '../'),
});
}

try {
run();
} catch (error) {
console.error(error);
process.exit(1);
}
28 changes: 6 additions & 22 deletions scripts/utils/i18n_excludes
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ breakdown.navigation.azure
breakdown.navigation.gcp
breakdown.navigation.ibm
breakdown.navigation.ocp
breakdown.navigation.ocpunit_tooltips.core-hours
chart.cost_forecast_cone_legend_label_no_data
chart.cost_forecast_cone_legend_label_plural
chart.cost_forecast_legend_label_no_data
Expand All @@ -35,25 +34,15 @@ chart.requests_legend_label_no_data
chart.requests_legend_label_plural
chart.usage_legend_label_no_data
chart.usage_legend_label_plural
chart.usage_legend_label_plural
cost_models.add_rate_form.save_rate_button
cost_models.infra_cost_switch
cost_models.infra_no
cost_models.infra_yes
cost_models.learn_more
cost_models.lowercase.Currency
cost_models.lowercase.Request
cost_models.lowercase.Usage
cost_models.node-month
cost_models.remove_button
cost_models_details.action_view
cost_models_details.add_source_desc
cost_models_details.filter.placeholder
cost_models_details.filter.type_options_aria_label
cost_models_details.filter.type_options_label
cost_models_details.sources_filter_results
cost_models_details.table.actions.clone
cost_models_details.table.actions.delete
cost_models_details.table.actions.view
cost_models_router.no_match
cost_models_wizard.finish_button
cost_models_wizard.inprogress_message
Expand All @@ -70,11 +59,11 @@ cost_models_wizard.source_table.active_filters
cost_models_wizard.source_table.already_assigned
cost_models_wizard.source_table.clear_all_filters
cost_models_wizard.source_table.filter_section_aria_label
cost_models_wizard.source_table.name_label
cost_models_wizard.source_table.results_text
cost_models_wizard.source_table.select_filter_type
cost_models_wizard.source_table.toolbar_results_section
cost_models_wizard.warning_sources
details.more_tags
details.price_list.modal.hours
details.price_list.modal.month
details.price_list.modal.no_match
Expand Down Expand Up @@ -103,9 +92,11 @@ dialog.title
explorer.title.azure
explorer.title.gcp
explorer.title.ocp
explorer.total_cost
export.daily
export.file.daily
export.file.monthly
export.monthly
filter.name
filter_by.account.button_aria_label
filter_by.account.input_aria_label
filter_by.account.placeholder
Expand Down Expand Up @@ -189,20 +180,14 @@ group_by.values.tag
group_by.values.tag_plural
months_abbr
no_match_found_state.title
onboarding.type_label
overview.title_aria_label
source_details.type.AWS
source_details.type.AZURE
source_details.type.OCP
source_details.type.GCP
toolbar.filterby
toolbar.pricelist.options.Currency
toolbar.pricelist.options.Request
toolbar.pricelist.options.Usage
toolbar.sources.category.name
toolbar.sources.lower.description
toolbar.sources.lower.name
toolbar.sources.primary.description
toolbar.sources.primary.name
toolbar.sources.primary.source_type
toolbar.sources.secondary.aws
toolbar.sources.secondary.azure
Expand All @@ -228,4 +213,3 @@ unit_tooltips.gibibyte month
unit_tooltips.hour
unit_tooltips.vm-hours
unit_tooltips.usd

Loading

0 comments on commit 340d598

Please sign in to comment.