@protacon/muster-booking-frontend 1.29.0 → 1.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +22 -0
- package/.gitattributes +6 -0
- package/.github/CODEOWNERS +5 -0
- package/.github/copilot-instructions.md +10 -0
- package/.github/workflows/demo-build.yml +33 -0
- package/.github/workflows/mergeChecks.yml +34 -0
- package/.prettierignore +18 -0
- package/Dockerfile +31 -0
- package/Jenkinsfile +1 -1
- package/LICENSE.md +1 -1
- package/README.md +13 -1
- package/dist/env.docker.js +1 -0
- package/dist/env.js +1 -1
- package/dist/env.template.js +1 -1
- package/dist/index.bundle.js +1 -1
- package/dist/styles.bundle.css +305 -262
- package/docker/.gitattributes +1 -0
- package/docker/entrypoint.sh +29 -0
- package/docker/nginx.conf +49 -0
- package/eslint.config.mjs +91 -0
- package/package.json +25 -18
- package/slack.json +16 -16
- package/tsconfig.json +16 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = false
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
|
|
9
|
+
[*.{js,jsx,ts,tsx}]
|
|
10
|
+
indent_style = tab
|
|
11
|
+
indent_size = 2
|
|
12
|
+
|
|
13
|
+
[*.{css,html}]
|
|
14
|
+
indent_style = space
|
|
15
|
+
indent_size = 2
|
|
16
|
+
|
|
17
|
+
[*.{json,yml,yaml}]
|
|
18
|
+
indent_style = space
|
|
19
|
+
indent_size = 2
|
|
20
|
+
|
|
21
|
+
[*.md]
|
|
22
|
+
trim_trailing_whitespace = false
|
package/.gitattributes
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Copilot PR Comment Instructions
|
|
2
|
+
|
|
3
|
+
- Do not post PR overview or summary comments.
|
|
4
|
+
- Only leave comments anchored to specific code lines/files.
|
|
5
|
+
- Avoid generic project-wide suggestions; keep feedback localized to the changed code.
|
|
6
|
+
- Do not restate commit messages, diffs, or change lists.
|
|
7
|
+
- Do not include “Key Changes”, “Overview”, or similar sections.
|
|
8
|
+
- Keep comments concise and actionable (what/why/how to fix).
|
|
9
|
+
- If no code-specific issues are found, do not comment.
|
|
10
|
+
- Never add links or promotional messages (e.g., “Add Copilot custom instructions…”).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# GitHub Actions docs
|
|
2
|
+
# https://help.github.com/en/articles/about-github-actions
|
|
3
|
+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
|
4
|
+
name: CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build application Docker image
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Make checkout
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Login to ACR
|
|
21
|
+
uses: docker/login-action@v3
|
|
22
|
+
with:
|
|
23
|
+
registry: ${{ secrets.REGISTRY_LOGIN_SERVER }}
|
|
24
|
+
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
25
|
+
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
26
|
+
|
|
27
|
+
- name: Build the Docker image
|
|
28
|
+
run: docker build . --file Dockerfile --tag smuster-carspect-booking-frontend:${{ github.sha }}
|
|
29
|
+
|
|
30
|
+
- name: Push image
|
|
31
|
+
run: |
|
|
32
|
+
docker tag smuster-carspect-booking-frontend:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/smuster-carspect-booking-frontend:latest-${{ github.ref_name }}
|
|
33
|
+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/smuster-carspect-booking-frontend:latest-${{ github.ref_name }}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Required merge checks
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, synchronize, ready_for_review]
|
|
6
|
+
push:
|
|
7
|
+
branches: ["master"]
|
|
8
|
+
jobs:
|
|
9
|
+
Build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-node@v4
|
|
14
|
+
with:
|
|
15
|
+
node-version: "20"
|
|
16
|
+
- run: npm install
|
|
17
|
+
- run: npm run build
|
|
18
|
+
Lint:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: "20"
|
|
25
|
+
- run: npm install
|
|
26
|
+
- run: npm run lint
|
|
27
|
+
Format:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: actions/setup-node@v4
|
|
32
|
+
with:
|
|
33
|
+
node-version: "20"
|
|
34
|
+
- run: npm run prettier
|
package/.prettierignore
ADDED
package/Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Fetch build image
|
|
2
|
+
FROM node:22-bullseye AS build
|
|
3
|
+
|
|
4
|
+
# Copy sources to container
|
|
5
|
+
COPY ./ /src/
|
|
6
|
+
|
|
7
|
+
# Change working directory
|
|
8
|
+
WORKDIR /src/
|
|
9
|
+
|
|
10
|
+
# Install all dependencies
|
|
11
|
+
RUN npm ci
|
|
12
|
+
|
|
13
|
+
# Build the application
|
|
14
|
+
RUN npm run build-web
|
|
15
|
+
|
|
16
|
+
# Add execute permissions to entrypoint script
|
|
17
|
+
RUN chmod +x /src/docker/entrypoint.sh
|
|
18
|
+
|
|
19
|
+
# Fetch nginx image to host application
|
|
20
|
+
FROM nginx:mainline-alpine
|
|
21
|
+
|
|
22
|
+
# Copy nginx configuration and build application inside the final container
|
|
23
|
+
COPY --from=build /src/docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
24
|
+
COPY --from=build /src/dist /usr/share/nginx/html
|
|
25
|
+
COPY --from=build /src/dist/env.docker.js /usr/share/nginx/html/env.js
|
|
26
|
+
COPY --from=build /src/docker/entrypoint.sh /entrypoint.sh
|
|
27
|
+
|
|
28
|
+
ENV CONFIG_JS_PATH=/usr/share/nginx/html/env.js
|
|
29
|
+
|
|
30
|
+
# Run entrypoint script
|
|
31
|
+
ENTRYPOINT ["/entrypoint.sh"]
|
package/Jenkinsfile
CHANGED
package/LICENSE.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(c) Copyright 2019
|
|
1
|
+
(c) Copyright 2019 Pinja Digital Oy, all rights reserved.
|
package/README.md
CHANGED
|
@@ -20,10 +20,10 @@ render() {
|
|
|
20
20
|
return (
|
|
21
21
|
<BookingComponent
|
|
22
22
|
locale="sv"
|
|
23
|
-
timezone="Europe/Stockholm"
|
|
24
23
|
apiEndpoint="https://.../booking.api/v1"
|
|
25
24
|
chainId={2}
|
|
26
25
|
googleApiKey="..."
|
|
26
|
+
mapId="..."
|
|
27
27
|
maxStations={5}
|
|
28
28
|
|
|
29
29
|
// Optional. Preselect reservation params
|
|
@@ -59,3 +59,15 @@ To start component with existing reservation edit navigate to page with componen
|
|
|
59
59
|
npm start
|
|
60
60
|
open http://localhost:8080/
|
|
61
61
|
```
|
|
62
|
+
|
|
63
|
+
## Building and running in docker
|
|
64
|
+
|
|
65
|
+
Build manually
|
|
66
|
+
|
|
67
|
+
`docker build -f Dockerfile --force-rm -t smusterbooking .`
|
|
68
|
+
|
|
69
|
+
Run docker image
|
|
70
|
+
|
|
71
|
+
`docker run -p 8080:80 --rm --name smusterbooking -e FRONTEND_apiurl='http://localhost:5001/v1' -e FRONTEND_chainId=6 -e FRONTEND_pbInspection=1 smusterbooking`
|
|
72
|
+
|
|
73
|
+
Check needed environment variables from `src/public/env.docker.js`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(n){let t=n.__env=n.__env||{};t.apiurl="ENV_apiurl",t.chainId=ENV_chainId,t.maxStations=5,t.googleMapsApiKey="ENV_googleMapsApiKey",t.pbInspection=ENV_pbInspection,t.lbInspection=ENV_lbInspection,t.mcInspection=ENV_mcInspection,t.slapInspection=ENV_slapInspection,t.slapBrakesInspection=ENV_slapBrakesInspection,t.mopedInspection=ENV_mopedInspection,t.trInspection=ENV_trInspection,t.camperAndMotorhomeInspection=ENV_camperAndMotorhomeInspection,t.camperAndMotorhomeInspectionLb=ENV_camperAndMotorhomeInspectionLb,t.caravanInspection=ENV_caravanInspection,t.pbPostInspection=ENV_pbPostInspection,t.lbPostInspection=ENV_lbPostInspection,t.mcPostInspection=ENV_mcPostInspection,t.slapPostInspection=ENV_slapPostInspection,t.slapBrakesPostInspection=ENV_slapBrakesPostInspection,t.mopedPostInspection=ENV_mopedPostInspection,t.trPostInspection=ENV_trPostInspection,t.camperAndMotorhomePostInspection=ENV_camperAndMotorhomePostInspection,t.camperAndMotorhomePostInspectionLb=ENV_camperAndMotorhomePostInspectionLb,t.caravanPostInspection=ENV_caravanPostInspection,t.trafficSafetyControl=ENV_trafficSafetyControl,t.trafficSafetyControlLb=ENV_trafficSafetyControlLb,t.conditionTestPremium=ENV_conditionTestPremium,t.conditionTestBasic=ENV_conditionTestBasic,t.vintageVehicleTest=ENV_vintageVehicleTest,t.gasolineTest=ENV_gasolineTest,t.batteryTestPremium=ENV_batteryTestPremium,t.batteryTestFlash=ENV_batteryTestFlash}(this);
|
package/dist/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){let
|
|
1
|
+
!function(t){let o=t.__env=t.__env||{};o.apiurl="http://localhost:5001/v1",o.chainId=6,o.maxStations=5,o.googleMapsApiKey="AIzaSyCHo7F34WsxGcRGewe_vmA6Qwn1PRBS4Jo",o.mapId="c0c69f26af929fd59abf6e31",o.pbInspection=1,o.lbInspection=101,o.mcInspection=102,o.slapInspection=105,o.slapBrakesInspection=112,o.mopedInspection=7,o.trInspection=111,o.camperAndMotorhomeInspection=10001,o.camperAndMotorhomeInspectionLb=153,o.caravanInspection=1001,o.pbPostInspection=2,o.lbPostInspection=2,o.mcPostInspection=2,o.slapPostInspection=2,o.slapBrakesPostInspection=2,o.mopedPostInspection=2,o.trPostInspection=2,o.camperAndMotorhomePostInspection=2,o.camperAndMotorhomePostInspectionLb=154,o.caravanPostInspection=2,o.trafficSafetyControl=113,o.trafficSafetyControlLb=114,o.conditionTestPremium=42,o.conditionTestBasic=43,o.vintageVehicleTest="",o.gasolineTest=10002,o.batteryTestPremium="",o.batteryTestFlash="",o.trafficSafetyControlLb=114}(this);
|
package/dist/env.template.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(t){let n=t.__env=t.__env||{};n.apiurl="[apiurl]",n.chainId=[chainId],n.maxStations=5,n.googleMapsApiKey="[googleMapsApiKey]",n.mapId="[mapId]",n.pbInspection=[pbInspection],n.lbInspection=[lbInspection],n.mcInspection=[mcInspection],n.slapInspection=[slapInspection],n.slapBrakesInspection=[slapBrakesInspection],n.mopedInspection=[mopedInspection],n.trInspection=[trInspection],n.camperAndMotorhomeInspection=[camperAndMotorhomeInspection],n.camperAndMotorhomeInspectionLb=[camperAndMotorhomeInspectionLb],n.caravanInspection=[caravanInspection],n.pbPostInspection=[pbPostInspection],n.lbPostInspection=[lbPostInspection],n.mcPostInspection=[mcPostInspection],n.slapPostInspection=[slapPostInspection],n.slapBrakesPostInspection=[slapBrakesPostInspection],n.mopedPostInspection=[mopedPostInspection],n.trPostInspection=[trPostInspection],n.camperAndMotorhomePostInspection=[camperAndMotorhomePostInspection],n.camperAndMotorhomePostInspectionLb=[camperAndMotorhomePostInspectionLb],n.caravanPostInspection=[caravanPostInspection],n.trafficSafetyControl=[trafficSafetyControl],n.trafficSafetyControlLb=[trafficSafetyControlLb],n.conditionTestPremium=[conditionTestPremium],n.conditionTestBasic=[conditionTestBasic],n.vintageVehicleTest=[vintageVehicleTest],n.gasolineTest=[gasolineTest],n.batteryTestPremium=[batteryTestPremium],n.batteryTestFlash=[batteryTestFlash],n.trafficSafetyControlLb=[trafficSafetyControlLb]}(this);
|