Skip to content

Commit 0236888

Browse files
release version 1.5.0
Features: - added support for RBAC with BaSyx - added settings page to add, edit and delete RBAC rules with mnestix - added a product overview page hidden behind a feature flag - added submodel visualization for 'Technical Data' - added a licence and about dialog - added a button to copy AAS ID and asset ID to clipboard - added support for PCN lifecycle phases - added whitelist to only show relevant submodels Documentation and Administration - added documentation for RBAC - updated mnestix-api version to 1.3.2 - added validation for environment variables - added server side logging for some features Development: - added dependabot, type checking and code quality to pipeline actions - added project summary as markdown to include in copilot prompts - full support of next-intl translations, removed react-intl translations further bug fixes
2 parents 1d66b5c + b0d6d78 commit 0236888

File tree

349 files changed

+19557
-10819
lines changed

Some content is hidden

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

349 files changed

+19557
-10819
lines changed

.env.example

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
AD_SECRET_VALUE: '<<YOUR_SECRET>>'
2-
MNESTIX_BACKEND_API_KEY: '<<YOUR_API_KEY>>'
3-
NEXTAUTH_SECRET: '<<YOUR_SECRET>>'
1+
# This is an example .env for the project.
2+
# Copy this file to .env and fill in the values. This file is not tracked by git.
3+
# This will then be used for docker and next
4+
5+
MNESTIX_BACKEND_API_KEY="<<YOUR_API_KEY>>"
6+
NEXTAUTH_SECRET= "<<YOUR_SECRET>>" # https://next-auth.js.org/configuration/options#nextauth_secret
7+
AD_SECRET_VALUE= "<<YOUR_SECRET>>" # Only needed if you use Azure AD authentication

.env.local

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1-
APPLICATION_ID_URI: 'api://mnestix-test-web-api/'
2-
LOCK_TIMESERIES_PERIOD_FEATURE_FLAG: true
3-
COMPARISON_FEATURE_FLAG: true
4-
AAS_LIST_FEATURE_FLAG: true
5-
TRANSFER_FEATURE_FLAG: false
6-
AAS_REPO_API_URL: 'http://localhost:5064/repo'
7-
SUBMODEL_REPO_API_URL: 'http://localhost:5064/repo'
8-
MNESTIX_BACKEND_API_URL: 'http://localhost:5064'
9-
DISCOVERY_API_URL: 'http://localhost:5064/discovery'
10-
REGISTRY_API_URL: 'http://localhost:8083'
11-
SUBMODEL_REGISTRY_API_URL: 'http://localhost:8084'
12-
THEME_LOGO_MIME_TYPE: 'image/svg+xml'
13-
THEME_PRIMARY_COLOR: '#005962'
14-
THEME_SECONDARY_COLOR: '#147f8a'
15-
THEME_LOGO_URL:
1+
# This file is used to set the default environment variables for the Mnestix.
2+
# We use .env.local to have this setup for next start and next dev and don't interfere with docker-compose
3+
# To set your local envs please use .env.development.local and .env.production.local (maybe hard-link them)
164

17-
AUTHENTICATION_FEATURE_FLAG: false
18-
AD_CLIENT_ID: 'c8fa36e4-a260-40b2-9298-8279bbd872e8'
19-
AD_TENANT_ID: '6c4ccecf-2dd4-4241-b7fc-6e95b32dcfac'
5+
LOCK_TIMESERIES_PERIOD_FEATURE_FLAG="true"
6+
COMPARISON_FEATURE_FLAG= "true"
7+
AAS_LIST_FEATURE_FLAG= "true"
8+
TRANSFER_FEATURE_FLAG= "false"
9+
BASYX_RBAC_ENABLED= "false"
10+
WHITELIST_FEATURE_FLAG= "false"
11+
PRODUCT_VIEW_FEATURE_FLAG= "false"
2012

21-
KEYCLOAK_ENABLED: false
22-
KEYCLOAK_CLIENT_ID: "mnestix-browser-client-demo"
23-
KEYCLOAK_LOCAL_URL: ""
24-
KEYCLOAK_REALM: "BaSyx"
25-
KEYCLOAK_ISSUER: "http://localhost:8080"
26-
NEXTAUTH_URL: http://localhost:3000
13+
AAS_REPO_API_URL= "http://localhost:5064/repo"
14+
SUBMODEL_REPO_API_URL= "http://localhost:5064/repo"
15+
CONCEPT_DESCRIPTION_REPO_API_URL= "http://localhost:5064/repo"
16+
MNESTIX_BACKEND_API_URL= "http://localhost:5064"
17+
DISCOVERY_API_URL= "http://localhost:5064/discovery"
18+
REGISTRY_API_URL= "http://localhost:8083"
19+
SUBMODEL_REGISTRY_API_URL= "http://localhost:8084"
2720

