Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/prod-beta' into prod-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Jul 27, 2021
2 parents 340d598 + 0ea6edc commit 8cdaadf
Show file tree
Hide file tree
Showing 166 changed files with 6,312 additions and 3,615 deletions.
77 changes: 0 additions & 77 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: Pull request
on:
pull_request:
branches: [ master, ci-stable, prod-beta, prod-stable, qa-beta, qa-stable ]
branches: [ main, master, ci-stable, prod-beta, prod-stable, qa-beta, qa-stable, stage-beta, stage-stable ]
env:
BRANCH: ${{ github.base_ref }}

Expand Down
17 changes: 17 additions & 0 deletions .travis/custom_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
set -x

# If current dev branch is master, push to build repo stage-beta
if [[ "${TRAVIS_BRANCH}" = "master" || "${TRAVIS_BRANCH}" = "main" ]]; then
.travis/release.sh "ci-beta"

# Release stage
rm -rf $APP_BUILD_DIR/.git
.travis/release.sh "stage-beta"
fi

# If current dev branch is deployment branch, push to build repo
if [[ "${TRAVIS_BRANCH}" = "ci-stable" || "${TRAVIS_BRANCH}" = "stage-stable" || "${TRAVIS_BRANCH}" = "prod-beta" || "${TRAVIS_BRANCH}" = "prod-stable" ]]; then
.travis/release.sh "${TRAVIS_BRANCH}"
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ yarn update:manifest
[license-badge]: https://img.shields.io/github/license/project-koku/koku-ui.svg?longCache=true&style=for-the-badge
[license]: https://github.com/project-koku/koku-ui/blob/master/LICENSE
[build-badge]: https://img.shields.io/travis/project-koku/koku-ui.svg?style=for-the-badge
[build]: https://travis-ci.org/project-koku/UI
[build]: https://travis-ci.com/project-koku/UI
951 changes: 457 additions & 494 deletions koku-ui-manifest

Large diffs are not rendered by default.

53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
},
"dependencies": {
"@fortawesome/free-solid-svg-icons": "5.15.2",
"@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.2",
"@redhat-cloud-services/rbac-client": "^1.0.97",
"@patternfly/patternfly": "^4.115.2",
"@patternfly/react-charts": "^6.15.3",
"@patternfly/react-core": "^4.135.0",
"@patternfly/react-icons": "^4.11.0",
"@patternfly/react-styles": "^4.11.0",
"@patternfly/react-table": "^4.29.0",
"@patternfly/react-tokens": "^4.12.0",
"@redhat-cloud-services/frontend-components": "^3.3.5",
"@redhat-cloud-services/frontend-components-notifications": "^3.2.2",
"@redhat-cloud-services/frontend-components-utilities": "^3.2.3",
"@redhat-cloud-services/rbac-client": "^1.0.100",
"@types/date-fns": "2.6.0",
"@types/i18next": "13.0.0",
"@types/i18next-xhr-backend": "1.4.2",
Expand Down Expand Up @@ -77,7 +77,7 @@
"xstate": "4.16.2"
},
"devDependencies": {
"@redhat-cloud-services/frontend-components-config-utilities": "^1.1.1",
"@redhat-cloud-services/frontend-components-config-utilities": "^1.4.4",
"@testing-library/react": "11.2.5",
"@types/enzyme": "3.10.8",
"@types/jest": "26.0.20",
Expand All @@ -88,42 +88,43 @@
"@yarnpkg/lockfile": "1.1.0",
"aphrodite": "2.4.0",
"copy-webpack-plugin": "7.0.0",
"css-loader": "5.2.4",
"css-loader": "6.2.0",
"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.1.0",
"eslint": "^7.28.0",
"eslint-plugin-jsdoc": "^35.1.3",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-patternfly-react": "^4.1.5",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.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",
"html-webpack-plugin": "^5.3.1",
"https-proxy-agent": "^5.0.0",
"i18next-locales-sync": "^1.1.0",
"inquirer": "^8.1.0",
"jest": "26.6.3",
"jws": "^4.0.0",
"mini-css-extract-plugin": "^1.3.7",
"nodesi": "^1.15.0",
"nodesi": "^1.16.0",
"null-loader": "4.0.1",
"prettier": "^2.2.1",
"prettier": "2.3.2",
"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.3.0",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2",
"webpack-log": "^3.0.1"
"webpack-log": "^3.0.2"
},
"insights": {
"appname": "cost-management"
}
}
}
79 changes: 79 additions & 0 deletions scripts/rebase-branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/sh

default()
{
PATH=/usr/bin:/usr/sbin:${PATH}
export PATH

SCRIPT=`basename $0`
SCRIPT_DIR=`dirname $0`
SCRIPT_DIR=`cd $SCRIPT_DIR; pwd`

MAIN_BRANCH="master"
CI_STABLE_BRANCH="ci-stable"
STAGE_STABLE_BRANCH="stage-stable"
REACT_INTL_BRANCH="react-intl_changeover"

KOKU_UI_REPO="[email protected]:project-koku/koku-ui.git"

TMP_DIR="/tmp/$SCRIPT.$$"
KOKU_UI_DIR="$TMP_DIR/koku-ui"
}

