Skip to content

Commit 5343724

Browse files
committed
feat: add device catalog for 9.0.0
fixes: https://jsw.ibm.com/browse/MASMON-802
0 parents  commit 5343724

27 files changed

+19438
-0
lines changed

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
# story book
26+
/storybook-static

.storybook/main.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/preset-create-react-app",
7+
],
8+
framework: {
9+
name: "@storybook/react-webpack5",
10+
options: {},
11+
},
12+
docs: {
13+
autodocs: "tag",
14+
},
15+
staticDirs: ["../public"],
16+
};
17+
export default config;

.storybook/manager.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { addons } from "@storybook/manager-api";
2+
import theme from "./theme";
3+
4+
addons.setConfig({
5+
isFullscreen: true,
6+
showNav: false,
7+
showPanel: false,
8+
panelPosition: "bottom",
9+
enableShortcuts: false,
10+
showToolbar: false,
11+
theme,
12+
selectedPanel: undefined,
13+
initialActive: "canvas",
14+
sidebar: {
15+
showRoots: false,
16+
collapsedRoots: ["other"],
17+
disable: true,
18+
},
19+
docs: { disable: true },
20+
toolbar: {
21+
title: { hidden: true },
22+
zoom: { hidden: true },
23+
eject: { hidden: true },
24+
copy: { hidden: true },
25+
// fullscreen: { hidden: true },
26+
},
27+
});

.storybook/preview.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
layout: 'fullscreen',
6+
actions: { argTypesRegex: "^on[A-Z].*" },
7+
controls: {
8+
matchers: {
9+
color: /(background|color)$/i,
10+
date: /Date$/,
11+
},
12+
},
13+
},
14+
};
15+
16+
export default preview;

