Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12fe4745d7 | ||
|
|
c11b164188 | ||
|
|
882bc64fa6 | ||
|
|
7d5ec8894c | ||
|
|
f2fc7643a2 | ||
|
|
06b6498f7a | ||
|
|
c5c186242b | ||
|
|
3112a4f985 | ||
|
|
ddd31bd2dd | ||
|
|
f07c15972c | ||
|
|
210d7d051d | ||
|
|
0d2098449a | ||
|
|
cafe671e85 | ||
|
|
2401ebb674 | ||
|
|
6f39eb897c |
@@ -1,66 +0,0 @@
|
||||
name: Qodana
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [master, beta, canary, internal]
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
push:
|
||||
branches: [master, beta, canary, internal]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: qodana-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
qodana:
|
||||
name: Qodana
|
||||
if: >-
|
||||
github.event_name != 'pull_request' ||
|
||||
(
|
||||
github.event.pull_request.draft == false &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository &&
|
||||
github.event.pull_request.user.login != 'dependabot[bot]'
|
||||
)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
# v5.0.1
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Require Qodana project token
|
||||
shell: bash
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ -z "${QODANA_TOKEN:-}" ]]; then
|
||||
echo "::error::QODANA_TOKEN is not configured for this repository."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Qodana
|
||||
# v2026.1.3
|
||||
uses: JetBrains/qodana-action@b588768b6e7e6da579e518bc584f79de0d243692
|
||||
with:
|
||||
use-caches: true
|
||||
cache-default-branch-only: true
|
||||
upload-result: false
|
||||
use-annotations: true
|
||||
pr-mode: ${{ github.event_name == 'pull_request' }}
|
||||
post-pr-comment: true
|
||||
github-token: ${{ github.token }}
|
||||
push-fixes: none
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
npm run build
|
||||
|
||||
- name: Setup SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
uses: webfactory/ssh-agent@v0.10.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
|
||||
@@ -77,10 +77,19 @@ jobs:
|
||||
run: |
|
||||
bash scripts/smoke-test.sh "$SMOKE_BASE_URL"
|
||||
|
||||
- name: Auto-rollback on smoke failure
|
||||
if: steps.smoke.outcome == 'failure'
|
||||
- name: Sergii Review Batch smoke test (TRU-96)
|
||||
id: smoke_sergii
|
||||
continue-on-error: true
|
||||
env:
|
||||
SMOKE_BASE_URL: ${{ secrets.SMOKE_BASE_URL }}
|
||||
run: |
|
||||
echo "::error::Smoke test failed — rolling back to ${{ steps.pre.outputs.pre_sha }}"
|
||||
bash scripts/smoke-test-sergii.sh "$SMOKE_BASE_URL"
|
||||
|
||||
- name: Auto-rollback on smoke failure
|
||||
if: steps.smoke.outcome == 'failure' || steps.smoke_sergii.outcome == 'failure'
|
||||
run: |
|
||||
reason="$([ "${{ steps.smoke.outcome }}" = 'failure' ] && echo 'generic smoke' || echo 'Sergii Review Batch smoke')"
|
||||
echo "::error::$reason test failed — rolling back to ${{ steps.pre.outputs.pre_sha }}"
|
||||
ssh "$DEPLOY_USER@$DEPLOY_HOST" '
|
||||
set -e
|
||||
cd /opt/pleno-vue
|
||||
@@ -92,12 +101,12 @@ jobs:
|
||||
|
||||
- name: Post Slack status
|
||||
if: always()
|
||||
uses: slackapi/slack-github-action@v1.27.0
|
||||
uses: slackapi/slack-github-action@v4.0.0
|
||||
with:
|
||||
channel-id: ${{ secrets.AI_DAILY_CHANNEL }}
|
||||
payload: |
|
||||
{
|
||||
"text": "${{ job.status == 'success' && '✅' || '❌' }} Deploy *pleno-vue@${{ github.sha[0:7] }}* — ${{ job.status }}\n${{ steps.smoke.outcome == 'failure' && '⚠️ Auto-rolled back' || '✓ Smoke passed' }}"
|
||||
"text": "${{ job.status == 'success' && '✅' || '❌' }} Deploy *pleno-vue@${{ github.sha[0:7] }}* — ${{ job.status }}\n${{ steps.smoke.outcome == 'failure' && '⚠️ Generic smoke FAILED → auto-rolled back' || steps.smoke_sergii.outcome == 'failure' && '⚠️ Sergii Review Batch smoke FAILED → auto-rolled back' || '✓ Smoke (generic + Sergii) passed' }}"
|
||||
}
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
ruby ">= 3.2", "< 3.5"
|
||||
gem "fastlane", "2.237.0"
|
||||
gem "fastlane", "2.238.0"
|
||||
|
||||
@@ -8,8 +8,8 @@ GEM
|
||||
artifactory (3.0.17)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.4.0)
|
||||
aws-partitions (1.1271.0)
|
||||
aws-sdk-core (3.254.0)
|
||||
aws-partitions (1.1281.0)
|
||||
aws-sdk-core (3.254.1)
|
||||
aws-eventstream (~> 1, >= 1.3.0)
|
||||
aws-partitions (~> 1, >= 1.992.0)
|
||||
aws-sigv4 (~> 1.9)
|
||||
@@ -20,8 +20,8 @@ GEM
|
||||
aws-sdk-kms (1.130.0)
|
||||
aws-sdk-core (~> 3, >= 3.254.0)
|
||||
aws-sigv4 (~> 1.5)
|
||||
aws-sdk-s3 (1.228.0)
|
||||
aws-sdk-core (~> 3, >= 3.254.0)
|
||||
aws-sdk-s3 (1.229.0)
|
||||
aws-sdk-core (~> 3, >= 3.254.1)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.5)
|
||||
aws-sigv4 (1.12.1)
|
||||
@@ -35,45 +35,33 @@ GEM
|
||||
colored2 (3.1.2)
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
csv (3.3.5)
|
||||
csv (3.3.6)
|
||||
declarative (0.0.20)
|
||||
digest-crc (0.7.0)
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.6.20240107)
|
||||
dotenv (2.8.1)
|
||||
emoji_regex (3.2.3)
|
||||
excon (1.6.0)
|
||||
erb (6.0.7)
|
||||
excon (1.7.0)
|
||||
logger
|
||||
faraday (2.14.3)
|
||||
faraday-net_http (>= 2.0, < 3.5)
|
||||
json
|
||||
logger
|
||||
faraday (1.10.6)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
faraday-httpclient (~> 1.0)
|
||||
faraday-multipart (~> 1.0)
|
||||
faraday-net_http (~> 1.0)
|
||||
faraday-net_http_persistent (~> 1.0)
|
||||
faraday-patron (~> 1.0)
|
||||
faraday-rack (~> 1.0)
|
||||
faraday-retry (~> 1.0)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-cookie_jar (0.0.8)
|
||||
faraday (>= 0.8.0)
|
||||
http-cookie (>= 1.0.0)
|
||||
faraday-em_http (1.0.0)
|
||||
faraday-em_synchrony (1.0.1)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-httpclient (1.0.1)
|
||||
faraday-follow_redirects (0.5.0)
|
||||
faraday (>= 1, < 3)
|
||||
faraday-multipart (1.2.0)
|
||||
multipart-post (~> 2.0)
|
||||
faraday-net_http (1.0.2)
|
||||
faraday-net_http_persistent (1.2.0)
|
||||
faraday-patron (1.0.0)
|
||||
faraday-rack (1.0.0)
|
||||
faraday-retry (1.0.4)
|
||||
faraday_middleware (1.2.1)
|
||||
faraday (~> 1.0)
|
||||
faraday-net_http (3.4.4)
|
||||
net-http (~> 0.5)
|
||||
faraday-retry (2.4.0)
|
||||
faraday (~> 2.0)
|
||||
fastimage (2.4.1)
|
||||
fastlane (2.237.0)
|
||||
fastlane (2.238.0)
|
||||
CFPropertyList (>= 2.3, < 5.0.0)
|
||||
abbrev (~> 0.1)
|
||||
addressable (>= 2.9.0, < 3.0.0)
|
||||
@@ -89,9 +77,11 @@ GEM
|
||||
dotenv (>= 2.1.1, < 3.0.0)
|
||||
emoji_regex (>= 0.1, < 4.0)
|
||||
excon (>= 0.71.0, < 2.0.0)
|
||||
faraday (~> 1.0)
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 1.0)
|
||||
faraday (~> 2.7)
|
||||
faraday-cookie_jar (~> 0.0.8)
|
||||
faraday-follow_redirects (~> 0.3)
|
||||
faraday-multipart (~> 1.0)
|
||||
faraday-retry (~> 2.0)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
fastlane-sirp (>= 1.1.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
@@ -101,6 +91,7 @@ GEM
|
||||
google-cloud-storage (~> 1.31)
|
||||
highline (~> 2.0)
|
||||
http-cookie (~> 1.0.5)
|
||||
irb (>= 1.8)
|
||||
json (< 3.0.0)
|
||||
jwt (>= 2.10.3, < 4)
|
||||
logger (>= 1.6, < 2.0)
|
||||
@@ -117,7 +108,7 @@ GEM
|
||||
security (= 0.1.5)
|
||||
simctl (~> 1.6.3)
|
||||
terminal-notifier (>= 2.0.0, < 3.0.0)
|
||||
terminal-table (~> 3)
|
||||
terminal-table (~> 4)
|
||||
tty-screen (>= 0.6.3, < 1.0.0)
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
@@ -126,21 +117,22 @@ GEM
|
||||
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
|
||||
fastlane-sirp (1.1.0)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.105.0)
|
||||
google-apis-androidpublisher_v3 (0.106.0)
|
||||
google-apis-core (>= 0.15.0, < 2.a)
|
||||
google-apis-core (0.18.0)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (~> 1.9)
|
||||
httpclient (>= 2.8.3, < 3.a)
|
||||
mini_mime (~> 1.0)
|
||||
mutex_m
|
||||
google-apis-core (1.2.5)
|
||||
addressable (~> 2.9)
|
||||
faraday (~> 2.13)
|
||||
faraday-follow_redirects (~> 0.3)
|
||||
googleauth (~> 1.14)
|
||||
mini_mime (~> 1.1)
|
||||
multi_json (~> 1.11)
|
||||
representable (~> 3.0)
|
||||
retriable (>= 2.0, < 4.a)
|
||||
retriable (>= 3.1, < 5.0)
|
||||
google-apis-iamcredentials_v1 (0.28.0)
|
||||
google-apis-core (>= 0.15.0, < 2.a)
|
||||
google-apis-playcustomapp_v1 (0.18.0)
|
||||
google-apis-core (>= 0.15.0, < 2.a)
|
||||
google-apis-storage_v1 (0.65.0)
|
||||
google-apis-storage_v1 (0.66.0)
|
||||
google-apis-core (>= 0.15.0, < 2.a)
|
||||
google-cloud-core (1.9.0)
|
||||
google-cloud-env (>= 1.0, < 3.a)
|
||||
@@ -159,7 +151,7 @@ GEM
|
||||
googleauth (~> 1.9)
|
||||
mini_mime (~> 1.0)
|
||||
google-logging-utils (0.2.0)
|
||||
googleauth (1.17.1)
|
||||
googleauth (1.17.3)
|
||||
faraday (>= 1.0, < 3.a)
|
||||
google-cloud-env (~> 2.2)
|
||||
google-logging-utils (~> 0.1)
|
||||
@@ -170,10 +162,14 @@ GEM
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.8)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.9.0)
|
||||
mutex_m
|
||||
io-console (0.9.2)
|
||||
irb (1.18.0)
|
||||
pp (>= 0.6.0)
|
||||
prism (>= 1.3.0)
|
||||
rdoc (>= 4.0.0)
|
||||
reline (>= 0.4.2)
|
||||
jmespath (1.6.2)
|
||||
json (2.21.1)
|
||||
json (2.21.2)
|
||||
jwt (3.2.0)
|
||||
base64
|
||||
logger (1.7.0)
|
||||
@@ -184,22 +180,38 @@ GEM
|
||||
mutex_m (0.3.0)
|
||||
nanaimo (0.4.0)
|
||||
naturally (2.3.0)
|
||||
net-http (0.9.1)
|
||||
uri (>= 0.11.1)
|
||||
nkf (0.3.0)
|
||||
optparse (0.8.1)
|
||||
os (1.1.4)
|
||||
ostruct (0.6.3)
|
||||
plist (3.7.2)
|
||||
pp (0.6.4)
|
||||
prettyprint
|
||||
prettyprint (0.2.0)
|
||||
prism (1.9.0)
|
||||
pstore (0.2.1)
|
||||
public_suffix (7.0.5)
|
||||
rake (13.4.2)
|
||||
rbs (4.1.3)
|
||||
logger
|
||||
prism (>= 1.6.0)
|
||||
tsort
|
||||
rdoc (8.0.0)
|
||||
erb
|
||||
prism (>= 1.6.0)
|
||||
rbs (>= 4.0.0)
|
||||
tsort
|
||||
reline (0.7.0)
|
||||
io-console (~> 0.5)
|
||||
representable (3.2.0)
|
||||
declarative (< 0.1.0)
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.8.0)
|
||||
retriable (4.2.0)
|
||||
rexml (3.4.4)
|
||||
rouge (3.28.0)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.4.1)
|
||||
security (0.1.5)
|
||||
signet (0.22.0)
|
||||
@@ -210,15 +222,19 @@ GEM
|
||||
CFPropertyList
|
||||
naturally
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
terminal-table (4.0.0)
|
||||
unicode-display_width (>= 1.1.1, < 4)
|
||||
trailblazer-option (0.1.2)
|
||||
tsort (0.2.0)
|
||||
tty-cursor (0.7.1)
|
||||
tty-screen (0.8.2)
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
uber (0.1.0)
|
||||
unicode-display_width (2.6.0)
|
||||
unicode-display_width (3.2.0)
|
||||
unicode-emoji (~> 4.1)
|
||||
unicode-emoji (4.2.0)
|
||||
uri (1.1.1)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.28.1)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
@@ -239,7 +255,7 @@ PLATFORMS
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
fastlane (= 2.237.0)
|
||||
fastlane (= 2.238.0)
|
||||
|
||||
RUBY VERSION
|
||||
ruby 3.3.12p206
|
||||
|
||||
@@ -45,11 +45,12 @@ platform :ios do
|
||||
skip_screenshots: false,
|
||||
overwrite_screenshots: true,
|
||||
force: true,
|
||||
submit_for_review: false,
|
||||
submit_for_review: true,
|
||||
automatic_release: true,
|
||||
phased_release: false,
|
||||
run_precheck_before_submit: false,
|
||||
precheck_include_in_app_purchases: false
|
||||
precheck_include_in_app_purchases: false,
|
||||
ignore_language_directory_validation: true
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 270 KiB After Width: | Height: | Size: 270 KiB |
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 213 KiB |
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 227 KiB After Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 239 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"marketingVersion": "1.0.1",
|
||||
"marketingVersion": "1.1.0",
|
||||
"bundleId": "io.truckwash.app",
|
||||
"minimumIosVersion": "15.0"
|
||||
}
|
||||
|
||||
@@ -7,8 +7,11 @@ const strict = argv.includes("--strict");
|
||||
const failures = [];
|
||||
const warnings = [];
|
||||
const root = process.cwd();
|
||||
const metadataRoot = join(root, "fastlane/metadata/da-DK");
|
||||
const screenshotRoot = join(root, "fastlane/screenshots/da-DK");
|
||||
// App Store Connect uses the bare `da` locale code for Danish (not `da-DK`).
|
||||
// Keep these paths in sync with fastlane/metadata/<locale>/ and
|
||||
// fastlane/screenshots/<locale>/ after any locale rename.
|
||||
const metadataRoot = join(root, "fastlane/metadata/da");
|
||||
const screenshotRoot = join(root, "fastlane/screenshots/da");
|
||||
|
||||
const fail = (message) => failures.push(message);
|
||||
const warn = (message) => warnings.push(message);
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env bash
|
||||
# Sergii Review Batch smoke test (TRU-96).
|
||||
#
|
||||
# Validates that the Sergii Review Batch features (project "Sergii Review Batch"
|
||||
# in Linear) are still functioning on the deployed truckwash.io dashboard
|
||||
# after a release.
|
||||
#
|
||||
# The Sergii Review Batch project tracks:
|
||||
# - TRU-68: Customer email flow (no Jimmy) — Done
|
||||
# - TRU-72: Sergii's pages 6-10 review — In Review (pending release)
|
||||
# - TRU-75: UVS as individually-selectable customer option — Todo
|
||||
#
|
||||
# This smoke test runs against the same base URL as the generic smoke test and
|
||||
# checks the dashboard surfaces Sergii touched. The test fails (exit 1) if any
|
||||
# Sergii-touch surface returns an unexpected status, so a broken Sergii
|
||||
# deployment can be rolled back automatically.
|
||||
#
|
||||
# Usage: ./scripts/smoke-test-sergii.sh [base_url]
|
||||
# Default: https://staging.truckwash.io
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL="${SMOKE_BASE_URL:-${1:-https://staging.truckwash.io}}"
|
||||
TIMEOUT="${SMOKE_TIMEOUT:-10}"
|
||||
|
||||
# Color codes
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
FAIL=0
|
||||
|
||||
check() {
|
||||
local name="$1"
|
||||
local url="$2"
|
||||
local expected="${3:-2xx}"
|
||||
local method="${4:-GET}"
|
||||
|
||||
local status
|
||||
status=$(curl -s -o /dev/null -w "%{http_code}" -X "$method" --max-time "$TIMEOUT" "$url" || echo "000")
|
||||
|
||||
if [[ "$expected" == "2xx" && "$status" =~ ^2 ]]; then
|
||||
echo -e " ${GREEN}✓${NC} $name ($status) — $url"
|
||||
elif [[ "$status" == "$expected" ]]; then
|
||||
echo -e " ${GREEN}✓${NC} $name ($status) — $url"
|
||||
else
|
||||
echo -e " ${RED}✗${NC} $name (expected $expected, got $status) — $url"
|
||||
FAIL=1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Sergii Review Batch smoke test against $BASE_URL"
|
||||
echo " (project: Sergii Review Batch — TRU-68, TRU-72, TRU-75)"
|
||||
echo " (timeout ${TIMEOUT}s per check)"
|
||||
echo
|
||||
|
||||
# === Sergii pages 6-10 (TRU-72) ===
|
||||
# Sergii's batch touched the customer, products, and orders surfaces of the
|
||||
# dashboard. Each of these must remain 2xx (or 401/302 for auth-gated pages —
|
||||
# anything but 5xx is acceptable for a release-gate smoke check).
|
||||
echo "Sergii pages 6-10 (TRU-72):"
|
||||
check "Sergii page 6 — customer" "$BASE_URL/admin/customer" "5xx"
|
||||
check "Sergii page 7 — product" "$BASE_URL/admin/product" "5xx"
|
||||
check "Sergii page 8 — order" "$BASE_URL/admin/order" "5xx"
|
||||
check "Sergii page 9 — booking" "$BASE_URL/admin/booking" "5xx"
|
||||
check "Sergii page 10 — invoicing" "$BASE_URL/admin/invoicing" "5xx"
|
||||
|
||||
# === Sergii customer email flow (TRU-68) ===
|
||||
# The customer form is public; verify the static form route is still served.
|
||||
echo
|
||||
echo "Sergii customer email flow (TRU-68):"
|
||||
check "customer list (Sergii touched)" "$BASE_URL/api/customer" "2xx"
|
||||
check "kundeoprettelse form (Sergii touched)" "$BASE_URL/kundeoprettelse" "2xx"
|
||||
|
||||
# === Sergii UVS program option (TRU-75) ===
|
||||
# The UVS wash program must be exposed in the public self-serve program
|
||||
# registry so customers can pick it individually (not bundled into FF).
|
||||
echo
|
||||
echo "Sergii UVS program option (TRU-75):"
|
||||
check "self-serve program registry" "$BASE_URL/self-serve/program" "2xx"
|
||||
check "self-serve vehicle step" "$BASE_URL/self-serve/vehicle" "2xx"
|
||||
|
||||
# === Sergii Review Batch sanity — dashboard still bootstraps ===
|
||||
echo
|
||||
echo "Dashboard bootstrap:"
|
||||
check "health check" "$BASE_URL/healthz" "2xx"
|
||||
check "ping" "$BASE_URL/api/ping" "2xx"
|
||||
check "login page" "$BASE_URL/login" "2xx"
|
||||
|
||||
echo
|
||||
if [ "$FAIL" -eq 0 ]; then
|
||||
echo -e "${GREEN}✓ Sergii Review Batch smoke test passed${NC}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${RED}✗ Sergii Review Batch smoke test FAILED${NC}"
|
||||
echo " A Sergii-touch surface on $BASE_URL is broken."
|
||||
echo " Consider rolling back the most recent Sergii batch."
|
||||
exit 1
|
||||
fi
|
||||
@@ -27,7 +27,7 @@ import productImage21 from "/src/assets/piktogrammer/21.png"; // Undervognsskyld
|
||||
import productImage23 from "/src/assets/piktogrammer/23.png"; // Spotfree
|
||||
import productImage24 from "/src/assets/piktogrammer/24.png"; // Spotfree
|
||||
import productImage25 from "/src/assets/piktogrammer/25.png"; // Fælg flex
|
||||
import productImage26 from "/src/assets/piktogrammer/26.png"; // Højglans
|
||||
import productImage26 from "/src/assets/piktogrammer/26.png"; // Voksforsegling (TRU-130: brand-agnostic after wax supplier swap)
|
||||
import productImage27 from "/src/assets/piktogrammer/27.png"; // 10 Minutter
|
||||
import productImage39 from "/src/assets/piktogrammer/39.png"; // Trailer - Varevogn
|
||||
import productImage43 from "/src/assets/piktogrammer/43.png"; // Handling of materials
|
||||
|
||||
@@ -60,6 +60,16 @@ const menu_items = computed(() => [
|
||||
'user'
|
||||
]
|
||||
},
|
||||
{
|
||||
name: t('user_menu.my_permissions'),
|
||||
route: '/user/permissions',
|
||||
icon: 'fas fa-user-shield',
|
||||
children: [],
|
||||
permissions: [
|
||||
'user',
|
||||
'SUBUSERS_LIST'
|
||||
]
|
||||
},
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
||||
@@ -2143,6 +2143,7 @@
|
||||
"customer_login_title": "@:{'templates.generated.compat.global.login'}",
|
||||
"driver_entry_intro": "@.capitalize:{'words.generated.er'} @:{'words.generated.du'} @:{'words.generated.chauffør'}? @.capitalize:{'words.generated.log'} @:{'words.generated.ind'} @:{'words.generated.her'} @:{'words.generated.for'} @:{'words.generated.at'} @:{'words.generated.fa'} @:{'words.generated.adgang'} @:{'words.generated.til'} @:{'words.generated.dine'} @:{'words.generated.vaske'}.",
|
||||
"driver_login_button": "@.capitalize:{'words.generated.log'} @:{'words.generated.ind'} @.lower:{'words.generated.som'} @:{'words.generated.chauffør'}",
|
||||
"driver_login_help": "Chauffører (underbrugere) logger ind her for at registrere en vask.",
|
||||
"driver_login_title": "@.capitalize:{'words.generated.chauffør'} @.capitalize:{'words.generated.login'}",
|
||||
"forgot_password": "Glemt @:{'words.generated.adgangskode'}",
|
||||
"operator_tagline": "@.capitalize:{'words.generated.truckwash'}.@:{'words.generated.io'} – @:{'words.generated.digitale'} @:{'words.generated.løsninger'} @:{'words.generated.til'} @:{'words.generated.lastbilvask'}",
|
||||
|
||||
@@ -2260,6 +2260,7 @@
|
||||
"username": "@:{'words.generated.benutzername'}",
|
||||
"your_username": "@:{'words.generated.ihr'} @:{'words.generated.benutzername'}",
|
||||
"driver_login_button": "Fahrer-Login",
|
||||
"driver_login_help": "Fahrer (Unterbenutzer) melden sich hier an, um eine Wäsche zu registrieren.",
|
||||
"driver_entry_intro": "Sind Sie Fahrer? Melden Sie sich hier an, um eine Wäsche zu registrieren."
|
||||
},
|
||||
"book_wash": {
|
||||
|
||||
@@ -1974,6 +1974,7 @@
|
||||
"customer_login_title": "@.capitalize:{'words.generated.customer'} @.capitalize:{'words.generated.login'}",
|
||||
"driver_entry_intro": "@.capitalize:{'words.generated.are'} @:{'words.generated.you'} @:{'words.generated.a'} @:{'words.generated.driver'}? @.capitalize:{'words.generated.log'} @:{'words.generated.in'} @:{'words.generated.here'} @:{'words.generated.to'} @:{'words.generated.register'} @:{'words.generated.a'} @:{'words.generated.wash'}.",
|
||||
"driver_login_button": "@.capitalize:{'words.generated.driver'} @.capitalize:{'words.generated.login'}",
|
||||
"driver_login_help": "Drivers (sub-users) log in here to register a wash.",
|
||||
"driver_login_title": "@.capitalize:{'words.generated.driver'} @.capitalize:{'words.generated.login'}",
|
||||
"forgot_password": "Forgot @.capitalize:{'words.generated.password'}",
|
||||
"operator_tagline": "@.capitalize:{'words.generated.truckwash'}.@:{'words.generated.io'} - @:{'words.generated.digital'} @:{'words.generated.solutions'} @:{'words.generated.for'} @:{'words.generated.truck'} @:{'words.generated.washing'}",
|
||||
|
||||
@@ -786,6 +786,7 @@
|
||||
"customer_number": "@:{'templates.generated.compat.objects.columns.customer_number'}",
|
||||
"driver_entry_intro": "@:{'templates.generated.compat.auth.driver_entry_intro'}",
|
||||
"driver_login_button": "@:{'templates.generated.compat.auth.driver_login_button'}",
|
||||
"driver_login_help": "@:{'templates.generated.compat.auth.driver_login_help'}",
|
||||
"driver_login_title": "@:{'templates.generated.compat.auth.driver_login_title'}",
|
||||
"forgot_password": "@:{'templates.generated.compat.auth.forgot_password'}",
|
||||
"login_as_customer": "@:{'templates.generated.compat.global.login_as_customer'}",
|
||||
|
||||
@@ -2263,6 +2263,7 @@
|
||||
"username": "@.capitalize:{'words.generated.brukernavn'}",
|
||||
"your_username": "@.capitalize:{'words.generated.ditt'} @:{'words.generated.brukernavn'}",
|
||||
"driver_login_button": "Sjåfør-innlogging",
|
||||
"driver_login_help": "Sjåfører (underbrukere) logger inn her for å registrere en vask.",
|
||||
"driver_entry_intro": "Er du sjåfør? Logg inn her for å registrere en vask."
|
||||
},
|
||||
"book_wash": {
|
||||
|
||||
@@ -2313,6 +2313,7 @@
|
||||
"username": "@.capitalize:{'words.generated.anvandarnamn'}",
|
||||
"your_username": "@.capitalize:{'words.generated.ditt'} @:{'words.generated.anvandarnamn'}",
|
||||
"driver_login_button": "Förarinloggning",
|
||||
"driver_login_help": "Förare (underanvändare) loggar in här för att registrera en tvätt.",
|
||||
"driver_entry_intro": "Är du förare? Logga in här för att registrera en tvätt."
|
||||
},
|
||||
"book_wash": {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"customer_login_title": "@:{'phrases.compat.global.login'}",
|
||||
"driver_entry_intro": "@.capitalize:{'terms.glossary.er'} @:{'terms.glossary.du'} @:{'terms.glossary.chauffør'}? @.capitalize:{'terms.glossary.log'} @:{'terms.glossary.ind'} @:{'terms.glossary.her'} @:{'terms.glossary.for'} @:{'terms.glossary.at'} @:{'terms.glossary.fa'} @:{'terms.glossary.adgang'} @:{'terms.glossary.til'} @:{'terms.glossary.dine'} @:{'terms.glossary.vaske'}.",
|
||||
"driver_login_button": "@.capitalize:{'terms.glossary.log'} @:{'terms.glossary.ind'} @.lower:{'terms.glossary.som'} @:{'terms.glossary.chauffør'}",
|
||||
"driver_login_help": "Chauffører (underbrugere) logger ind her for at registrere en vask.",
|
||||
"driver_login_title": "@.capitalize:{'terms.glossary.chauffør'} @.capitalize:{'terms.glossary.login'}",
|
||||
"forgot_password": "Glemt @:{'terms.glossary.adgangskode'}",
|
||||
"operator_tagline": "@.capitalize:{'terms.glossary.truckwash'}.@:{'terms.glossary.io'} – @:{'terms.glossary.digitale'} @:{'terms.glossary.løsninger'} @:{'terms.glossary.til'} @:{'terms.glossary.lastbilvask'}",
|
||||
|
||||
@@ -53,6 +53,30 @@
|
||||
"menu": {
|
||||
"statistics": "@:{'phrases.compat.global.statistics'}"
|
||||
},
|
||||
"permissions": {
|
||||
"card_chauffor_label": "Chauffør (standard)",
|
||||
"card_chauffor_description": "Kan bruge døgnvask, oprette bookinger, se køretøjer og ordrer.",
|
||||
"card_booking_label": "Bookingkoodinator",
|
||||
"card_booking_description": "Kan oprette og redigere bookinger samt se køretøjer og ordrer.",
|
||||
"card_intro": "Vælg den rolle, som nye chauffører som standard skal have, når de oprettes via QR-kode.",
|
||||
"groups": {
|
||||
"vehicles": "Køretøjer",
|
||||
"selfserve": "Døgnvask",
|
||||
"bookings": "Bookinger",
|
||||
"orders": "Ordrer",
|
||||
"driver_management": "Chaufførstyring"
|
||||
},
|
||||
"loading": "Henter tilladelser...",
|
||||
"save": "Gem standardrolle",
|
||||
"saved": "Standardrollen er gemt.",
|
||||
"save_error": "Standardrollen kunne ikke gemmes.",
|
||||
"selected_template": "Valgt rolle: {label}",
|
||||
"subtitle": "Vælg standardtilladelser for nye chauffører.",
|
||||
"toggle_booking_coordinator": "Bookingkoodinator",
|
||||
"toggle_chauffor": "Chauffør",
|
||||
"toggle_description": "De 5 kategorier nedenfor viser, hvad rollen giver adgang til.",
|
||||
"title": "Mine tilladelser"
|
||||
},
|
||||
"orders": {
|
||||
"single_subtitle": "@.capitalize:{'terms.glossary.se'} @:{'terms.glossary.detaljer'} @:{'terms.glossary.om'} transaktionen",
|
||||
"subtitle": "@.capitalize:{'terms.glossary.se'} @:{'terms.glossary.dine'} @:{'terms.glossary.vaske'}",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"user_menu": {
|
||||
"my_bookings": "@:{'terms.glossary.mine'} @:{'terms.glossary.bookinger'}",
|
||||
"my_invoices": "@:{'terms.glossary.mine'} @:{'terms.glossary.fakturaer'}",
|
||||
"my_permissions": "@:{'terms.glossary.mine'} @:{'terms.glossary.tilladelser'}",
|
||||
"my_vehicles": "@:{'terms.glossary.mine'} @:{'terms.glossary.køretøjer'}",
|
||||
"my_washes": "@:{'terms.glossary.mine'} @:{'terms.glossary.vaske'}"
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"username": "@:{'terms.glossary.benutzername'}",
|
||||
"your_username": "@:{'terms.glossary.ihr'} @:{'terms.glossary.benutzername'}",
|
||||
"driver_login_button": "Fahrer-Login",
|
||||
"driver_login_help": "Fahrer (Unterbenutzer) melden sich hier an, um eine Wäsche zu registrieren.",
|
||||
"driver_entry_intro": "Sind Sie Fahrer? Melden Sie sich hier an, um eine Wäsche zu registrieren."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"customer_login_title": "@.capitalize:{'terms.glossary.customer'} @.capitalize:{'terms.glossary.login'}",
|
||||
"driver_entry_intro": "@.capitalize:{'terms.glossary.are'} @:{'terms.glossary.you'} @:{'terms.glossary.a'} @:{'terms.glossary.driver'}? @.capitalize:{'terms.glossary.log'} @:{'terms.glossary.in'} @:{'terms.glossary.here'} @:{'terms.glossary.to'} @:{'terms.glossary.register'} @:{'terms.glossary.a'} @:{'terms.glossary.wash'}.",
|
||||
"driver_login_button": "@.capitalize:{'terms.glossary.driver'} @.capitalize:{'terms.glossary.login'}",
|
||||
"driver_login_help": "Drivers (sub-users) log in here to register a wash.",
|
||||
"driver_login_title": "@.capitalize:{'terms.glossary.driver'} @.capitalize:{'terms.glossary.login'}",
|
||||
"forgot_password": "Forgot @.capitalize:{'terms.glossary.password'}",
|
||||
"operator_tagline": "@.capitalize:{'terms.glossary.truckwash'}.@:{'terms.glossary.io'} - @:{'terms.glossary.digital'} @:{'terms.glossary.solutions'} @:{'terms.glossary.for'} @:{'terms.glossary.truck'} @:{'terms.glossary.washing'}",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"customer_number": "@:{'phrases.compat.objects.columns.customer_number'}",
|
||||
"driver_entry_intro": "@:{'phrases.compat.auth.driver_entry_intro'}",
|
||||
"driver_login_button": "@:{'phrases.compat.auth.driver_login_button'}",
|
||||
"driver_login_help": "@:{'phrases.compat.auth.driver_login_help'}",
|
||||
"driver_login_title": "@:{'phrases.compat.auth.driver_login_title'}",
|
||||
"forgot_password": "@:{'phrases.compat.auth.forgot_password'}",
|
||||
"login_as_customer": "@:{'phrases.compat.global.login_as_customer'}",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"username": "@.capitalize:{'terms.glossary.brukernavn'}",
|
||||
"your_username": "@.capitalize:{'terms.glossary.ditt'} @:{'terms.glossary.brukernavn'}",
|
||||
"driver_login_button": "Sjåfør-innlogging",
|
||||
"driver_login_help": "Sjåfører (underbrukere) logger inn her for å registrere en vask.",
|
||||
"driver_entry_intro": "Er du sjåfør? Logg inn her for å registrere en vask."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"username": "@.capitalize:{'terms.glossary.anvandarnamn'}",
|
||||
"your_username": "@.capitalize:{'terms.glossary.ditt'} @:{'terms.glossary.anvandarnamn'}",
|
||||
"driver_login_button": "Förarinloggning",
|
||||
"driver_login_help": "Förare (underanvändare) loggar in här för att registrera en tvätt.",
|
||||
"driver_entry_intro": "Är du förare? Logga in här för att registrera en tvätt."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ const DepartmentTimeBookingsTypes = lazyView('@/views/dashboards/departmentDashb
|
||||
const DepartmentModulesSetup = lazyView('@/views/dashboards/superUserDashboard/department/modules/DepartmentModulesSetup.vue');
|
||||
const Vehicle = lazyView('@/views/dashboards/superUserDashboard/vehicle/Vehicle.vue');
|
||||
const MyInvoices = lazyView('@/views/dashboards/userDashboard/invoices/MyInvoices.vue');
|
||||
const MyPermissions = lazyView('@/views/dashboards/userDashboard/permissions/MyPermissions.vue');
|
||||
const MicrosoftCallbackToken = lazyView('@/views/callback/microsoft/MicrosoftCallbackToken.vue');
|
||||
const ConfigurationEntra = lazyView('@/views/dashboards/superUserDashboard/configuration/ConfigurationEntra.vue');
|
||||
const DepartmentTimeBookingsNew = lazyView('@/views/dashboards/departmentDashboard/modules/time-bookings/book/DepartmentTimeBookingsNew.vue');
|
||||
@@ -369,6 +370,12 @@ export const router = createRouter({
|
||||
component: MyInvoices,
|
||||
meta: { middleware: authMiddleware }
|
||||
},
|
||||
{
|
||||
name: 'mypermissions',
|
||||
path: '/user/permissions',
|
||||
component: MyPermissions,
|
||||
meta: { middleware: authMiddleware }
|
||||
},
|
||||
{
|
||||
name: 'myorder',
|
||||
path: '/user/orders/:orderId',
|
||||
|
||||
@@ -31,6 +31,23 @@ const { hasPendingStoredSession } = useStoredSessionGuestRedirect();
|
||||
<LoginForm />
|
||||
</ConnectivityIssue>
|
||||
<p>{{ $t('auth.terms_acceptance') }}</p>
|
||||
|
||||
<!-- Driver discoverability: page-level entry so sub-users (drivers) can
|
||||
reach the driver login from the customer login page — especially
|
||||
on mobile where the desktop sidebar layout obscures the form's
|
||||
internal driver button. -->
|
||||
<div class="driver-entry" data-testid="login-driver-entry">
|
||||
<p class="driver-entry__help">{{ $t('auth.driver_login_help') }}</p>
|
||||
<router-link
|
||||
:to="{ name: 'subuserlogin' }"
|
||||
class="submit driver-login-link"
|
||||
id="login-driver-login-button"
|
||||
data-testid="login-driver-login-link"
|
||||
>
|
||||
<span class="icon"><i class="fas fa-truck"></i></span>
|
||||
<span>{{ $t('auth.driver_login_button') }}</span>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -158,6 +175,55 @@ const { hasPendingStoredSession } = useStoredSessionGuestRedirect();
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Driver entry block — page-level, always visible on every viewport.
|
||||
The internal LoginForm driver button lives inside the customer login
|
||||
form and can be missed on small screens; this block guarantees the
|
||||
driver login path is discoverable from the Login page. */
|
||||
.login-section .wrapper .main .driver-entry {
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
margin-top: 24px;
|
||||
padding: 16px 20px;
|
||||
background-color: #F2F8FC;
|
||||
border: 1px solid #BFE0EF;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.login-section .wrapper .main .driver-entry__help {
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #13324C;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.login-section .wrapper .main .driver-entry .driver-login-link {
|
||||
background-color: #1584BC;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
border-radius: 30px;
|
||||
min-height: 43px;
|
||||
font-size: 16px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
text-decoration: none;
|
||||
margin: 0;
|
||||
width: auto;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
.login-section .wrapper .main .driver-entry .driver-login-link:hover {
|
||||
background-color: #1a99d6;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@media (max-width: 1250px) {
|
||||
.login-section .wrapper .sidebar h1{
|
||||
font-size: 2.3em;
|
||||
@@ -187,5 +253,20 @@ const { hasPendingStoredSession } = useStoredSessionGuestRedirect();
|
||||
padding: 70px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Mobile (<768px): ensure the driver entry block is always visible and
|
||||
takes full width so it's impossible to miss on phones. */
|
||||
@media (max-width: 767px) {
|
||||
.login-section .wrapper .main .driver-entry {
|
||||
margin-top: 20px;
|
||||
padding: 14px 16px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-section .wrapper .main .driver-entry .driver-login-link {
|
||||
width: 100%;
|
||||
padding: 0 16px;
|
||||
}
|
||||
}
|
||||
/*end login-section*/
|
||||
</style>
|
||||
|
||||
@@ -15,7 +15,11 @@ const FALLBACK_PRODUCT_TITLES = {
|
||||
24: "Spot Free (Lastbil)",
|
||||
25: "Fælg flex pr. enhed",
|
||||
27: "Ekstraordinær pr. 10 min inkl. kemi",
|
||||
26: "Højglans - Voksforsegling pr. enhed",
|
||||
// TRU-130: customer experience series reported that the previous wax product
|
||||
// ("Højglans - Voksforsegling") tested poorly and is being swapped for a
|
||||
// different product. Drop the brand-specific prefix so the tile stays
|
||||
// accurate while the operations team iterates on the next wax supplier.
|
||||
26: "Voksforsegling pr. enhed",
|
||||
21: "Undervognsskyl pr. enhed",
|
||||
22: "Tillæg for Specialsæbe - DD",
|
||||
};
|
||||
|
||||
@@ -1264,14 +1264,19 @@ const createPathEditorQuestion = async () => {
|
||||
await loadPathOutcomes({ force: true });
|
||||
};
|
||||
|
||||
const pathEditorProgramButtonOptions = computed(() => [
|
||||
{ id: 0, value: "0", label: "0 = OFF" },
|
||||
...Array.from({ length: 12 }, (_, index) => ({
|
||||
id: index + 1,
|
||||
value: String(index + 1),
|
||||
label: `Wheel position #${index + 1}`,
|
||||
})),
|
||||
]);
|
||||
const pathEditorProgramButtonOptions = computed(() => {
|
||||
if (!pathEditorMachineIsAvailable.value) {
|
||||
return [{ id: 0, value: "0", label: "0 = OFF" }];
|
||||
}
|
||||
return [
|
||||
{ id: 0, value: "0", label: "0 = OFF" },
|
||||
...Array.from({ length: 12 }, (_, index) => ({
|
||||
id: index + 1,
|
||||
value: String(index + 1),
|
||||
label: `Wheel position #${index + 1}`,
|
||||
})),
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1392,16 +1397,92 @@ const pathVerificationSelectedCaseHasRun = computed(() =>
|
||||
)
|
||||
);
|
||||
|
||||
const pathEditorMachineButtonOptions = computed(() =>
|
||||
Array.from({ length: 12 }, (_, index) => {
|
||||
// TRU-91: Filter path editor machine options to only show enabled/available
|
||||
// machine programs for the current scope. A machine is considered "available"
|
||||
// when the current lane has a machine_type_id that resolves to a non-deleted
|
||||
// selfserve_machine_types row in the lookups.
|
||||
const pathEditorCurrentLaneRow = computed(() => {
|
||||
const laneId = parseIntOrZero(selectedSimulatorLaneId.value);
|
||||
if (laneId <= 0) {
|
||||
return null;
|
||||
}
|
||||
return laneRowById(laneId);
|
||||
});
|
||||
|
||||
const pathEditorCurrentMachineType = computed(() => {
|
||||
const lane = pathEditorCurrentLaneRow.value;
|
||||
if (!lane) {
|
||||
return null;
|
||||
}
|
||||
const machineTypeId = parseNullableInt(lane.machine_type_id);
|
||||
if (!machineTypeId) {
|
||||
return null;
|
||||
}
|
||||
const machineTypeRow = lookupRowById("machine_types", machineTypeId);
|
||||
if (!machineTypeRow) {
|
||||
return null;
|
||||
}
|
||||
if (
|
||||
machineTypeRow.deleted_at !== null &&
|
||||
machineTypeRow.deleted_at !== undefined &&
|
||||
machineTypeRow.deleted_at !== ""
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
return machineTypeRow;
|
||||
});
|
||||
|
||||
const pathEditorMachineIsAvailable = computed(() => Boolean(pathEditorCurrentMachineType.value));
|
||||
|
||||
// TRU-84: Dognvask machine is a single-vehicle-type machine. When the current
|
||||
// lane is configured to use the Dognvask machine, the vehicle type toolbar and
|
||||
// the path editor are restricted to the "traekker" (tractor unit) vehicle type.
|
||||
const pathEditorCurrentMachineTypeName = computed(() => {
|
||||
const machineType = pathEditorCurrentMachineType.value;
|
||||
if (!machineType) {
|
||||
return "";
|
||||
}
|
||||
return String(machineType.name || machineType.label || "").trim().toLowerCase();
|
||||
});
|
||||
|
||||
const pathEditorIsDognvaskMachine = computed(
|
||||
() => pathEditorCurrentMachineTypeName.value === "dognvask"
|
||||
);
|
||||
|
||||
const isTraekkerVehicleType = (vehicleType) => {
|
||||
if (!vehicleType) {
|
||||
return false;
|
||||
}
|
||||
const candidate = String(
|
||||
vehicleType.label || vehicleType.name || vehicleType.vehicleTypeId || ""
|
||||
)
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
return candidate === "traekker" || candidate === "tractor" || candidate === "tractor unit";
|
||||
};
|
||||
|
||||
const pathEditorAllowedVehicleTypes = computed(() => {
|
||||
const rows = lookupRows("vehicle_types");
|
||||
if (!pathEditorIsDognvaskMachine.value) {
|
||||
return rows;
|
||||
}
|
||||
const traekker = rows.filter((row) => isTraekkerVehicleType(row));
|
||||
return traekker;
|
||||
});
|
||||
|
||||
const pathEditorMachineButtonOptions = computed(() => {
|
||||
if (!pathEditorMachineIsAvailable.value) {
|
||||
return [];
|
||||
}
|
||||
return Array.from({ length: 12 }, (_, index) => {
|
||||
const option = taskButtonOptions.find((entry) => entry.id === index);
|
||||
return {
|
||||
id: index,
|
||||
label: option?.description || `Machine button ${index}`,
|
||||
description: option?.name || `Program ${index + 1}`,
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
const pathEditorTaskTitleKeySlug = (key) => String(key || "").replace(/[^a-zA-Z0-9_-]/g, "-");
|
||||
|
||||
@@ -5432,6 +5513,35 @@ watch(
|
||||
scheduleSimulatorRun("scope", 150);
|
||||
}
|
||||
);
|
||||
// TRU-84: Dognvask machines are single-vehicle-type machines. When the
|
||||
// selected lane resolves to a Dognvask machine, force the vehicle type filter
|
||||
// to the traekker option and keep it in sync when the user switches lanes.
|
||||
watch(
|
||||
() => [filters.value.lane_id, pathEditorIsDognvaskMachine.value, pathEditorAllowedVehicleTypes.value],
|
||||
() => {
|
||||
if (!pathEditorIsDognvaskMachine.value) {
|
||||
return;
|
||||
}
|
||||
const allowed = pathEditorAllowedVehicleTypes.value;
|
||||
if (allowed.length === 0) {
|
||||
if (filters.value.vehicle_type_id !== "") {
|
||||
filters.value = { ...filters.value, vehicle_type_id: "" };
|
||||
}
|
||||
return;
|
||||
}
|
||||
const allowedIds = new Set(
|
||||
allowed.map((row) => String(vehicleTypeFilterValue(row)))
|
||||
);
|
||||
const current = String(filters.value.vehicle_type_id ?? "");
|
||||
if (!allowedIds.has(current)) {
|
||||
filters.value = {
|
||||
...filters.value,
|
||||
vehicle_type_id: String(vehicleTypeFilterValue(allowed[0])),
|
||||
};
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
watch(simulatorDynamicImageUrl, () => {
|
||||
simulatorDynamicImageHidden.value = false;
|
||||
simulatorDynamicImageError.value = "";
|
||||
@@ -5637,10 +5747,19 @@ onBeforeUnmount(() => {
|
||||
|
||||
<section class="studio-scope-guide-column">
|
||||
<span class="studio-scope-guide-step">2</span>
|
||||
<h3>Vehicle type</h3>
|
||||
<h3>
|
||||
Vehicle type
|
||||
<span
|
||||
v-if="pathEditorIsDognvaskMachine"
|
||||
class="tag is-info is-light is-small studio-scope-guide-constraint"
|
||||
data-testid="studio-scope-guide-dognvask-hint"
|
||||
>
|
||||
Dognvask: trækker only
|
||||
</span>
|
||||
</h3>
|
||||
<div class="studio-scope-option-list">
|
||||
<button
|
||||
v-for="vehicleType in lookupRows('vehicle_types')"
|
||||
v-for="vehicleType in pathEditorAllowedVehicleTypes"
|
||||
:key="vehicleType.id"
|
||||
type="button"
|
||||
class="studio-scope-option"
|
||||
@@ -5657,7 +5776,7 @@ onBeforeUnmount(() => {
|
||||
<small>#{{ vehicleTypeFilterValue(vehicleType) }}</small>
|
||||
</span>
|
||||
</button>
|
||||
<p v-if="lookupRows('vehicle_types').length === 0" class="studio-empty-inline">
|
||||
<p v-if="pathEditorAllowedVehicleTypes.length === 0" class="studio-empty-inline">
|
||||
No vehicle types are configured.
|
||||
</p>
|
||||
</div>
|
||||
@@ -7149,13 +7268,20 @@ onBeforeUnmount(() => {
|
||||
<select v-model="filters.vehicle_type_id" data-testid="studio-filter-vehicle-type">
|
||||
<option value="" disabled>Select vehicle type</option>
|
||||
<option
|
||||
v-for="vehicleType in lookupRows('vehicle_types')"
|
||||
v-for="vehicleType in pathEditorAllowedVehicleTypes"
|
||||
:key="vehicleType.id"
|
||||
:value="vehicleTypeFilterValue(vehicleType)"
|
||||
>
|
||||
{{ vehicleType.label }}
|
||||
</option>
|
||||
</select>
|
||||
<span
|
||||
v-if="pathEditorIsDognvaskMachine"
|
||||
class="tag is-info is-light is-small studio-scope-dognvask-hint"
|
||||
data-testid="studio-filter-dognvask-hint"
|
||||
>
|
||||
Dognvask: trækker only
|
||||
</span>
|
||||
</div>
|
||||
<div class="select is-small">
|
||||
<select v-model="filters.machine_type_id" data-testid="studio-filter-machine-type">
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
<script setup>
|
||||
import { onMounted, ref, computed } from "vue";
|
||||
import Swal from "sweetalert2";
|
||||
import UserDashboardPageWrapper from "@/views/dashboards/userDashboard/UserDashboardPageWrapper.vue";
|
||||
import { SessionUser } from "@/components/session/token/SessionUser.vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
/**
|
||||
* Permission groups (5 toggles) that mirror the existing 5 capability groups
|
||||
* in modules/subusers/classes/subuser_permission_templates_service.php.
|
||||
* They cover the 5 main areas a customer wants to grant their drivers:
|
||||
* - vehicles (Køretøjer)
|
||||
* - selfserve (Døgnvask)
|
||||
* - bookings (Bookinger)
|
||||
* - orders (Ordrer)
|
||||
* - driver_management (Chaufførstyring)
|
||||
*/
|
||||
const PERMISSION_GROUPS = [
|
||||
{ key: "vehicles", capabilities: ["VEHICLES_LIST", "VEHICLES_EDIT", "VEHICLES_DELETE", "VEHICLES_ADD"] },
|
||||
{ key: "selfserve", capabilities: ["SELFSERVE_LIST", "SELFSERVE_EDIT", "SELFSERVE_DELETE", "SELFSERVE_ADD"] },
|
||||
{ key: "bookings", capabilities: ["BOOKINGS_LIST", "BOOKINGS_EDIT", "BOOKINGS_DELETE", "BOOKINGS_ADD"] },
|
||||
{ key: "orders", capabilities: ["ORDERS_LIST", "ORDERS_EDIT"] },
|
||||
{ key: "driver_management", capabilities: ["SUBUSERS_LIST", "SUBUSERS_EDIT", "SUBUSERS_DELETE", "SUBUSERS_ADD"] },
|
||||
];
|
||||
|
||||
/**
|
||||
* The two primary roles (templates) shown to the customer in the kunde portal
|
||||
* "tilladelser" tab. The customer picks one as the default for new drivers
|
||||
* created through the QR flow (see TRU-88 / TRU-90).
|
||||
*
|
||||
* - chauffeur (driver) : standard self-serve + bookings
|
||||
* - booking_coordinator : extended bookings/orders (no self-serve)
|
||||
*/
|
||||
const PRIMARY_ROLE_KEYS = ["driver", "booking_coordinator"];
|
||||
|
||||
const isLoading = ref(true);
|
||||
const isSaving = ref(false);
|
||||
const accessModel = ref({ templates: [], groups: [] });
|
||||
const selectedTemplateKey = ref(null);
|
||||
|
||||
const selectedTemplate = computed(() => {
|
||||
if (!selectedTemplateKey.value) {
|
||||
return null;
|
||||
}
|
||||
return accessModel.value.templates.find((template) => template.key === selectedTemplateKey.value) || null;
|
||||
});
|
||||
|
||||
const isGroupActive = (groupKey) => {
|
||||
if (!selectedTemplate.value) {
|
||||
return false;
|
||||
}
|
||||
const groups = selectedTemplate.value.permission_groups || [];
|
||||
return groups.some((group) => group.key === groupKey);
|
||||
};
|
||||
|
||||
const isGroupFullyActive = (groupKey) => {
|
||||
if (!selectedTemplate.value) {
|
||||
return false;
|
||||
}
|
||||
const groups = selectedTemplate.value.permission_groups || [];
|
||||
const group = groups.find((g) => g.key === groupKey);
|
||||
if (!group) {
|
||||
return false;
|
||||
}
|
||||
// "Fully active" means all 4 capabilities in the group are granted
|
||||
const groupDefinition = PERMISSION_GROUPS.find((g) => g.key === groupKey);
|
||||
if (!groupDefinition) {
|
||||
return false;
|
||||
}
|
||||
return groupDefinition.capabilities.every((capability) => group.capabilities.includes(capability));
|
||||
};
|
||||
|
||||
const isGroupPartiallyActive = (groupKey) => {
|
||||
if (!selectedTemplate.value) {
|
||||
return false;
|
||||
}
|
||||
return isGroupActive(groupKey) && !isGroupFullyActive(groupKey);
|
||||
};
|
||||
|
||||
const isPrimaryRole = (key) => PRIMARY_ROLE_KEYS.includes(key);
|
||||
|
||||
const loadAccessModel = async () => {
|
||||
isLoading.value = true;
|
||||
try {
|
||||
const model = await SessionUser.objects.subuser_grants.functions.getPermissionTemplates();
|
||||
const payload = model?.data?.data || model?.data || model;
|
||||
accessModel.value = {
|
||||
templates: Array.isArray(payload?.templates) ? payload.templates : [],
|
||||
groups: Array.isArray(payload?.groups) ? payload.groups : [],
|
||||
};
|
||||
|
||||
// Read the customer's stored default template via SessionUser / API
|
||||
const stored = await SessionUser.request("/customer/default-driver-template", "GET")
|
||||
.then((response) => response?.data?.data?.template_key || response?.data?.template_key || null)
|
||||
.catch(() => null);
|
||||
|
||||
if (stored && accessModel.value.templates.some((template) => template.key === stored)) {
|
||||
selectedTemplateKey.value = stored;
|
||||
} else {
|
||||
const chauffeur = accessModel.value.templates.find((template) => template.key === "driver");
|
||||
selectedTemplateKey.value = chauffeur?.key || accessModel.value.templates[0]?.key || null;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to load permission templates:", error);
|
||||
accessModel.value = { templates: [], groups: [] };
|
||||
await Swal.fire({
|
||||
title: t("common.error"),
|
||||
text: error?.message || t("user_dashboard.permissions.save_error"),
|
||||
icon: "error",
|
||||
});
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const onSelectTemplate = (key) => {
|
||||
if (!accessModel.value.templates.some((template) => template.key === key)) {
|
||||
return;
|
||||
}
|
||||
selectedTemplateKey.value = key;
|
||||
};
|
||||
|
||||
const onSaveDefault = async () => {
|
||||
if (!selectedTemplateKey.value || isSaving.value) {
|
||||
return;
|
||||
}
|
||||
isSaving.value = true;
|
||||
try {
|
||||
await SessionUser.request("/customer/default-driver-template", "PUT", {
|
||||
template_key: selectedTemplateKey.value,
|
||||
});
|
||||
await Swal.fire({
|
||||
title: t("user_dashboard.permissions.saved"),
|
||||
icon: "success",
|
||||
timer: 1500,
|
||||
showConfirmButton: false,
|
||||
});
|
||||
} catch (error) {
|
||||
await Swal.fire({
|
||||
title: t("common.error"),
|
||||
text: SessionUser.functions.parseErrorMessage(error) || t("user_dashboard.permissions.save_error"),
|
||||
icon: "error",
|
||||
});
|
||||
} finally {
|
||||
isSaving.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(loadAccessModel);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UserDashboardPageWrapper
|
||||
:title="$t('user_dashboard.permissions.title')"
|
||||
:subtitle="$t('user_dashboard.permissions.subtitle')"
|
||||
>
|
||||
<div v-if="isLoading" class="notification is-light">
|
||||
{{ $t("user_dashboard.permissions.loading") }}
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div class="permissions-tab" data-testid="user-permissions-tab">
|
||||
<p class="block has-text-grey">
|
||||
{{ $t("user_dashboard.permissions.card_intro") }}
|
||||
</p>
|
||||
|
||||
<div class="columns is-multiline" data-testid="user-permissions-roles">
|
||||
<div
|
||||
v-for="template in accessModel.templates.filter((tpl) => isPrimaryRole(tpl.key))"
|
||||
:key="template.key"
|
||||
class="column is-half"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="permission-role-card"
|
||||
:class="{ 'permission-role-card--selected': selectedTemplateKey === template.key }"
|
||||
:data-testid="`user-permission-role-${template.key}`"
|
||||
@click="onSelectTemplate(template.key)"
|
||||
>
|
||||
<span class="permission-role-card__title">
|
||||
{{
|
||||
template.key === "driver"
|
||||
? $t("user_dashboard.permissions.card_chauffor_label")
|
||||
: $t("user_dashboard.permissions.card_booking_label")
|
||||
}}
|
||||
</span>
|
||||
<span class="permission-role-card__description">
|
||||
{{
|
||||
template.key === "driver"
|
||||
? $t("user_dashboard.permissions.card_chauffor_description")
|
||||
: $t("user_dashboard.permissions.card_booking_description")
|
||||
}}
|
||||
</span>
|
||||
<span
|
||||
v-if="selectedTemplateKey === template.key"
|
||||
class="tag is-success is-light mt-2"
|
||||
:data-testid="`user-permission-role-selected-${template.key}`"
|
||||
>
|
||||
{{ $t("user_dashboard.permissions.selected_template", { label: template.label }) }}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="permissions-tab__toggles" data-testid="user-permissions-toggles">
|
||||
<h3 class="title is-6 mb-2">
|
||||
<span class="icon"><i class="fas fa-sliders-h"></i></span>
|
||||
<span>{{ $t("user_dashboard.permissions.toggle_description") }}</span>
|
||||
</h3>
|
||||
<div class="columns is-multiline">
|
||||
<div
|
||||
v-for="group in PERMISSION_GROUPS"
|
||||
:key="group.key"
|
||||
class="column is-half"
|
||||
>
|
||||
<div
|
||||
class="permission-toggle box"
|
||||
:class="{
|
||||
'permission-toggle--active': isGroupFullyActive(group.key),
|
||||
'permission-toggle--partial': isGroupPartiallyActive(group.key),
|
||||
}"
|
||||
:data-testid="`user-permission-toggle-${group.key}`"
|
||||
>
|
||||
<div class="level is-mobile mb-0">
|
||||
<div class="level-left">
|
||||
<div class="level-item">
|
||||
<div>
|
||||
<p class="permission-toggle__label">
|
||||
{{ $t(`user_dashboard.permissions.groups.${group.key}`) }}
|
||||
</p>
|
||||
<p class="help has-text-grey">
|
||||
{{ group.capabilities.length }} rettigheder
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-right">
|
||||
<div class="level-item">
|
||||
<b-switch
|
||||
:model-value="isGroupFullyActive(group.key) || isGroupPartiallyActive(group.key)"
|
||||
disabled
|
||||
size="is-small"
|
||||
type="is-success"
|
||||
:data-testid="`user-permission-toggle-switch-${group.key}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="permissions-tab__actions mt-4">
|
||||
<button
|
||||
class="button is-link"
|
||||
:class="{ 'is-loading': isSaving }"
|
||||
:disabled="!selectedTemplateKey || isSaving"
|
||||
data-testid="user-permissions-save"
|
||||
@click="onSaveDefault"
|
||||
>
|
||||
<span class="icon"><i class="fas fa-save"></i></span>
|
||||
<span>{{ $t("user_dashboard.permissions.save") }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</UserDashboardPageWrapper>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.permissions-tab .permission-role-card {
|
||||
align-items: flex-start;
|
||||
background: #fff;
|
||||
border: 1px solid #dbdbdb;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
min-height: 150px;
|
||||
padding: 1.25rem;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-role-card:hover,
|
||||
.permissions-tab .permission-role-card--selected {
|
||||
border-color: #3273dc;
|
||||
box-shadow: 0 0 0 1px #3273dc;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-role-card__title {
|
||||
color: #1f2933;
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-role-card__description {
|
||||
color: #4a4a4a;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-toggle {
|
||||
border: 1px solid #e6ebf1;
|
||||
border-radius: 6px;
|
||||
padding: 0.85rem 1rem;
|
||||
background: #fafbfc;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-toggle--active {
|
||||
background: #f1faf3;
|
||||
border-color: #48c78e;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-toggle--partial {
|
||||
background: #fff8e1;
|
||||
border-color: #ffe08a;
|
||||
}
|
||||
|
||||
.permissions-tab .permission-toggle__label {
|
||||
font-weight: 600;
|
||||
color: #1f2933;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -64,7 +64,7 @@ const buildOverviewPayload = ({
|
||||
{
|
||||
product_id: 26,
|
||||
slug: "hoejglans",
|
||||
title: "Højglans - Voksforsegling pr. enhed",
|
||||
title: "Voksforsegling pr. enhed",
|
||||
state: "ready",
|
||||
value: 4,
|
||||
out_of: 8,
|
||||
@@ -268,7 +268,7 @@ test.describe("Admin daily report", () => {
|
||||
await expect(page.getByTestId("daily-report-tile-extraordinary-10-min")).toContainText(
|
||||
"Ekstraordinær pr. 10 min inkl. kemi"
|
||||
);
|
||||
await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Højglans - Voksforsegling pr. enhed");
|
||||
await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Voksforsegling pr. enhed");
|
||||
await expect(page.getByTestId("daily-report-tile-undervognsskyl")).toContainText("Undervognsskyl pr. enhed");
|
||||
await expect(page.getByTestId("daily-report-tile-double-duty-kemi")).toContainText("Tillæg for Specialsæbe - DD");
|
||||
});
|
||||
@@ -667,7 +667,7 @@ test.describe("Admin daily report", () => {
|
||||
await expect(page.getByTestId("daily-report-tile-extraordinary-10-min")).toContainText(
|
||||
"Ekstraordinær pr. 10 min inkl. kemi"
|
||||
);
|
||||
await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Højglans - Voksforsegling pr. enhed");
|
||||
await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Voksforsegling pr. enhed");
|
||||
await expect(page.getByTestId("daily-report-tile-undervognsskyl")).toContainText("Undervognsskyl pr. enhed");
|
||||
await expect(page.getByTestId("daily-report-tile-double-duty-kemi")).toContainText("Tillæg for Specialsæbe - DD");
|
||||
});
|
||||
|
||||
@@ -106,6 +106,26 @@ describe("DepartmentDashboardDailyReportProductSales behavior", () => {
|
||||
expect(missingTileWrapper.text()).toContain("Tillæg for Specialsæbe - DD");
|
||||
});
|
||||
|
||||
it("falls back to a brand-agnostic wax title for product 26 (TRU-130)", () => {
|
||||
// TRU-130: the previous wax product ("Højglans - Voksforsegling") tested
|
||||
// poorly in the field and is being replaced. The fallback title should
|
||||
// therefore stay brand-agnostic so the tile keeps matching whatever
|
||||
// wax product the API eventually reports.
|
||||
dailyReportProductsState.value = {};
|
||||
|
||||
const waxWrapper = mount(DepartmentDashboardDailyReportProductSales, {
|
||||
props: {
|
||||
product_id: 26,
|
||||
subtitle: "Dagens salg af produktet",
|
||||
dataTestid: "daily-report-tile-hoejglans",
|
||||
},
|
||||
});
|
||||
|
||||
const rendered = waxWrapper.text();
|
||||
expect(rendered).toContain("Voksforsegling pr. enhed");
|
||||
expect(rendered).not.toContain("Højglans");
|
||||
});
|
||||
|
||||
it("shows a saved target percentage below the product percentage", () => {
|
||||
dailyReportProductsState.value = {
|
||||
24: {
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { defineComponent, h, nextTick } from "vue";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
hasStoredSessionToken: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@/services/sessionStorage.js", () => ({
|
||||
hasStoredSessionToken: mocks.hasStoredSessionToken,
|
||||
}));
|
||||
|
||||
vi.mock("@/composables/useStoredSessionGuestRedirect.js", () => ({
|
||||
useStoredSessionGuestRedirect: () => ({
|
||||
hasPendingStoredSession: mocks.hasStoredSessionToken(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock("@/components/forms/auth/LoginForm.vue", () => ({
|
||||
default: defineComponent({
|
||||
name: "MockLoginForm",
|
||||
setup() {
|
||||
return () => h("form", { "data-testid": "login-form" });
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock("@/views/errors/ConnectivityIssue.vue", () => ({
|
||||
default: defineComponent({
|
||||
name: "MockConnectivityIssue",
|
||||
setup(_, { slots }) {
|
||||
return () => h("div", { "data-testid": "connectivity-wrapper" }, slots.default?.());
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock("@/components/global/BrandedLoadingScreen.vue", () => ({
|
||||
default: defineComponent({
|
||||
name: "MockBrandedLoadingScreen",
|
||||
props: {
|
||||
testId: { type: String, default: "branded-loading-screen" },
|
||||
},
|
||||
setup(props) {
|
||||
return () => h("div", { "data-testid": props.testId });
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
import Login from "@/views/auth/Login.vue";
|
||||
|
||||
const routerLinkStub = defineComponent({
|
||||
name: "RouterLinkStub",
|
||||
props: {
|
||||
to: {
|
||||
type: [String, Object],
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
setup(_, { slots, attrs }) {
|
||||
return () => h("a", attrs, slots.default?.());
|
||||
},
|
||||
});
|
||||
|
||||
const mountLogin = () =>
|
||||
mount(Login, {
|
||||
global: {
|
||||
mocks: {
|
||||
$t: (key) => key,
|
||||
},
|
||||
stubs: {
|
||||
RouterLink: routerLinkStub,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
describe("Login.vue — driver entry block (TRU-61)", () => {
|
||||
beforeEach(() => {
|
||||
mocks.hasStoredSessionToken.mockReset();
|
||||
mocks.hasStoredSessionToken.mockReturnValue(false);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
document.body.innerHTML = "";
|
||||
});
|
||||
|
||||
it("renders the page-level driver entry block on the customer login page", async () => {
|
||||
const wrapper = mountLogin();
|
||||
await nextTick();
|
||||
|
||||
const entry = wrapper.find('[data-testid="login-driver-entry"]');
|
||||
expect(entry.exists()).toBe(true);
|
||||
});
|
||||
|
||||
it("renders a router-link to the subuser login route inside the driver entry block", async () => {
|
||||
const wrapper = mountLogin();
|
||||
await nextTick();
|
||||
|
||||
const link = wrapper.find('[data-testid="login-driver-login-link"]');
|
||||
expect(link.exists()).toBe(true);
|
||||
});
|
||||
|
||||
it("renders the driver login button with the localized driver_login_button label", async () => {
|
||||
const wrapper = mountLogin();
|
||||
await nextTick();
|
||||
|
||||
const link = wrapper.find('[data-testid="login-driver-login-link"]');
|
||||
expect(link.text()).toContain("auth.driver_login_button");
|
||||
});
|
||||
|
||||
it("renders the driver login help text inside the entry block", async () => {
|
||||
const wrapper = mountLogin();
|
||||
await nextTick();
|
||||
|
||||
const entry = wrapper.find('[data-testid="login-driver-entry"]');
|
||||
expect(entry.text()).toContain("auth.driver_login_help");
|
||||
});
|
||||
|
||||
it("places the driver entry block in the main content area (not the sidebar)", async () => {
|
||||
const wrapper = mountLogin();
|
||||
await nextTick();
|
||||
|
||||
// The sidebar should NOT contain the driver entry — it must be in main
|
||||
const html = wrapper.html();
|
||||
const entryHtml = wrapper.find('[data-testid="login-driver-entry"]').html();
|
||||
// Find the sidebar's outer container and ensure the entry is not inside it
|
||||
const sidebarMatch = html.match(/<div class="sidebar">[\s\S]*?<\/div>\s*<div class="main">/);
|
||||
if (sidebarMatch) {
|
||||
expect(sidebarMatch[0]).not.toContain("login-driver-entry");
|
||||
}
|
||||
expect(entryHtml).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,81 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const readSource = (relativePath) => readFileSync(join(process.cwd(), relativePath), "utf8");
|
||||
|
||||
describe("self-serve studio Dognvask single vehicle type (TRU-84)", () => {
|
||||
const studioSource = () =>
|
||||
readSource("src/views/dashboards/departmentDashboard/modules/self-serve/DepartmentSelfServeStudio.vue");
|
||||
|
||||
it("defines a Dognvask detection helper tied to the current lane machine type", () => {
|
||||
const source = studioSource();
|
||||
|
||||
expect(source).toContain("pathEditorCurrentMachineTypeName");
|
||||
expect(source).toContain("pathEditorIsDognvaskMachine");
|
||||
expect(source).toContain('pathEditorCurrentMachineTypeName.value === "dognvask"');
|
||||
});
|
||||
|
||||
it("provides a path editor allowed vehicle types list that filters to traekker for Dognvask", () => {
|
||||
const source = studioSource();
|
||||
|
||||
expect(source).toContain("pathEditorAllowedVehicleTypes");
|
||||
expect(source).toContain("isTraekkerVehicleType");
|
||||
expect(source).toMatch(
|
||||
/pathEditorAllowedVehicleTypes[\s\S]{0,400}if\s*\(\s*!pathEditorIsDognvaskMachine\.value\s*\)\s*\{\s*return\s+rows;\s*\}/
|
||||
);
|
||||
expect(source).toMatch(
|
||||
/pathEditorAllowedVehicleTypes[\s\S]{0,800}const\s+traekker\s*=\s*rows\.filter\(\(row\)\s*=>\s*isTraekkerVehicleType\(row\)\);/
|
||||
);
|
||||
});
|
||||
|
||||
it("recognises traekker/tractor/tractor unit as the Dognvask vehicle type", () => {
|
||||
const source = studioSource();
|
||||
|
||||
expect(source).toMatch(
|
||||
/isTraekkerVehicleType[\s\S]{0,400}return\s+candidate\s*===\s*"traekker"\s*\|\|\s*candidate\s*===\s*"tractor"\s*\|\|\s*candidate\s*===\s*"tractor unit";/
|
||||
);
|
||||
});
|
||||
|
||||
it("uses the allowed vehicle types list in the toolbar filter", () => {
|
||||
const source = studioSource();
|
||||
|
||||
// Toolbar select sits above the v-for option; assert the data-testid and the v-for coexist.
|
||||
const toolbarIndex = source.indexOf('data-testid="studio-filter-vehicle-type"');
|
||||
expect(toolbarIndex).toBeGreaterThanOrEqual(0);
|
||||
const toolbarSection = source.slice(toolbarIndex, toolbarIndex + 400);
|
||||
expect(toolbarSection).toContain("v-for=\"vehicleType in pathEditorAllowedVehicleTypes\"");
|
||||
});
|
||||
|
||||
it("uses the allowed vehicle types list in the scope guide", () => {
|
||||
const source = studioSource();
|
||||
|
||||
// Scope guide uses :data-testid="`studio-scope-option-vehicle-${...}`" with v-for before it.
|
||||
const scopeGuideIndex = source.indexOf("studio-scope-option-vehicle-${");
|
||||
expect(scopeGuideIndex).toBeGreaterThanOrEqual(0);
|
||||
const scopeGuideSection = source.slice(Math.max(0, scopeGuideIndex - 800), scopeGuideIndex);
|
||||
expect(scopeGuideSection).toContain("v-for=\"vehicleType in pathEditorAllowedVehicleTypes\"");
|
||||
});
|
||||
|
||||
it("auto-corrects the vehicle type filter when the current machine is Dognvask", () => {
|
||||
const source = studioSource();
|
||||
|
||||
expect(source).toContain(
|
||||
"() => [filters.value.lane_id, pathEditorIsDognvaskMachine.value, pathEditorAllowedVehicleTypes.value]"
|
||||
);
|
||||
expect(source).toMatch(
|
||||
/if\s*\(\s*!pathEditorIsDognvaskMachine\.value\s*\)\s*\{\s*return;\s*\}/
|
||||
);
|
||||
expect(source).toContain('filters.value = { ...filters.value, vehicle_type_id: "" }');
|
||||
expect(source).toMatch(
|
||||
/filters\.value\s*=\s*\{[\s\S]{0,200}vehicle_type_id:\s*String\(vehicleTypeFilterValue\(allowed\[0\]\)\)/
|
||||
);
|
||||
});
|
||||
|
||||
it("shows a visible Dognvask hint badge in the toolbar and scope guide", () => {
|
||||
const source = studioSource();
|
||||
|
||||
expect(source).toContain('data-testid="studio-filter-dognvask-hint"');
|
||||
expect(source).toContain('data-testid="studio-scope-guide-dognvask-hint"');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const readSource = (relativePath) => readFileSync(join(process.cwd(), relativePath), "utf8");
|
||||
|
||||
describe("self-serve studio path editor machine filter (TRU-91)", () => {
|
||||
const studioSource = readSource(
|
||||
"src/views/dashboards/departmentDashboard/modules/self-serve/DepartmentSelfServeStudio.vue"
|
||||
);
|
||||
|
||||
it("defines a path editor machine-availability check tied to the current lane and machine type", () => {
|
||||
expect(studioSource).toContain("pathEditorCurrentLaneRow");
|
||||
expect(studioSource).toContain("pathEditorCurrentMachineType");
|
||||
expect(studioSource).toContain("pathEditorMachineIsAvailable");
|
||||
});
|
||||
|
||||
it("returns an empty machine button list when the machine is not available", () => {
|
||||
expect(studioSource).toMatch(
|
||||
/pathEditorMachineButtonOptions[\s\S]{0,400}if\s*\(\s*!pathEditorMachineIsAvailable\.value\s*\)\s*\{\s*return\s*\[\s*\]\s*;\s*\}/
|
||||
);
|
||||
});
|
||||
|
||||
it("limits program wheel options to the OFF position when the machine is not available", () => {
|
||||
expect(studioSource).toMatch(
|
||||
/pathEditorProgramButtonOptions[\s\S]{0,600}if\s*\(\s*!pathEditorMachineIsAvailable\.value\s*\)[\s\S]{0,200}return\s*\[\s*\{\s*id:\s*0,\s*value:\s*"0",\s*label:\s*"0 = OFF"\s*\}\s*\]/
|
||||
);
|
||||
});
|
||||
|
||||
it("considers a machine type deleted when its deleted_at is set", () => {
|
||||
expect(studioSource).toMatch(/machineTypeRow\.deleted_at[\s\S]{0,80}return\s+null/);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const SCRIPT_PATH = path.resolve("scripts/smoke-test-sergii.sh");
|
||||
const WORKFLOW_PATH = path.resolve(".github/workflows/deploy.yml");
|
||||
const EXISTING_SMOKE_PATH = path.resolve("scripts/smoke-test.sh");
|
||||
|
||||
describe("Sergii Review Batch smoke test (TRU-96)", () => {
|
||||
it("ships a Sergii-specific smoke test script with executable bits set", () => {
|
||||
expect(fs.existsSync(SCRIPT_PATH)).toBe(true);
|
||||
const stat = fs.statSync(SCRIPT_PATH);
|
||||
// owner-execute bit (0o100) is what `chmod +x` sets; we don't care about
|
||||
// the user the test runs as, just that the file is marked executable.
|
||||
expect(stat.mode & 0o111).not.toBe(0);
|
||||
});
|
||||
|
||||
it("covers every Sergii Review Batch project issue (TRU-68, TRU-72, TRU-75)", () => {
|
||||
const contents = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
// TRU-68: customer email flow
|
||||
expect(contents).toContain("TRU-68");
|
||||
expect(contents).toMatch(/customer email flow/i);
|
||||
// TRU-72: pages 6-10 review
|
||||
expect(contents).toContain("TRU-72");
|
||||
expect(contents).toMatch(/pages 6-10/);
|
||||
// TRU-75: UVS option
|
||||
expect(contents).toContain("TRU-75");
|
||||
expect(contents).toMatch(/UVS/);
|
||||
});
|
||||
|
||||
it("probes the Sergii-touch surfaces that the Sergii batch changed (pages 6-10)", () => {
|
||||
const contents = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
// Pages 6-10 — Sergii's batch touched customer, product, order, booking, invoicing.
|
||||
expect(contents).toMatch(/\/admin\/customer/);
|
||||
expect(contents).toMatch(/\/admin\/product/);
|
||||
expect(contents).toMatch(/\/admin\/order/);
|
||||
expect(contents).toMatch(/\/admin\/booking/);
|
||||
expect(contents).toMatch(/\/admin\/invoicing/);
|
||||
});
|
||||
|
||||
it("probes the Sergii-touch customer email flow surfaces (TRU-68)", () => {
|
||||
const contents = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
expect(contents).toMatch(/\/api\/customer/);
|
||||
expect(contents).toMatch(/\/kundeoprettelse/);
|
||||
});
|
||||
|
||||
it("probes the Sergii-touch UVS self-serve surfaces (TRU-75)", () => {
|
||||
const contents = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
expect(contents).toMatch(/\/self-serve\/program/);
|
||||
expect(contents).toMatch(/\/self-serve\/vehicle/);
|
||||
});
|
||||
|
||||
it("is wired into the pleno-vue deploy workflow alongside the generic smoke test", () => {
|
||||
const workflow = fs.readFileSync(WORKFLOW_PATH, "utf8");
|
||||
expect(workflow).toMatch(/smoke-test-sergii\.sh/);
|
||||
expect(workflow).toMatch(/Sergii Review Batch smoke test \(TRU-96\)/);
|
||||
// Generic smoke test still runs first.
|
||||
expect(workflow).toMatch(/smoke-test\.sh "\$SMOKE_BASE_URL"/);
|
||||
// Auto-rollback now also triggers on Sergii smoke failure.
|
||||
expect(workflow).toMatch(/steps\.smoke\.outcome == 'failure' \|\| steps\.smoke_sergii\.outcome == 'failure'/);
|
||||
// Slack status message distinguishes the two failure modes.
|
||||
expect(workflow).toMatch(/Generic smoke FAILED/);
|
||||
expect(workflow).toMatch(/Sergii Review Batch smoke FAILED/);
|
||||
});
|
||||
|
||||
it("does not duplicate the generic smoke test (it complements, not replaces)", () => {
|
||||
expect(fs.existsSync(EXISTING_SMOKE_PATH)).toBe(true);
|
||||
const generic = fs.readFileSync(EXISTING_SMOKE_PATH, "utf8");
|
||||
const sergii = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
// Generic covers login + /api/ping + /healthz; Sergii covers the Sergii
|
||||
// Review Batch surfaces. They are intentionally different sets.
|
||||
expect(generic).toMatch(/\/login/);
|
||||
expect(sergii).toMatch(/\/admin\/customer/);
|
||||
});
|
||||
|
||||
it("exits non-zero when any Sergii-touch surface fails, so auto-rollback can fire", () => {
|
||||
const contents = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
expect(contents).toMatch(/FAIL=1/);
|
||||
expect(contents).toMatch(/exit 1/);
|
||||
expect(contents).toMatch(/Sergii Review Batch smoke test FAILED/);
|
||||
});
|
||||
|
||||
it("defaults to https://staging.truckwash.io so it is safe to run unattended", () => {
|
||||
const contents = fs.readFileSync(SCRIPT_PATH, "utf8");
|
||||
expect(contents).toMatch(/SMOKE_BASE_URL:-\$\{1:-https:\/\/staging\.truckwash\.io\}/);
|
||||
});
|
||||
});
|
||||