Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/koku-ui-hccm/fec.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Based on https://github.com/RedHatInsights/frontend-components/blob/master/packages/config/src/bin/dev.webpack.config.ts

const CopyWebpackPlugin = require('copy-webpack-plugin');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const { dependencies, insights } = require('./package.json');
Expand All @@ -14,6 +15,7 @@ const stats = {
colors: true,
modules: false,
};
const gitRevisionPlugin = new GitRevisionPlugin();

// Show what files changed since last compilation
class WatchRunPlugin {
Expand Down Expand Up @@ -85,6 +87,11 @@ module.exports = {
},
],
}),
gitRevisionPlugin,
new webpack.DefinePlugin({
'process.env.COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'process.env.BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
}),
],
resolve: {
modules: [srcDir, path.resolve(__dirname, '../../node_modules')],
Expand Down
1 change: 1 addition & 0 deletions apps/koku-ui-hccm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"@types/react-redux": "^7.1.34",
"@types/react-router-dom": "^5.3.3",
"copy-webpack-plugin": "^13.0.1",
"git-revision-webpack-plugin": "^5.0.0",
"globals": "^16.5.0",
"identity-obj-proxy": "^3.0.0",
"ts-patch": "^3.3.0",
Expand Down
2 changes: 2 additions & 0 deletions apps/koku-ui-hccm/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './app.scss';

import UiVersion from '@koku-ui/ui-lib/components/page/uiVersion';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import NotificationsProvider from '@redhat-cloud-services/frontend-components-notifications/NotificationsProvider';
import { createStore } from '@redhat-cloud-services/frontend-components-notifications/state';
Expand Down Expand Up @@ -37,6 +38,7 @@ const App = () => {
<NotificationsProvider store={store}>
<Routes />
</NotificationsProvider>
<UiVersion appName={pkg.name} />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion apps/koku-ui-hccm/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { userAccess } from 'components/userAccess';
import React, { lazy, Suspense } from 'react';
import { Route, Routes as RouterRoutes } from 'react-router-dom';

const NotFound = lazy(() => import(/* webpackChunkName: "NotFound" */ '@koku-ui/ui-lib/components/NotFound/NotFound'));
const NotFound = lazy(() => import(/* webpackChunkName: "NotFound" */ '@koku-ui/ui-lib/components/page/notFound'));
const AwsBreakdown = lazy(() => import(/* webpackChunkName: "awsBreakdown" */ 'routes/details/awsBreakdown'));
const AwsDetails = lazy(() => import(/* webpackChunkName: "awsDetails" */ 'routes/details/awsDetails'));
const AzureBreakdown = lazy(() => import(/* webpackChunkName: "azureBreakdown" */ 'routes/details/azureBreakdown'));
Expand Down
2 changes: 1 addition & 1 deletion apps/koku-ui-onprem/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotFound from '@koku-ui/ui-lib/components/NotFound/NotFound';
import NotFound from '@koku-ui/ui-lib/components/page/notFound';
import React from 'react';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';

Expand Down
7 changes: 7 additions & 0 deletions apps/koku-ui-ros/fec.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Based on https://github.com/RedHatInsights/frontend-components/blob/master/packages/config/src/bin/dev.webpack.config.ts

const CopyWebpackPlugin = require('copy-webpack-plugin');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const { dependencies, insights } = require('./package.json');
Expand All @@ -14,6 +15,7 @@ const stats = {
colors: true,
modules: false,
};
const gitRevisionPlugin = new GitRevisionPlugin();

// Show what files changed since last compilation
class WatchRunPlugin {
Expand Down Expand Up @@ -89,6 +91,11 @@ module.exports = {
},
],
}),
gitRevisionPlugin,
new webpack.DefinePlugin({
'process.env.COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'process.env.BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
}),
],
resolve: {
modules: [srcDir, path.resolve(__dirname, '../../node_modules')],
Expand Down
1 change: 1 addition & 0 deletions apps/koku-ui-ros/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"@types/react-router-dom": "^5.3.3",
"copy-webpack-plugin": "^13.0.1",
"globals": "^16.5.0",
"git-revision-webpack-plugin": "^5.0.0",
"identity-obj-proxy": "^3.0.0",
"jws": "^4.0.0",
"ts-patch": "^3.3.0",
Expand Down
2 changes: 2 additions & 0 deletions apps/koku-ui-ros/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './app.scss';

import UiVersion from '@koku-ui/ui-lib/components/page/uiVersion';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import NotificationsProvider from '@redhat-cloud-services/frontend-components-notifications/NotificationsProvider';
import { createStore } from '@redhat-cloud-services/frontend-components-notifications/state';
Expand Down Expand Up @@ -37,6 +38,7 @@ const App = () => {
<NotificationsProvider store={store}>
<Routes />
</NotificationsProvider>
<UiVersion appName={pkg.name} />
</div>
);
};
Expand Down
4 changes: 4 additions & 0 deletions apps/koku-ui-ros/src/fed-modules/optimizationsWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable no-console */
import UiVersion from '@koku-ui/ui-lib/components/page/uiVersion';
import IntlProvider from '@redhat-cloud-services/frontend-components-translations/Provider';
import { getLocale } from 'components/i18n';
import React from 'react';
Expand All @@ -7,6 +8,8 @@ import { rosStore } from 'store';

// eslint-disable-next-line no-restricted-imports
import messages from '../../locales/data.json';
// eslint-disable-next-line no-restricted-imports
import pkg from '../../package.json';

export interface OptimizationsWrapperOwnProps {
children?: React.ReactNode;
Expand All @@ -22,6 +25,7 @@ const OptimizationsWrapper: React.FC<OptimizationsWrapperProps> = ({ children }:
<IntlProvider defaultLocale="en" locale={locale} messages={messages[locale]} onError={console.log}>
<Provider store={rosStore as any}>
<div className="costManagementRos">{children}</div>
<UiVersion appName={pkg.name} />
</Provider>
</IntlProvider>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/koku-ui-ros/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { userAccess } from 'components/userAccess';
import React, { lazy, Suspense } from 'react';
import { Route, Routes as RouterRoutes } from 'react-router-dom';

const NotFound = lazy(() => import(/* webpackChunkName: "NotFound" */ '@koku-ui/ui-lib/components/NotFound/NotFound'));
const NotFound = lazy(() => import(/* webpackChunkName: "NotFound" */ '@koku-ui/ui-lib/components/page/notFound'));
const OptimizationsBadgeStaging = lazy(
() => import(/* webpackChunkName: "recommendations" */ 'routes/staging/optimizations/optimizationsBadgeStaging')
);
Expand Down
17 changes: 0 additions & 17 deletions libs/ui-lib/src/components/NotFound/NotFound.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions libs/ui-lib/src/components/page/uiVersion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import UiVersion from './uiVersion';

export default UiVersion;
11 changes: 11 additions & 0 deletions libs/ui-lib/src/components/page/uiVersion/uiVersion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

interface UiVersionProps {
appName?: string;
}

const UiVersion = ({ appName }: UiVersionProps) => {
return <div id={`${appName}:${process.env.BRANCH}:${process.env.COMMITHASH}`} hidden />;
};

export default UiVersion;
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading