diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index b96224a..b549ff8 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -41,25 +41,38 @@ jobs: cache: "npm" cache-dependency-path: "frontend/package-lock.json" - - name: Install Chromium + - name: Resolve Chrome binary shell: bash run: | - apt-get update - apt-get install -y --no-install-recommends chromium + set -euo pipefail + 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 shell: bash run: | cd frontend - npm ci --no-audit --no-fund + npm ci --no-audit --no-fund --prefer-offline - name: Run frontend tests (headless) shell: bash env: - CHROME_BIN: /usr/bin/chromium CI: "true" run: | cd frontend + echo "Karma CHROME_BIN=$CHROME_BIN" npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox build-and-push: diff --git a/.gitea/workflows/pr-checks.yaml b/.gitea/workflows/pr-checks.yaml index f964f6b..a1bc852 100644 --- a/.gitea/workflows/pr-checks.yaml +++ b/.gitea/workflows/pr-checks.yaml @@ -150,23 +150,36 @@ jobs: cache: "npm" cache-dependency-path: "frontend/package-lock.json" - - name: Install Chromium + - name: Resolve Chrome binary shell: bash run: | - apt-get update - apt-get install -y --no-install-recommends chromium + set -euo pipefail + 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 shell: bash run: | cd frontend - npm ci --no-audit --no-fund + npm ci --no-audit --no-fund --prefer-offline - name: Run frontend tests (headless) shell: bash env: - CHROME_BIN: /usr/bin/chromium CI: "true" run: | cd frontend + echo "Karma CHROME_BIN=$CHROME_BIN" npm run test -- --watch=false --browsers=ChromeHeadlessNoSandbox diff --git a/frontend/src/app/features/calculator/components/quote-result/quote-result.component.html b/frontend/src/app/features/calculator/components/quote-result/quote-result.component.html index 3e9ab00..d7141b7 100644 --- a/frontend/src/app/features/calculator/components/quote-result/quote-result.component.html +++ b/frontend/src/app/features/calculator/components/quote-result/quote-result.component.html @@ -96,18 +96,22 @@
- - {{ "QUOTE.CONSULT" | translate }} - - - @if (!hasQuantityOverLimit()) { - - {{ "QUOTE.PROCEED_ORDER" | translate }} +
+ + {{ "QUOTE.CONSULT" | translate }} - } @else { - {{ - "QUOTE.MAX_QTY_NOTICE" | translate: { max: directOrderLimit } - }} - } +
+ +
+ @if (!hasQuantityOverLimit()) { + + {{ "QUOTE.PROCEED_ORDER" | translate }} + + } @else { + {{ + "QUOTE.MAX_QTY_NOTICE" | translate: { max: directOrderLimit } + }} + } +
diff --git a/frontend/src/app/features/calculator/components/quote-result/quote-result.component.scss b/frontend/src/app/features/calculator/components/quote-result/quote-result.component.scss index ae639d0..38913fa 100644 --- a/frontend/src/app/features/calculator/components/quote-result/quote-result.component.scss +++ b/frontend/src/app/features/calculator/components/quote-result/quote-result.component.scss @@ -126,15 +126,39 @@ .actions { display: flex; - flex-direction: column; + justify-content: space-between; + align-items: center; 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 { font-size: 0.8rem; color: var(--color-text-muted); - text-align: center; - margin-top: calc(var(--space-2) * -1); + text-align: right; + + @media (max-width: 640px) { + text-align: left; + } } .notes-section {