@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 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,6 @@
1
+ # Ensure consistent line endings across platforms
2
+ * text=auto eol=lf
3
+
4
+ # Denote binary files that should not be modified
5
+ *.woff binary
6
+ *.woff2 binary
@@ -0,0 +1,5 @@
1
+ # Each line is a file pattern followed by one or more owners.
2
+
3
+ # These owners will be the default owners for everything in the repo. Unless a later match takes precedence.
4
+ # Owners will be requested for review when someone opens a pull request.
5
+ * @by-pinja/muster
@@ -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
@@ -0,0 +1,18 @@
1
+ # Build outputs
2
+ dist/
3
+ node_modules/
4
+
5
+ # Configuration files
6
+ *.config.*
7
+ webpack.config.js
8
+ eslint.config.mjs
9
+
10
+ # Public assets
11
+ public/
12
+
13
+ # Package files
14
+ package-lock.json
15
+ yarn.lock
16
+
17
+ # Environment files
18
+ .env*
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
@@ -1,4 +1,4 @@
1
- library 'jenkins-ptcs-library@5.0.0'
1
+ library 'jenkins-ptcs-library@7.0.0'
2
2
 
3
3
  podTemplate(label: pod.label,
4
4
  containers: pod.templates + [ // This adds all depencies for jenkins-ptcs-library methods to function correctly.
package/LICENSE.md CHANGED
@@ -1 +1 @@
1
- (c) Copyright 2019 Protacon, all rights reserved.
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 n=t.__env=t.__env||{};n.apiurl="http://localhost:5001/v1",n.chainId=6,n.maxStations=5,n.googleMapsApiKey="AIzaSyCHo7F34WsxGcRGewe_vmA6Qwn1PRBS4Jo",n.pbInspection=1,n.lbInspection=101,n.mcInspection=102,n.slapInspection=105,n.slapBrakesInspection=112,n.mopedInspection=7,n.trInspection=111,n.camperAndMotorhomeInspection=10001,n.caravanInspection=1001,n.pbPostInspection=2,n.lbPostInspection=2,n.mcPostInspection=2,n.slapPostInspection=2,n.slapBrakesPostInspection=2,n.mopedPostInspection=2,n.trPostInspection=2,n.camperAndMotorhomePostInspection=2,n.caravanPostInspection=2,n.trafficSafetyControl=113,n.conditionTestPremium=42,n.conditionTestBasic=43,n.vintageVehicleTest="",n.gasolineTest=10002,n.batteryTestPremium="",n.batteryTestFlash=""}(this);
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);
@@ -1 +1 @@
1
- !function(n){let t=n.__env=n.__env||{};t.apiurl="[apiurl]",t.chainId=[chainId],t.maxStations=5,t.googleMapsApiKey="[googleMapsApiKey]",t.pbInspection=[pbInspection],t.lbInspection=[lbInspection],t.mcInspection=[mcInspection],t.slapInspection=[slapInspection],t.slapBrakesInspection=[slapBrakesInspection],t.mopedInspection=[mopedInspection],t.trInspection=[trInspection],t.camperAndMotorhomeInspection=[camperAndMotorhomeInspection],t.caravanInspection=[caravanInspection],t.pbPostInspection=[pbPostInspection],t.lbPostInspection=[lbPostInspection],t.mcPostInspection=[mcPostInspection],t.slapPostInspection=[slapPostInspection],t.slapBrakesPostInspection=[slapBrakesPostInspection],t.mopedPostInspection=[mopedPostInspection],t.trPostInspection=[trPostInspection],t.camperAndMotorhomePostInspection=[camperAndMotorhomePostInspection],t.caravanPostInspection=[caravanPostInspection],t.trafficSafetyControl=[trafficSafetyControl],t.conditionTestPremium=[conditionTestPremium],t.conditionTestBasic=[conditionTestBasic],t.vintageVehicleTest=[vintageVehicleTest],t.gasolineTest=[gasolineTest],t.batteryTestPremium=[batteryTestPremium],t.batteryTestFlash=[batteryTestFlash]}(this);
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);