Skip to content

Dev #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Mar 22, 2025
Merged

Dev #89

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5f5e31c
add admin-pro
xlorne Feb 26, 2025
8387a7c
fix admin-pro
xlorne Feb 26, 2025
a937f02
add form
xlorne Feb 26, 2025
240663e
add form
xlorne Feb 26, 2025
f22056b
add form input
xlorne Feb 26, 2025
15c6ef3
add password
xlorne Feb 26, 2025
ded469c
add radio rate slider stepper switch textarea
xlorne Feb 26, 2025
bc9a540
add Cascader Date
xlorne Feb 26, 2025
dcae221
add Select
xlorne Feb 26, 2025
9864b89
fix form
xlorne Feb 26, 2025
0107527
fix form
xlorne Feb 26, 2025
a83b55e
fix form
xlorne Feb 26, 2025
734b303
fix form
xlorne Feb 26, 2025
2cff132
fix form
xlorne Feb 27, 2025
b4095bd
fix form
xlorne Feb 27, 2025
802f710
fix form
xlorne Feb 27, 2025
030fc04
add flow
xlorne Feb 27, 2025
b2a2998
fix panel
xlorne Feb 27, 2025
07e9bc9
fix flow
xlorne Feb 27, 2025
4f15989
fix flow scss
xlorne Feb 27, 2025
38e7d84
fix FlowContext
xlorne Feb 28, 2025
1872fcf
fix FlowContext
xlorne Feb 28, 2025
06b2233
add getFieldProps
xlorne Feb 28, 2025
a48e824
add code color form
xlorne Feb 28, 2025
b50371a
fix menus
xlorne Feb 28, 2025
245907e
fix form
xlorne Feb 28, 2025
82b8c0e
fix form
xlorne Feb 28, 2025
cd25b9c
fix form
xlorne Feb 28, 2025
815a02f
fix form
xlorne Feb 28, 2025
30fd641
fix flow
xlorne Feb 28, 2025
3a9807d
fix flow
xlorne Feb 28, 2025
407ab11
fix flow
xlorne Feb 28, 2025
3677d81
fix flow
xlorne Feb 28, 2025
c43d296
fix flow
xlorne Feb 28, 2025
7de5c94
fix flow
xlorne Feb 28, 2025
e83083a
fix flow
xlorne Feb 28, 2025
583a9d6
fix flow
xlorne Feb 28, 2025
13a3875
fix props.loadFields
xlorne Mar 11, 2025
ea12d57
support search isNull isNotNull notIn
xlorne Mar 12, 2025
a0a7518
support search isNull isNotNull notIn
xlorne Mar 12, 2025
a9b35cc
support search isNull isNotNull notIn
xlorne Mar 12, 2025
3afa458
update FlowFormOpinion
xlorne Mar 14, 2025
bbd21d8
fix waiting
xlorne Mar 21, 2025
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
Binary file added .DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions admin-pro-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

/.idea

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock

33 changes: 33 additions & 0 deletions admin-pro-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Admin-ui with Antd For Micro Frontends

This is a simple React App with Webpack5 & Typescript.

## Features
1. Support Webpack 5 ModuleFederationPlugin for Micro Frontends
2. Support Dynamic zip component loading
3. Support Dynamic Routing & Dynamic Menu
4. Support Axios for API calls
5. Support Antd & Pro-Components UI Library
6. Support Redux for State Management
7. Support Mock Server for API Mocking
8. Support Monaco Editor for Code Editor
9. Support Access ControlPanel for Menu & Page Components

## Running
```shell
yarn

yarn start
```
## Build
```shell
yarn build
```

## Deploy
```shell
cd scripts
sh package.sh
sh deploy.sh
```

37 changes: 37 additions & 0 deletions admin-pro-ui/__mocks__/axios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// __mocks__/axios.ts
const mockAxios = {
create: jest.fn(() => ({
interceptors: {
request: {
use: jest.fn(),
eject: jest.fn()
},
response: {
use: jest.fn(),
eject: jest.fn()
}
},
get: jest.fn(),
post: jest.fn(),
put: jest.fn(),
delete: jest.fn(),
patch: jest.fn()
})),
interceptors: {
request: {
use: jest.fn(),
eject: jest.fn()
},
response: {
use: jest.fn(),
eject: jest.fn()
}
},
get: jest.fn(),
post: jest.fn(),
put: jest.fn(),
delete: jest.fn(),
patch: jest.fn()
};