28-
IMPRINT_URL:
29-
DATA_PRIVACY_URL:
21+
AUTHENTICATION_FEATURE_FLAG= "false"
22+
AD_CLIENT_ID= "c8fa36e4-a260-40b2-9298-8279bbd872e8"
23+
AD_TENANT_ID= "6c4ccecf-2dd4-4241-b7fc-6e95b32dcfac"
24+
APPLICATION_ID_URI= "api://mnestix-test-web-api/"
25+
26+
KEYCLOAK_ENABLED= "false"
27+
KEYCLOAK_CLIENT_ID= "mnestix-browser-client-demo"
28+
KEYCLOAK_LOCAL_URL= ""
29+
KEYCLOAK_REALM= "Mnestix"
30+
KEYCLOAK_ISSUER= "http://localhost:8080"
31+
NEXTAUTH_URL= "http://localhost:3000"
32+
BASYX_RBAC_SEC_SM_API_URL= "http://localhost:8089"
33+
34+
IMPRINT_URL= ""
35+
DATA_PRIVACY_URL= ""

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @GailMelanie @hofermo @JonathanXITASO @pawel-baran-se @XAlinaGS @Xmilofranke @NilsXitaso
1+
* @GailMelanie @hofermo @JonathanXITASO @pawel-baran-se @XAlinaGS @NilsXitaso @milofranke @sirchnik-xitaso

.github/copilot-instructions.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Mnestix Project Coding Instructions
2+
3+
## Project Structure
4+
- Frontend is built with Next.js 14+, using the App Router
5+
- Translations are in src/locale/[lang].json files
6+
- We are using next-intl for internationalization
7+
- Components are in src/components
8+
- Page components are in src/app/[locale]/...
9+
10+
## Code Style
11+
- We use TypeScript for all new code
12+
- We prefer functional components with hooks over class components
13+
- We use absolute imports instead of relative imports
14+
- We prefer normal functions over arrow functions for better readability
15+
- We use Material-UI (MUI) for our UI components
16+
- We use single quotes
17+
- Follow eslint.config.js guidelines
18+
19+
## State Management
20+
- We use React Context for global state where needed
21+
- We prefer local component state when possible
22+
23+
## API Integration
24+
- RESTful API communication is handled via fetch
25+
- Backend API integrations should include proper error handling
26+
- All frontend-backend communication is wrapped in `apiResponseWrapper.ts` to ensure correct typing
27+
- Primary call from frontend to backend should be a stateless async function in `Actions.ts` files in `src/lib/services` directory, marked with `use server;`
28+
29+
## Documentation
30+
- Add JSDoc comments for exported functions and components
31+
- Include detailed PR descriptions with test coverage information
32+
- Documentation can be added in docs/ and wiki/
33+
34+
## Testing
35+
We use three different testing principles in our project.
36+
### Unit tests
37+
- They are testing small parts of our logic, like single functions in the backend.
38+
- They are written with the jest testing framework
39+
- All communication to external services should be mocked using the nullability testing paradigm. That means services which perform logic operations should not be performing network calls themselves, but need to be injected the correct interface abstractions, which can be mocked by implementing a in-memory version. We use `create()` and `createNull()` as constructors to differentiate the mocked variation.
40+
- They should be placed in the same directory as the functionality itself and should follow the pattern [filename].test.tsx
41+
- They should be added or edited on bug fixes, logic related features and refactorings.
42+
### Component tests
43+
- They are testing the UI and basic functionality of single react components.
44+
- They are written with the jest testing framework.
45+
- Data should be provided in the tests and no network calls should be made.
46+
- They test, if the relevant information is shown in the correct way.
47+
- They test all different functionality of the component, e.g. clickable buttons, text inputs, navigation controls
48+
- We pay special attention to the state management of a component, e.g. if a component kept its state after closing a dialog popup or if the data has been updated correctly after an update of some parts of it
49+
- They should be added for all new or edited frontend components.
50+
### End-to-End tests (E2E tests)
51+
- we use cypress for E2E tests.
52+
- E2E tests are located in src/cypress/e2e and are called [testCase]Test.spec.tsx.
53+
- They are costly and should be used sparingly.
54+
- They are used for happypaths only, testing the most common usages and not all the edge cases.
55+
- They should guarantee the correct working of the application as a whole.
56+
- They will use network communication and a docker setup as defined in `docker-compose/compose.test.yml`
57+
- We will ask for creation separately, as they are fairly complex. Please hint, if a e2e test might be relevant in the current code.
58+
59+
60+
## Accessibility
61+
- Interactive elements must have appropriate ARIA attributes
62+
- Components should be keyboard navigable
63+
- Use semantic HTML elements
64+
- Meet WCAG 2.1 AA color contrast standards
65+
- Add alt text for images and aria-labels for SVGs
66+
- Form elements must have proper labels and error messages
67+
68+
## Dependencies
69+
- Use yarn as package manager
70+
- Our project is open source
71+
72+
## Versioning
73+
- Follow semantic commit messages pattern
74+
- Code is hosted on GitHub

