feat/calculator-options #26

Merged
JoeKung merged 17 commits from feat/calculator-options into dev 2026-03-05 20:50:33 +01:00
4 changed files with 79 additions and 25 deletions
Showing only changes of commit 8a57aa78fb - Show all commits

View File

@@ -41,25 +41,38 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "frontend/package-lock.json" cache-dependency-path: "frontend/package-lock.json"
- name: Install Chromium - name: Resolve Chrome binary
shell: bash shell: bash
run: | run: |
apt-get update set -euo pipefail
apt-get install -y --no-install-recommends chromium if command -v chromium >/dev/null 2>&1; then
CHROME_PATH="$(command -v chromium)"
elif command -v chromium-browser >/dev/null 2>&1; then
CHROME_PATH="$(command -v chromium-browser)"
elif command -v google-chrome >/dev/null 2>&1; then
CHROME_PATH="$(command -v google-chrome)"
else
apt-get update
apt-get install -y --no-install-recommends chromium
CHROME_PATH="$(command -v chromium)"
fi
echo "CHROME_BIN=$CHROME_PATH" >> "$GITHUB_ENV"
echo "Using CHROME_BIN=$CHROME_PATH"
- name: Install frontend dependencies - name: Install frontend dependencies
shell: bash shell: bash
run: | run: |
cd frontend cd frontend
npm ci --no-audit --no-fund npm ci --no-audit --no-fund --prefer-offline
- name: Run frontend tests (headless) - name: Run frontend tests (headless)
shell: bash shell: bash
env: env:
CHROME_BIN: /usr/bin/chromium
CI: "true" CI: "true"
run: | run: |
cd frontend cd frontend
echo "Karma CHROME_BIN=$CHROME_BIN"
npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox
build-and-push: build-and-push:

View File

@@ -150,23 +150,36 @@ jobs:
cache: "npm" cache: "npm"
cache-dependency-path: "frontend/package-lock.json" cache-dependency-path: "frontend/package-lock.json"
- name: Install Chromium - name: Resolve Chrome binary
shell: bash shell: bash
run: | run: |
apt-get update set -euo pipefail
apt-get install -y --no-install-recommends chromium if command -v chromium >/dev/null 2>&1; then
CHROME_PATH="$(command -v chromium)"
elif command -v chromium-browser >/dev/null 2>&1; then
CHROME_PATH="$(command -v chromium-browser)"
elif command -v google-chrome >/dev/null 2>&1; then
CHROME_PATH="$(command -v google-chrome)"
else
apt-get update
apt-get install -y --no-install-recommends chromium
CHROME_PATH="$(command -v chromium)"
fi
echo "CHROME_BIN=$CHROME_PATH" >> "$GITHUB_ENV"
echo "Using CHROME_BIN=$CHROME_PATH"
- name: Install frontend dependencies - name: Install frontend dependencies
shell: bash shell: bash
run: | run: |
cd frontend cd frontend
npm ci --no-audit --no-fund npm ci --no-audit --no-fund --prefer-offline
- name: Run frontend tests (headless) - name: Run frontend tests (headless)
shell: bash shell: bash
env: env:
CHROME_BIN: /usr/bin/chromium
CI: "true" CI: "true"
run: | run: |
cd frontend cd frontend
echo "Karma CHROME_BIN=$CHROME_BIN"
npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox

View File

@@ -96,18 +96,22 @@
</div> </div>
<div class="actions"> <div class="actions">
<app-button variant="outline" (click)="consult.emit()"> <div class="actions-left">
{{ "QUOTE.CONSULT" | translate }} <app-button variant="outline" (click)="consult.emit()">
</app-button> {{ "QUOTE.CONSULT" | translate }}
@if (!hasQuantityOverLimit()) {
<app-button (click)="proceed.emit()">
{{ "QUOTE.PROCEED_ORDER" | translate }}
</app-button> </app-button>
} @else { </div>
<small class="limit-note">{{
"QUOTE.MAX_QTY_NOTICE" | translate: { max: directOrderLimit } <div class="actions-right">
}}</small> @if (!hasQuantityOverLimit()) {
} <app-button (click)="proceed.emit()">
{{ "QUOTE.PROCEED_ORDER" | translate }}
</app-button>
} @else {
<small class="limit-note">{{
"QUOTE.MAX_QTY_NOTICE" | translate: { max: directOrderLimit }
}}</small>
}
</div>
</div> </div>
</app-card> </app-card>

View File

@@ -126,15 +126,39 @@
.actions { .actions {
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
align-items: center;
gap: var(--space-3); gap: var(--space-3);
margin-top: var(--space-2);
@media (max-width: 640px) {
flex-direction: column;
align-items: stretch;
}
}
.actions-left,
.actions-right {
display: flex;
align-items: center;
}
.actions-right {
justify-content: flex-end;
@media (max-width: 640px) {
justify-content: flex-start;
}
} }
.limit-note { .limit-note {
font-size: 0.8rem; font-size: 0.8rem;
color: var(--color-text-muted); color: var(--color-text-muted);
text-align: center; text-align: right;
margin-top: calc(var(--space-2) * -1);
@media (max-width: 640px) {
text-align: left;
}
} }
.notes-section { .notes-section {