export default mockAxios;
1 change: 1 addition & 0 deletions admin-pro-ui/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
9 changes: 9 additions & 0 deletions admin-pro-ui/__mocks__/monaco-editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
editor: {
create: jest.fn(() => ({
dispose: jest.fn(),
getValue: jest.fn(() => ''),
setValue: jest.fn(),
})),
},
};
41 changes: 41 additions & 0 deletions admin-pro-ui/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: true,
}],
'^.+\\.(js|jsx|mjs)$': ['babel-jest', {
presets: [
['@babel/preset-env', {
targets: {
node: 'current',
},
}],
'@babel/preset-react',
'@babel/preset-typescript'
],
}],
},
moduleNameMapper: {
'^monaco-editor$': '<rootDir>/__mocks__/monaco-editor.js',
"@logicflow": "<rootDir>/node_modules/@logicflow/core/dist/index.min.js",
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/__mocks__/fileMock.js',
'^@/(.*)$': '<rootDir>/src/$1'
},
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
testMatch: [
"**/__test__/**/*.[jt]s?(x)",
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: [
'node_modules/(?!(lodash-es|@ant-design|@logicflow|other-esm-modules)/)'
],
};

export default config;
7 changes: 7 additions & 0 deletions admin-pro-ui/mocks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const userMock = require('./user');
const productMock = require('./product');

module.exports = (app, helper) => {
userMock(app);
productMock(app);
};
16 changes: 16 additions & 0 deletions admin-pro-ui/mocks/product.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const Mock = require('mockjs');

module.exports = (app, helper) => {
app.get('/api/products', (req, res) => {

const products = Mock.mock({
'list|100': [{
'id|+1': 1,
'name': '@name',
'price|100-1000': 1,
}]
}).list;

res.json(products);
});
};
28 changes: 28 additions & 0 deletions admin-pro-ui/mocks/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = (app, helper) => {
app.post('/user/login', (req, res) => {
const username = req.body.username;

if(username==='admin'){
res.json({
success:true,
data:{
'username': username,
'token':'test token',
'avatar':'/logo.png',
'authorities': ['ROLE_ADMIN','ROLE_DEVELOPER'],
}
});
return;
}

res.json({
success:true,
data:{
'username': username,
'token':'test token',
'avatar':'/logo.png',
'authorities': ['ROLE_USER'],
}
});
});
};
96 changes: 96 additions & 0 deletions admin-pro-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"name": "admin-pro-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@ag-grid-community/locale": "^33.0.3",
"@ant-design/icons": "^5.4.0",
"@ant-design/pro-components": "^2.8.2",
"@babel/standalone": "^7.25.6",
"@dnd-kit/core": "^6.2.0",
"@dnd-kit/sortable": "^9.0.0",
"@handsontable/react-wrapper": "^15.0.0",
"@logicflow/core": "^2.0.5",
"@logicflow/extension": "^2.0.9",
"@reduxjs/toolkit": "^2.2.7",
"@types/babel__standalone": "^7.1.7",
"@types/node": "^16.18.108",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"ag-grid-react": "^33.0.3",
"antd": "^5.20.6",
"axios": "^1.7.7",
"base64-js": "^1.5.1",
"handsontable": "^15.0.0",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"monaco-editor": "^0.51.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-markdown": "^10.0.0",
"react-redux": "^9.1.2",
"react-router": "^6.26.2",
"react-router-dom": "^6.26.2",
"remark-gfm": "^4.0.1",
"typescript": "^5.6.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "webpack serve --config webpack.config.mock.js --open",
"dev": "webpack serve --config webpack.config.dev.js --open",
"build": "webpack --mode production --config webpack.config.prod.js",
"test": "jest",
"test:watch": "jest --watchAll"
},
"eslintConfig": {
"extends": [
"react-app"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.7",
"@types/lodash-es": "^4.17.12",
"babel-jest": "^29.7.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"express": "^4.21.0",
"html-webpack-plugin": "^5.6.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"mockjs": "^1.1.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"sass": "^1.78.0",
"sass-loader": "^16.0.1",
"style-loader": "^4.0.0",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^6.0.1",
"webpack-mock-server": "^1.0.21"
}
}
Binary file added admin-pro-ui/public/captcha.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin-pro-ui/public/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions admin-pro-ui/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Admin-Pro UI</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added admin-pro-ui/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading