Skip to content

Commit 8702e92

Browse files
committed
release 4.5.5
2 parents ddd11bc + 6286d9a commit 8702e92

71 files changed

Lines changed: 3037 additions & 1141 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing to Perun Core
2+
3+
Thank you for your interest in contributing to Perun Core, the front-end module of the [Svarog Business Platform](https://github.com/PerunTech/svarog).
4+
5+
## Prerequisites
6+
7+
- [Node.js](https://nodejs.org/) v18.12.0 or higher
8+
- [npm](https://www.npmjs.com/) v8 or higher
9+
- Java JDK (for the OSGi bundle build via Maven)
10+
11+
## Getting Started
12+
13+
1. Fork the repository and clone your fork:
14+
```bash
15+
git clone https://github.com/<your-username>/perun-core.git
16+
cd perun-core
17+
```
18+
19+
2. Install dependencies:
20+
```bash
21+
npm install
22+
```
23+
24+
3. Start the development server:
25+
```bash
26+
npm run dev
27+
```
28+
29+
## Development Workflow
30+
31+
### Branching
32+
33+
- Base your branch off `dev`.
34+
- Use descriptive branch names, e.g. `feature/session-token-header` or `fix/grid-reload`.
35+
36+
### Making Changes
37+
38+
- Keep changes focused — one feature or fix per pull request.
39+
- Run the linter before committing:
40+
```bash
41+
npm run test
42+
```
43+
- Build the bundle to verify it compiles cleanly:
44+
```bash
45+
npm run build-dev
46+
```
47+
48+
### Commit Messages
49+
50+
Follow the format: `type(scope): short description`
51+
52+
Common types: `feat`, `fix`, `chore`, `refactor`, `docs`, `style`, `test`
53+
54+
Examples:
55+
```
56+
feat(grid): add reload-all-grids action
57+
fix(router): resolve page reload issue
58+
chore(deps): upgrade axios to 1.8.3
59+
```
60+
61+
## Submitting a Pull Request
62+
63+
1. Push your branch to your fork.
64+
2. Open a pull request against the `dev` branch of this repository.
65+
3. Describe what changed and why.
66+
4. Link any related issues.
67+
68+
## Reporting Issues
69+
70+
Open an issue on GitHub and include:
71+
- A clear description of the problem
72+
- Steps to reproduce
73+
- Expected vs. actual behavior
74+
- Browser and Node.js version if relevant
75+
76+
## License
77+
78+
By contributing, you agree that your contributions will be licensed under the [Apache 2.0 License](LICENSE).

.github/workflows/release.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,32 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Set up Java
14-
uses: actions/setup-java@v3
14+
uses: actions/setup-java@v4
1515
with:
1616
java-version: '11'
17-
distribution: 'adopt'
18-
- name: Use Node.js
19-
uses: actions/setup-node@v3
17+
distribution: 'temurin'
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
2020
with:
21-
node-version: '16.x'
22-
- name: Npm install
23-
run: npm install --legacy-peer-deps
24-
- name: Rm the backend.js
21+
node-version: '18.x'
22+
cache: 'npm'
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Clean build output
2526
run: rm -rf backend/www/*.js
26-
- name: Build the new JS
27+
- name: Build frontend
2728
run: npm run build
28-
- name: Switch current dir
29-
run: cd backend
30-
- name: Publish package
29+
- name: Publish to Maven Central
3130
env:
3231
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
3332
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
33+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
34+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}
3435
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
3536
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
3637
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
3738
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
run: mvn -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy -DskipTests
39+
working-directory: backend
40+
run: mvn -Prelease deploy jreleaser:deploy -Djreleaser.config.file=jreleaser.yml -DaltDeploymentRepository=local::file:./target/staging-deploy -DskipTests

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
*.retry
22
.env
3+
.npm
4+
.webpack_cache
35
node_modules
46
extracted-messages
57
npm-debug.log*
@@ -38,4 +40,4 @@ www/perun-core.js
3840
www/perun-core.js.map
3941
www/*.perun-core.js
4042
www/*.perun-core.js.map
41-
www/perun-core.js.LICENSE.txt
43+
www/perun-core.js.LICENSE.txt

.gitlab-ci.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cache:
1010
- package-lock.json
1111
paths:
1212
- .webpack_cache/
13+
- .npm/
1314

1415
before_script:
1516
- pwd
@@ -29,8 +30,7 @@ after_script:
2930
script:
3031
- pwd
3132
- git reset --hard HEAD
32-
- rm -rf node_modules
33-
- npm install
33+
- npm ci --cache .npm --prefer-offline
3434
- npm run test
3535
- npm run build
3636

@@ -46,8 +46,7 @@ after_script:
4646
- pwd
4747
- cd $CI_PROJECT_DIR/
4848
- git reset --hard HEAD
49-
- rm -rf node_modules
50-
- npm install
49+
- npm ci --cache .npm --prefer-offline
5150
- rm -rf www/*.js
5251
- npm run build-dev
5352
- pwd
@@ -61,8 +60,7 @@ after_script:
6160
- pwd
6261
- cd $CI_PROJECT_DIR/
6362
- git reset --hard HEAD
64-
- rm -rf node_modules
65-
- npm install
63+
- npm ci --cache .npm --prefer-offline
6664
- rm -rf www/*.js
6765
- npm run build-dev
6866
- url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
@@ -81,8 +79,7 @@ after_script:
8179
- pwd
8280
- cd $CI_PROJECT_DIR/
8381
- git reset --hard HEAD
84-
- rm -rf node_modules
85-
- npm install
82+
- npm ci --cache .npm --prefer-offline
8683
- rm -rf www/*.js
8784
- npm run build
8885
- url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
@@ -101,8 +98,7 @@ after_script:
10198
- pwd
10299
- cd $CI_PROJECT_DIR/
103100
- git reset --hard HEAD
104-
- rm -rf node_modules
105-
- npm install
101+
- npm ci --cache .npm --prefer-offline
106102
- rm -rf www/*.js
107103
- npm run build
108104
- pwd

CHANGELOG.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
---
6+
7+
## [v4.5.5] - 2026-06-23
8+
9+
### New Features
10+
- **JSON editor**: Replaced the legacy JSON editor/viewer with Monaco editor; extracted JsonEditor utilities; fixed `handleFormat` to populate `editorRef` on mount
11+
- **reCAPTCHA**: Load script conditionally based on the `GOOGLE_CAPTCHA_ENABLED` system parameter
12+
- **Google Analytics**: Load script conditionally based on the `GOOGLE_ANALYTICS_ID` system parameter
13+
- **Tasks**: New tasks component with supporting logic and web services
14+
- **LabelEditor**: Refactored into focused sub-components; enabled in the UI
15+
- **Server unavailability**: Graceful handling on page load with SweetAlert2 fallback; applied to `index.html` template
16+
- **Login CSS**: New login-specific classes replacing generic logon CSS classes
17+
18+
### CodeList Editor
19+
- Fully refactored the CodeList editor
20+
- Auto-search new codelist after save
21+
- Children sorted by `SORT_ORDER` in both the grid and exported tree
22+
- Pre-fill and disable `PARENT_CODE_VALUE` when adding child codes; disable when editing existing codelist entries
23+
- Breadcrumb updated on edit
24+
- Export always includes the full tree from root, regardless of current navigation depth
25+
26+
### Svarog Tables & Fields Admin
27+
- Added `ConfigTables` component for config-type tables; `SvarogTables` now filtered to non-config tables only
28+
- Inline field editor with `GUI_METADATA` badge and editing
29+
- New-table creation flow and fixed table edit form submission
30+
- Switched fields fetch to `WsCore/children`
31+
- Field label displayed in the editor; field export no longer drops server-only values
32+
33+
### Export UX
34+
- Auto-select locale when only one is configured
35+
- Trigger export on locale select
36+
- Export loading state; fixed preview race condition on cancel
37+
- Close modal after export; improved empty-fields hint text
38+
39+
### UI / UX
40+
- `SystemConfLogs`: improved grid config and log preview
41+
- `CACHE_TYPE`: show translated value
42+
- Labels: always show the label (not only when translated); show index as title
43+
44+
### Bug Fixes
45+
- Axios: suppress alert on cancelled requests; handle connection refused errors
46+
- Abort in-flight form fetches; deduplicate `getRowField`; guard export on empty breadcrumb
47+
- `onInputChange`: fix spreading array `formData` into an object (losing array type)
48+
- `isJSON`: drop `strcmp` dependency, check objects directly, handle null
49+
- CodeList: fix stale search grid after root node delete
50+
- Alert when `BUSINESS_OBJECT_TYPE_NAME` parameter is missing
51+
- Export locale auto-select: use `useEffect` for locales arriving after modal opens; validate parsed array before use
52+
53+
### Build & Tooling
54+
- CI: updated Node.js version; switched to `npm ci` with `.npm` cache; webpack filesystem cache with absolute cache path
55+
- Overrode `dompurify` to 3.4.0
56+
- Multiple `npm audit` fixes
57+
58+
### Docs
59+
- Clarified Google Analytics and reCAPTCHA configuration docs
60+
61+
---
62+
63+
## [v4.5.4] - 2026-04-17
64+
65+
### Build & Tooling
66+
- Parallelized Babel transpilation; narrowed `preset-env` targets for smaller bundles
67+
- Modernized and cleaned up Webpack config; added filesystem cache
68+
- Updated `engines` property in `package.json`
69+
- Upgraded `maven-bundle-plugin` to 5.1.9
70+
- Multiple `npm audit` fixes across several commits
71+
72+
### ESLint
73+
- Migrated from ESLint v8 to v9
74+
75+
### Dependencies
76+
- Replaced `xlsx` with `xlsx-js-style`
77+
78+
### Features
79+
- **Session token**: sent as `sessionId` header on every request
80+
- **Reload all grids**: new logic to reload all grids at once
81+
- **Selected rows**: improved tracking when sorting/filtering is applied; reset filters and filtered rows
82+
- **Tables & Fields**: components for managing DB tables and fields, download as JSON, handle add/delete
83+
- **Workflow**: added workflow item params to perun-core
84+
- **Icons**: new icon handling approach; fixed broken imports
85+
- **User management**: new user management web services
86+
- **Router**: fixes for the reload issues
87+
88+
### UI / UX
89+
- New and updated labels across multiple commits
90+
91+
### Docs & Config
92+
- Rewrote README with reorganized dev guide; added prerequisites and index.html template
93+
- Standardized `client.js` comments; extracted GA tracking ID to env variable
94+
- Various clean-ups and minor clarifications
95+
96+
---
97+
98+
## [v4.5.3] - 2026-01-22
99+
100+
### General Updates
101+
- Added an admin console component for managing the `PERUN_MENU` table
102+
- Added an admin console component for managing the `SVAROG_WORKFLOW_AUTOMATON` table
103+
- Added the `@tabler/icons-react` package and a component for displaying the icons
104+
105+
### Improvements
106+
- Added more utility functions to avoid duplicating code across projects/modules
107+
108+
### Clean-up
109+
- Removed unused/deprecated `Module Menu` and `Context Menu` components
110+
111+
---
112+
113+
## [v4.5.2] - 2025-09-19
114+
115+
### General Updates
116+
- Added generic functions to avoid code duplication
117+
- Added language switch functionality to `PerunNavbar`
118+
119+
### Improvements
120+
- Formatting
121+
- Card classes
122+
- Error handling
123+
124+
---
125+
126+
## [v4.5.1] - 2025-07-01
127+
128+
### Misc
129+
- Removed naits check in `Router.js`
130+
131+
---
132+
133+
## [v4.5.0] - 2025-06-30
134+
135+
### General Updates
136+
- Updated outdated dependencies in `package.json` to improve stability and compatibility
137+
138+
### New Features
139+
- **My Profile**: Added a new user profile section for easier account management
140+
- **AlertUserV2**: Introduced an enhanced alert system for improved user notifications
141+
142+
### Improvements
143+
- **User Management**: Reworked to enhance performance and usability
144+
- **PerunNavbar**: Redesigned for improved performance, usability, and a more modern look
145+
146+
### Clean-up
147+
- Removed unused components and deprecated functions to optimize the codebase

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The front-end module of the Svarog framework, containing the core functionalitie
44

55
## Prerequisites
66

7-
- [Node.js](https://nodejs.org/) (v16 or higher)
7+
- [Node.js](https://nodejs.org/) (v18.12.0 or higher)
88
- [npm](https://www.npmjs.com/) (v8 or higher)
99

1010
## Getting Started
@@ -26,17 +26,7 @@ npm install
2626

2727
## Environment Variables
2828

29-
| Variable | Description | Required |
30-
|----------|-------------|----------|
31-
| `GA_TRACKING_ID` | Google Analytics tracking ID | No |
32-
33-
For local development, create a `.env` file in the project root:
34-
35-
```
36-
GA_TRACKING_ID=UA-XXXXXXXXX-X
37-
```
38-
39-
For CI/CD, set the variable in your GitLab CI/CD settings under **Settings > CI/CD > Variables**.
29+
This project has no required build-time environment variables. Google Analytics is configured at runtime via the `GOOGLE_ANALYTICS_ID` system parameter fetched from the server (`WsConf/params/get/sys/GOOGLE_ANALYTICS_ID`). reCAPTCHA is loaded conditionally based on the `GOOGLE_CAPTCHA_ENABLED` system parameter (`WsConf/params/get/sys/GOOGLE_CAPTCHA_ENABLED`); set it to `"true"` to enable it.
4030

4131
## Local Development Guide
4232

@@ -117,6 +107,14 @@ window.server = 'http://<host>:<port>/services'
117107

118108
> **Note:** This is a simplified template. The full boilerplate is available at [`docs/index.html.template`](docs/index.html.template) — copy it into your project's `backend/www` directory and customize as needed.
119109
110+
### Server Unavailability Handling
111+
112+
`index.html` loads `sweetalert2.all.min.js` from the assets server before the inline script runs. If the backend is temporarily unavailable (e.g. during a restart or deploy), the `getServer` script will fail to set `window.server`, and a SweetAlert2 dialog will be shown instead of a blank page.
113+
114+
Make sure `sweetalert2.all.min.js` is present in your assets project at `perun-assets/js/`. The file can be obtained from the [SweetAlert2 releases page](https://github.com/sweetalert2/sweetalert2/releases).
115+
116+
To simulate a server unavailability scenario locally, block the `getServer` request in your browser's DevTools under **Network > Block request URL**, then reload the page.
117+
120118
### Spatial Support
121119

122120
If your project uses spatial features, you must manually add the following parameters to `index.html` (inside a `<script>` tag, before other scripts):

0 commit comments

Comments
 (0)