.storybook/theme.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { g100 } from "@carbon/themes";
2+
3+
import { create } from "@storybook/theming/create";
4+
5+
const {
6+
field01,
7+
interactive01,
8+
text01,
9+
text04,
10+
ui01,
11+
ui03,
12+
ui04,
13+
uiBackground,
14+
} = g100;
15+
16+
export default create({
17+
base: "light",
18+
19+
colorPrimary: interactive01,
20+
colorSecondary: ui04,
21+
22+
// UI
23+
appBg: ui01,
24+
appContentBg: uiBackground,
25+
appBorderColor: ui04,
26+
appBorderRadius: 0,
27+
28+
// Typography
29+
fontBase: "'IBM Plex Sans', sans-serif",
30+
fontCode: "'IBM Plex Mono', monospace",
31+
32+
// Text colors
33+
textColor: text01,
34+
textInverseColor: text04,
35+
36+
// Toolbar default and active colors
37+
barTextColor: text01,
38+
barSelectedColor: interactive01,
39+
barBg: uiBackground,
40+
41+
// Form colors
42+
inputBg: field01,
43+
inputBorder: ui03,
44+
inputTextColor: text01,
45+
inputBorderRadius: 0,
46+
47+
brandTitle: "Edge data collector",
48+
brandUrl: "",
49+
});

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# EDC - device catalog search
2+
3+
### Note
4+
5+
- Add a new file in the [`/src/devices/`](/src/devices/) folder with the version number. You can generate the export file using [_export_devices_csv.py_](https://github.ibm.com/omnio/omnio_server/blob/master/omnio_db/management/commands/export_devices_csv.py) management command.
6+
7+
### Prerequisites
8+
9+
- [Node.js](https://nodejs.org/en/download/) - the required version is specified in the [`.nvmrc`](/.nvmrc)
10+
- If you're on macOS or using WSL on Windows, we recommend using [`nvm`](https://github.com/nvm-sh/nvm) as your version manager for Node.
11+
- Git
12+
- if you don't have yarn on your MAC Machine then run `brew install yarn`
13+
14+
You'll also need a code editor to make changes. There are many to choose from but we suggest to use [VSCode](https://code.visualstudio.com/).
15+
16+
### Install dependencies
17+
18+
```bash
19+
# install the dependencies
20+
yarn install
21+
```
22+
23+
### Build and start the development server
24+
25+
```bash
26+
# run the server
27+
yarn start
28+
```
29+
30+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
31+
32+
### Adding a dependency
33+
34+
```bash
35+
# To add dependencies to the project
36+
yarn add <packageName>
37+
```
38+
39+
**Do not use `npm install`**.
40+
41+
## Storybook
42+
43+
### Start the storybook
44+
45+
```bash
46+
# run the storybook
47+
yarn storybook
48+
```
49+
50+
Open [http://localhost:6006](http://localhost:6006) with your browser to see the result.
51+
52+
### Build the storybook
53+
54+
```bash
55+
# Build the storybook which generate storybook-static folder
56+
yarn build-storybook
57+
```
58+
59+
### Deploy the storybook to git hub page
60+
61+
- Once we have _storybook-static_ folder we can publish the storybook to github pages by running below script
62+
- This script will push the content of storybook-static folder into the _gh-pages_ branch of the git repo.
63+
- Git repo details need to be added in _homepage_ properties of **package.json** file
64+
65+
```bash
66+
yarn deploy-storybook
67+
```

package.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"name": "edc-device-catalog-search",
3+
"version": "9.0.0",
4+
"private": true,
5+
"homepage": "https://github.ibm.com/omnio/edgeconfig-device-search.git",
6+
"scripts": {
7+
"start": "react-scripts start",
8+
"build": "react-scripts build",
9+
"test": "react-scripts test",
10+
"eject": "react-scripts eject",
11+
"storybook": "storybook dev -p 6006",
12+
"build-storybook": "storybook build",
13+
"deploy-storybook": "gh-pages -d storybook-static"
14+
},
15+
"eslintConfig": {
16+
"extends": [
17+
"react-app",
18+
"react-app/jest",
19+
"plugin:storybook/recommended"
20+
]
21+
},
22+
"browserslist": {
23+
"production": [
24+
">0.2%",
25+
"not dead",
26+
"not op_mini all"
27+
],
28+
"development": [
29+
"last 1 chrome version",
30+
"last 1 firefox version",
31+
"last 1 safari version"
32+
]
33+
},
34+
"devDependencies": {
35+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
36+
"@storybook/blocks": "^7.6.19",
37+
"@storybook/manager-api": "^7.6.19",
38+
"@storybook/preset-create-react-app": "^7.6.19",
39+
"@storybook/react": "^7.6.19",
40+
"@storybook/react-webpack5": "^7.6.19",
41+
"@storybook/testing-library": "^0.2.2",
42+
"@storybook/theming": "^7.6.19",
43+
"babel-plugin-named-exports-order": "^0.0.2",
44+
"eslint-plugin-storybook": "^0.6.15",
45+
"gh-pages": "^6.1.1",
46+
"prop-types": "^15.8.1",
47+
"storybook": "^7.6.19",
48+
"webpack": "^5.91.0"
49+
},
50+
"dependencies": {
51+
"@testing-library/jest-dom": "^6.4.5",
52+
"@testing-library/react": "^14.3.1",
53+
"@testing-library/user-event": "^14.5.2",
54+
"@types/jest": "^29.5.12",
55+
"@types/node": "^20.12.12",
56+
"@types/react": "^18.3.3",
57+
"@types/react-dom": "^18.3.0",
58+
"carbon-addons-iot-react": "^2.154.0-next.25",
59+
"carbon-components": "10.56.0",
60+
"carbon-components-react": "7.56.0",
61+
"d3": "^7.9.0",
62+
"papaparse": "^5.4.1",
63+
"react": "^18.3.1",
64+
"react-dom": "^18.3.1",
65+
"react-scripts": "^5.0.1",
66+
"typescript": "^5.4.5",
67+
"web-vitals": "^3.5.2"
68+
}
69+
}

public/favicon.ico

5.43 KB
Binary file not shown.

public/index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<meta name="theme-color" content="#000000" />
9+
<meta name="description" content="EDC-device-catalog-search" />
10+
<!--
11+
manifest.json provides metadata used when your web app is installed on a
12+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
13+
-->
14+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
15+
<!--
16+
Notice the use of %PUBLIC_URL% in the tags above.
17+
It will be replaced with the URL of the `public` folder during the build.
18+
Only files inside the `public` folder can be referenced from the HTML.
19+
20+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
21+
work correctly both with client-side routing and a non-root public URL.
22+
Learn how to configure a non-root public URL by running `npm run build`.
23+
-->
24+
<title>EDC-device-catalog-search</title>
25+
</head>
26+
27+
<body>
28+
<noscript>You need to enable JavaScript to run this app.</noscript>
29+
<div id="root"></div>
30+
<!--
31+
This HTML file is a template.
32+
If you open it directly in the browser, you will see an empty page.
33+
34+
You can add webfonts, meta tags, or analytics to this file.
35+
The build step will place the bundled scripts into the <body> tag.
36+
37+
To begin the development, run `npm start` or `yarn start`.
38+
To create a production bundle, use `npm run build` or `yarn build`.
39+
-->
40+
</body>
41+
42+
</html>

public/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "EDC-device-catalog-search",
3+
"name": "EDC-device-catalog-search",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

0 commit comments

Comments
 (0)