Skip to content

Commit

Permalink
UI: Display version (feathr-ai#779)
Browse files Browse the repository at this point in the history
* UI: Display version

Signed-off-by: Boli Guan <[email protected]>

* Update the version of the package.json

* Update feathr_overall_release_guide.md

Signed-off-by: Boli Guan <[email protected]>
  • Loading branch information
Fendoe authored Oct 27, 2022
1 parent 2f7e1fd commit 9728e94
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 36 deletions.
1 change: 1 addition & 0 deletions docs/dev_guide/feathr_overall_release_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Before the release is made, the version needs to be updated in following places
- [feathr_config.yaml](https://github.com/feathr-ai/feathr/blob/main/feathr_project/test/test_user_workspace/feathr_config.yaml#L84) - To set the spark runtime location for Azure Synapse and Azure Databricks used by test suite. Please update all .yaml files under this path.
- [azure_resource_provision.json](https://github.com/feathr-ai/feathr/blob/main/docs/how-to-guides/azure_resource_provision.json#L114) - To set the deployment template to pull the latest release image.
- [constants.py](https://github.com/feathr-ai/feathr/blob/main/feathr_project/feathr/constants.py#L31) - To set the default maven artifact version (Only needed when maven version is **NOT** the same as python sdk version)
- [package.json](https://github.com/feathr-ai/feathr/blob/main/ui/package.json#L3) - For Feathr UI version

## Triggering automated release pipelines
Our goal is to automate the release process as much as possible. So far, we have automated the following steps
Expand Down
1 change: 0 additions & 1 deletion ui/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
{
"ts": "never",
"tsx": "never",
"json": "never",
"js": "never",
"jsx": "never"
}
Expand Down
28 changes: 28 additions & 0 deletions ui/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ const path = require("path");
const { loaderByName } = require("@craco/craco");
const CracoLessPlugin = require("craco-less");

const webpack = require("webpack");

const packageJson = require("./package.json");

const resolve = (dir) => path.resolve(__dirname, dir);

const currentTime = new Date();

module.exports = {
babel: {
plugins: [
Expand All @@ -22,6 +28,28 @@ module.exports = {
alias: {
"@": resolve("src"),
},
configure: (webpackConfig, { env, paths }) => {
const index = webpackConfig.plugins.findIndex(
(itme) => itme instanceof webpack.DefinePlugin
);

if (index > -1) {
const definePlugin = webpackConfig.plugins[index];
webpackConfig.plugins.splice(
index,
1,
new webpack.DefinePlugin({
"process.env": {
...definePlugin.definitions["process.env"],
FEATHR_VERSION: JSON.stringify(packageJson.version),
FEATHR_GENERATED_TIME: JSON.stringify(currentTime.toISOString()),
},
})
);
}

return webpackConfig;
},
},
plugins: [
{
Expand Down
8 changes: 6 additions & 2 deletions ui/package-lock.json

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

7 changes: 4 additions & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "feathr-ui",
"version": "0.1.0",
"version": "0.8.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.7.0",
Expand All @@ -21,7 +21,7 @@
"@craco/craco": "^7.0.0-alpha.8",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"@testing-library/user-event": "^13.5.0",
"@types/dagre": "^0.7.47",
"@types/jest": "^27.5.0",
"@types/node": "^16.11.26",
Expand All @@ -42,7 +42,8 @@
"prettier": "2.7.1",
"react-scripts": "5.0.0",
"typescript": "^4.6.3",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"webpack": "^5.72.0"
},
"scripts": {
"start": "craco start",
Expand Down
66 changes: 37 additions & 29 deletions ui/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,56 @@ import RoleManagement from "./pages/management/roleManagement";
import Home from "./pages/home/home";
import Projects from "./pages/project/projects";
import { getMsalConfig } from "./utils/utils";
import Footer from "@/components/footer";

const queryClient = new QueryClient();

const msalClient = getMsalConfig();

const App = () => {
return (
<MsalProvider instance={msalClient}>
<MsalAuthenticationTemplate interactionType={InteractionType.Redirect}>
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<Layout style={{ minHeight: "100vh" }}>
<Layout style={{ minHeight: "100vh", position: "relative" }}>
<SideMenu />
<Layout>
<Header />
<Routes>
<Route index element={<Home />} />
<Route path="/home" element={<Home />} />
<Route path="/projects" element={<Projects />} />
<Route path="/dataSources" element={<DataSources />} />
<Route path="/features" element={<Features />} />
<Route path="/new-feature" element={<NewFeature />} />
<Route
path="/projects/:project/features/:featureId"
element={<FeatureDetails />}
/>
<Route
path="/projects/:project/dataSources/:dataSourceId"
element={<DataSourceDetails />}
/>
<Route
path="/projects/:project/lineage"
element={<LineageGraph />}
/>
<Route path="/jobs" element={<Jobs />} />
<Route path="/monitoring" element={<Monitoring />} />
<Route path="/management" element={<Management />} />
<Route path="/role-management" element={<RoleManagement />} />
<Route
path="/responseErrors/:status/:detail"
element={<ResponseErrors />}
/>
</Routes>
<Layout.Content>
<Routes>
<Route index element={<Home />} />
<Route path="/home" element={<Home />} />
<Route path="/projects" element={<Projects />} />
<Route path="/dataSources" element={<DataSources />} />
<Route path="/features" element={<Features />} />
<Route path="/new-feature" element={<NewFeature />} />
<Route
path="/projects/:project/features/:featureId"
element={<FeatureDetails />}
/>
<Route
path="/projects/:project/dataSources/:dataSourceId"
element={<DataSourceDetails />}
/>
<Route
path="/projects/:project/lineage"
element={<LineageGraph />}
/>
<Route path="/jobs" element={<Jobs />} />
<Route path="/monitoring" element={<Monitoring />} />
<Route path="/management" element={<Management />} />
<Route
path="/role-management"
element={<RoleManagement />}
/>
<Route
path="/responseErrors/:status/:detail"
element={<ResponseErrors />}
/>
</Routes>
</Layout.Content>
<Footer />
</Layout>
</Layout>
</BrowserRouter>
Expand Down
12 changes: 12 additions & 0 deletions ui/src/components/footer/index.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.footer {
position: fixed;
bottom: 0;
left: 200px;
right: 0;
padding: 16px;
text-align: center;
border-top: 1px solid rgba(0, 0, 0, 0.06);
background-color: rgb(240 242 245 / 40%);
backdrop-filter: blur(8px);
z-index: 10;
}
25 changes: 25 additions & 0 deletions ui/src/components/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";

import { Layout, Space } from "antd";
import dayjs from "dayjs";

import styles from "./index.module.less";

const { Footer } = Layout;

const FooterBar = () => {
const generatedTime = dayjs(process.env.FEATHR_GENERATED_TIME)
.utc()
.format("YYYY-MM-DD HH:mm:DD UTC");

return (
<Footer className={styles.footer}>
<Space size={32}>
<span>version {process.env.FEATHR_VERSION}</span>
<span> generated at {generatedTime}</span>
</Space>
</Footer>
);
};

export default FooterBar;
4 changes: 4 additions & 0 deletions ui/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from "react";
import ReactDOM from "react-dom";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import App from "./app";
import "./site.css";

dayjs.extend(utc);

ReactDOM.render(
<React.StrictMode>
<App />
Expand Down
3 changes: 2 additions & 1 deletion ui/src/site.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.page {
margin: 1%;
margin: 16px;
padding-bottom: 100px;
}

.card {
Expand Down

0 comments on commit 9728e94

Please sign in to comment.