.github/dependabot.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
target-branch: dev
5+
directory: '/'
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
time: '07:00'
10+
timezone: 'Europe/Berlin'
11+
groups:
12+
yarn-patch:
13+
update-types: ['patch']
14+
yarn-minor:
15+
update-types: ['minor']
16+
yarn-major:
17+
update-types: ['major']
18+
- package-ecosystem: 'docker'
19+
target-branch: dev
20+
directory: '/'
21+
groups:
22+
docker-all:
23+
patterns:
24+
- '*'
25+
schedule:
26+
interval: weekly
27+
- package-ecosystem: docker-compose
28+
target-branch: dev
29+
directory: '/'
30+
groups:
31+
compose-all:
32+
patterns:
33+
- '*'
34+
schedule:
35+
interval: weekly
36+
- package-ecosystem: github-actions
37+
target-branch: dev
38+
directory: '/'
39+
groups:
40+
actions-all:
41+
patterns:
42+
- '*'
43+
schedule:
44+
interval: weekly

.github/workflows/docker-build.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
# github.repository as <account>/<repo>
1616
IMAGE_NAME: mnestix-browser
1717
# Update the version manually
18-
IMAGE_TAG_VERSION: 1.4.2
18+
IMAGE_TAG_VERSION: 1.5.0
1919

2020
jobs:
2121
build-browser-image:
@@ -37,6 +37,7 @@ jobs:
3737
with:
3838
platforms: linux/amd64
3939
context: '.'
40+
cache-from: mnestix/mnestix-browser:dev
4041
cache-to: type=local,dest=/tmp/buildx-amd64-cache,mode=max
4142
target: production
4243
push: false
@@ -89,6 +90,11 @@ jobs:
8990
- name: Pull images
9091
run: docker compose -f compose.yml -f docker-compose/compose.test.yml --profile tests pull
9192

93+
# Remove old image to avoid conflicts, before sometimes the old image wasn't loaded
94+
# If this step fails please check docker-compose/compose.test.yml if tag is still correct
95+
- name: Remove Docker image mnestix/mnestix-browser:latest, to avoid conflicts
96+
run: docker rmi mnestix/mnestix-browser:latest
97+
9298
# overwrite the pulled image with the new image
9399
- name: Load mnestix-browser image
94100
run: docker load -i mnestix-browser.tar
@@ -114,8 +120,8 @@ jobs:
114120
name: cypress-artifacts-${{ matrix.containers }}
115121
path: cypress-artifacts/
116122

117-
unit-tests:
118-
name: Unit Tests
123+
unit-test:
124+
name: Unit Test
119125
runs-on: ubuntu-latest
120126
permissions:
121127
contents: read
@@ -124,15 +130,37 @@ jobs:
124130
- name: Checkout repository
125131
uses: actions/checkout@v4
126132
- name: Install dependencies
127-
run: yarn install
133+
run: yarn install --frozen-lockfile
134+
128135
- name: Run unit tests
129136
run: npx jest
130137

138+
lint:
139+
name: Lint and Typecheck
140+
runs-on: ubuntu-latest
141+
permissions:
142+
contents: read
143+
144+
steps:
145+
- name: Checkout repository
146+
uses: actions/checkout@v4
147+
- name: Install dependencies
148+
run: yarn install --frozen-lockfile
149+
150+
- name: Typescript check
151+
run: yarn typecheck
152+
- name: Typescript e2e check
153+
run: yarn typecheck:e2e
154+
- name: Linting check
155+
run: yarn lint
156+
131157
# Target for PR Merge Check
132158
ci-success:
133159
name: Successful build and tests
134160
runs-on: ubuntu-latest
135-
needs: ['unit-tests', 'e2e-tests']
161+
needs: ['lint', 'unit-test', 'e2e-tests']
162+
permissions:
163+
contents: read
136164
steps:
137165
- name: Success
138166
run: echo "Success"

.github/workflows/publish-wiki.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish wiki
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
paths:
66
- wiki/**
77
- .github/workflows/publish-wiki.yml
@@ -14,5 +14,5 @@ jobs:
1414
publish-wiki:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: Andrew-Chen-Wang/github-wiki-action@v4
17+
- uses: actions/checkout@v4
18+
- uses: Andrew-Chen-Wang/github-wiki-action@50650fccf3a10f741995523cf9708c53cec8912a # pinned version CWE-829

.gitignore

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
# ...
2-
.next
3-
next-env.d.ts
4-
dist
5-
node_modules
6-
cypress-artifacts
7-
/.idea/.idea.mnestix-frontend.dir/.idea/
8-
.env
1+
/next-env.d.ts
2+
/dist
3+
/node_modules
4+
/tsconfig.tsbuildinfo
5+
/.next
6+
97
/cypress/videos/
108
/cypress/screenshots/
11-
/prisma/mnestix-database.db
129
/cypress/results/*
10+
11+
/prisma/database/
12+
13+
/.idea/.idea.mnestix-frontend.dir/.idea/
14+
15+
/.env
16+
!.env.local
17+
/.env*.local
18+
/cypress-artifacts

0 commit comments

Comments
 (0)