@protacon/muster-booking-frontend 1.30.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.
@@ -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 }}
@@ -1,8 +1,12 @@
1
- name: On push tests
2
- run-name: Lint application code
3
- on: [push]
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"]
4
8
  jobs:
5
- run-build:
9
+ Build:
6
10
  runs-on: ubuntu-latest
7
11
  steps:
8
12
  - uses: actions/checkout@v4
@@ -11,7 +15,7 @@ jobs:
11
15
  node-version: "20"
12
16
  - run: npm install
13
17
  - run: npm run build
14
- run-lint:
18
+ Lint:
15
19
  runs-on: ubuntu-latest
16
20
  steps:
17
21
  - uses: actions/checkout@v4
@@ -20,7 +24,7 @@ jobs:
20
24
  node-version: "20"
21
25
  - run: npm install
22
26
  - run: npm run lint
23
- run-prettier:
27
+ Format:
24
28
  runs-on: ubuntu-latest
25
29
  steps:
26
30
  - uses: actions/checkout@v4
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/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(n){let t=n.__env=n.__env||{};t.apiurl="http://localhost:5001/v1",t.chainId=6,t.maxStations=5,t.googleMapsApiKey="AIzaSyCHo7F34WsxGcRGewe_vmA6Qwn1PRBS4Jo",t.pbInspection=1,t.lbInspection=101,t.mcInspection=102,t.slapInspection=105,t.slapBrakesInspection=112,t.mopedInspection=7,t.trInspection=111,t.camperAndMotorhomeInspection=10001,t.camperAndMotorhomeInspectionLb=153,t.caravanInspection=1001,t.pbPostInspection=2,t.lbPostInspection=2,t.mcPostInspection=2,t.slapPostInspection=2,t.slapBrakesPostInspection=2,t.mopedPostInspection=2,t.trPostInspection=2,t.camperAndMotorhomePostInspection=2,t.camperAndMotorhomePostInspectionLb=154,t.caravanPostInspection=2,t.trafficSafetyControl=113,t.conditionTestPremium=42,t.conditionTestBasic=43,t.vintageVehicleTest="",t.gasolineTest=10002,t.batteryTestPremium="",t.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.camperAndMotorhomeInspectionLb=[camperAndMotorhomeInspectionLb],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.camperAndMotorhomePostInspectionLb=[camperAndMotorhomePostInspectionLb],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);