usage()
{
cat <<- EEOOFF
This script will rebase the selected branch with $MAIN_BRANCH, then push changes to origin.
FYI, there are no ci-beta and stage-beta branches -- we push to https://github.com/RedHatInsights/cost-management-build via Travis builds
Note: The QA environment is no longer supported.
sh [-x] $SCRIPT [-h] -<c|q|s|r>
OPTIONS:
h Display this message
c CI stable
s Stage stable
r React Intl
EEOOFF
}

# main()
{
default

while getopts hcqsr c; do
case $c in
c) BRANCH=$CI_STABLE_BRANCH;;
s) BRANCH=$STAGE_STABLE_BRANCH;;
r) BRANCH=$REACT_INTL_BRANCH;;
h) usage; exit 0;;
\?) usage; exit 1;;
esac
done

if [ -z "$BRANCH" ]; then
usage
exit 1
fi

mkdir $TMP_DIR
cd $TMP_DIR

git clone $KOKU_UI_REPO
cd $KOKU_UI_DIR

git checkout $BRANCH
git rebase $MAIN_BRANCH

if [ "$?" -eq 0 ]; then
git push -u origin $BRANCH
else
echo "Did not push to origin. No changes or check for conflicts"
fi

rm -rf $TMP_DIR
}
4 changes: 2 additions & 2 deletions scripts/start-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ 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'],
choices: ['stage', 'prod', 'ci'],
},
{ type: 'list', name: 'uiEnv', message: 'Which UI environment you want to use?', choices: ['beta', 'stable'] },
{
name: 'insightsProxy',
message: 'Do you want to use the Insights proxy?',
Expand Down
19 changes: 7 additions & 12 deletions scripts/syncLocales.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
const sync = require('i18next-json-sync').default;
const { syncLocales } = require('i18next-locales-sync');
const path = require('path');
const srcDir = path.resolve(__dirname, '../src/locales');

const check = process.argv.includes('--check');
const srcDir = path.resolve(__dirname, '../src');

sync({
check,
files: path.join(srcDir, '**/locales/*.json'),
primary: 'en',
createResources: [],
space: 2,
lineEndings: 'LF',
finalNewline: true
syncLocales({
primaryLanguage: 'en',
secondaryLanguages: ['de', 'ja'],
localesFolder: srcDir,
// overridePluralRules: pluralResolver => pluralResolver.addRule('he', pluralResolver.getRule('en')),
});
4 changes: 2 additions & 2 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export interface PagedLinks {
last: string;
}

export interface PagedResponse<D = any> {
meta: PagedMetaData;
export interface PagedResponse<D = any, M = any> {
meta: M;
links: PagedLinks;
data: D[];
}
Expand Down
3 changes: 1 addition & 2 deletions src/api/costModels.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ export const filterByAll = {
'/api/cost-management/v1/cost-models/?limit=10&offset=0&name=randomName&description=randomDesc&source_type=OCP',
next: null,
previous: null,
last:
'/api/cost-management/v1/cost-models/?limit=10&offset=0&name=randomName&description=randomDesc&source_type=OCP',
last: '/api/cost-management/v1/cost-models/?limit=10&offset=0&name=randomName&description=randomDesc&source_type=OCP',
},
data: [],
};
Expand Down
1 change: 1 addition & 0 deletions src/api/costModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface CostModel {
uuid: string;
name: string;
description: string;
distribution: string;
sources: CostModelProvider[];
source_type: string;
markup: { value: string; unit: string };
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 6 additions & 18 deletions src/api/forecasts/forecast.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PagedMetaData, PagedResponse } from 'api/api';

export interface ForecastValue {
units?: string;
value?: number | string;
Expand All @@ -23,22 +25,7 @@ export interface ForecastData {
values?: ForecastItem[];
}

export interface ForecastMeta {
count: number;
}

export interface ForecastLinks {
first: string;
previous?: string;
next?: string;
last: string;
}

export interface Forecast {
meta: ForecastMeta;
links: ForecastLinks;
data: ForecastData[];
}
export interface Forecast extends PagedResponse<ForecastData, PagedMetaData> {}

// eslint-disable-next-line no-shadow
export const enum ForecastType {
Expand All @@ -50,10 +37,11 @@ export const enum ForecastType {
// eslint-disable-next-line no-shadow
export const enum ForecastPathsType {
aws = 'aws',
awsCloud = 'aws_cloud',
awsOcp = 'aws_ocp',
azure = 'azure',
azureCloud = 'azure_cloud',
azureOcp = 'azure_ocp',
gcp = 'gcp',
gcpOcp = 'gcp_ocp',
ibm = 'gcp', // Todo: update to use ibm backend apis when they become available
ocp = 'ocp',
ocpCloud = 'ocp_cloud',
Expand Down
Loading

0 comments on commit 8cdaadf

Please sign in to comment.