1 Commits

Author SHA1 Message Date
Simon Pocrnjič 8147fedd04 workflow fixed multiselect, combobox width was not limited when selecting desicisions 2026-02-01 19:35:38 +01:00
10 changed files with 6131 additions and 6321 deletions
-27
View File
@@ -1,27 +0,0 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
-8
View File
@@ -39,11 +39,3 @@ docker-compose.local.yaml
docker-compose.override.yaml docker-compose.override.yaml
.env.local .env.local
.env.docker .env.docker
# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
-4
View File
@@ -45,10 +45,6 @@
} }
}, },
"scripts": { "scripts": {
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fdba74\" \"php artisan serve --no-reload --port=8090\" \"php artisan queue:listen --tries=1\" \"npm run dev\" --names='server,queue,vite'"
],
"post-autoload-dump": [ "post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi" "@php artisan package:discover --ansi"
-19
View File
@@ -1,19 +0,0 @@
// @ts-check
import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
+18 -64
View File
@@ -48,7 +48,6 @@
"devDependencies": { "devDependencies": {
"@inertiajs/vue3": "2.0", "@inertiajs/vue3": "2.0",
"@mdi/js": "^7.4.47", "@mdi/js": "^7.4.47",
"@playwright/test": "^1.59.1",
"@tailwindcss/forms": "^0.5.10", "@tailwindcss/forms": "^0.5.10",
"@tailwindcss/postcss": "^4.1.18", "@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/typography": "^0.5.19", "@tailwindcss/typography": "^0.5.19",
@@ -1127,22 +1126,6 @@
"state-local": "^1.0.6" "state-local": "^1.0.6"
} }
}, },
"node_modules/@playwright/test": {
"version": "1.59.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.1.tgz",
"integrity": "sha512-PG6q63nQg5c9rIi4/Z5lR5IVF7yU5MqmKaPOe0HSc0O2cX1fPi96sUQu5j7eo4gKCkB2AnNGoWt7y4/Xx3Kcqg==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.59.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@popperjs/core": { "node_modules/@popperjs/core": {
"version": "2.11.8", "version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
@@ -5038,53 +5021,6 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/playwright": {
"version": "1.59.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.1.tgz",
"integrity": "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.59.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/playwright-core": {
"version": "1.59.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.1.tgz",
"integrity": "sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/playwright/node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.5.6", "version": "8.5.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
@@ -6093,6 +6029,24 @@
"which": "bin/which" "which": "bin/which"
} }
}, },
"node_modules/yaml": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
"integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
"dev": true,
"license": "ISC",
"optional": true,
"peer": true,
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14.6"
},
"funding": {
"url": "https://github.com/sponsors/eemeli"
}
},
"node_modules/zod": { "node_modules/zod": {
"version": "3.25.76", "version": "3.25.76",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
-1
View File
@@ -9,7 +9,6 @@
"devDependencies": { "devDependencies": {
"@inertiajs/vue3": "2.0", "@inertiajs/vue3": "2.0",
"@mdi/js": "^7.4.47", "@mdi/js": "^7.4.47",
"@playwright/test": "^1.59.1",
"@tailwindcss/forms": "^0.5.10", "@tailwindcss/forms": "^0.5.10",
"@tailwindcss/postcss": "^4.1.18", "@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/typography": "^0.5.19", "@tailwindcss/typography": "^0.5.19",
-81
View File
@@ -1,81 +0,0 @@
// @ts-check
import { defineConfig, devices } from '@playwright/test';
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });
/**
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: './e2e',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('')`. */
// baseURL: 'http://localhost:3000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://localhost:3000',
// reuseExistingServer: !process.env.CI,
// },
});
@@ -84,8 +84,8 @@ const summaryText = computed(() => {
const found = props.items.find((i) => String(i.value) === String(v)); const found = props.items.find((i) => String(i.value) === String(v));
return found?.label || v; return found?.label || v;
}); });
if (labels.length <= 3) return labels.join(', '); if (labels.length <= 3) return labels.join(", ");
const firstThree = labels.slice(0, 3).join(', '); const firstThree = labels.slice(0, 3).join(", ");
const remaining = labels.length - 3; const remaining = labels.length - 3;
return `${firstThree}, … +${remaining}`; // show ellipsis and remaining count return `${firstThree}, … +${remaining}`; // show ellipsis and remaining count
}); });
@@ -154,7 +154,7 @@ const summaryText = computed(() => {
:variant="chipVariant" :variant="chipVariant"
class="flex items-center gap-1" class="flex items-center gap-1"
> >
<span class="truncate max-w-[140px]"> <span class="truncate max-w-35">
{{ items.find((i) => String(i.value) === String(val))?.label || val }} {{ items.find((i) => String(i.value) === String(val))?.label || val }}
</span> </span>
<button <button
@@ -54,9 +54,7 @@ const form = useInertiaForm({
props.actions[0].decisions.length > 0 props.actions[0].decisions.length > 0
? props.actions[0].decisions[0].id ? props.actions[0].decisions[0].id
: null, : null,
contract_uuids: props.contractUuid ? [props.contractUuid] : (props.contracts && Array.isArray(props.contracts) contract_uuids: props.contractUuid ? [props.contractUuid] : [],
? props.contracts.map((c) => c.uuid)
: []),
send_auto_mail: true, send_auto_mail: true,
attach_documents: false, attach_documents: false,
attachment_document_ids: [], attachment_document_ids: [],
@@ -106,9 +104,7 @@ watch(
() => props.show, () => props.show,
(visible) => { (visible) => {
if (visible) { if (visible) {
form.contract_uuids = props.contractUuid ? [props.contractUuid] : (props.contracts && Array.isArray(props.contracts) form.contract_uuids = props.contractUuid ? [props.contractUuid] : [];
? props.contracts.map((c) => c.uuid)
: []);
} }
} }
); );
@@ -305,7 +305,7 @@ const destroyAction = () => {
</div> </div>
</div> </div>
<div> <div class="space-y-1.5">
<InputLabel for="segmentEdit">Segment</InputLabel> <InputLabel for="segmentEdit">Segment</InputLabel>
<AppCombobox <AppCombobox
id="segmentEdit" id="segmentEdit"
@@ -323,7 +323,7 @@ const destroyAction = () => {
v-model="form.decisions" v-model="form.decisions"
:items="selectOptions" :items="selectOptions"
placeholder="Dodaj odločitev" placeholder="Dodaj odločitev"
content-class="p-0 w-full" chip-variant="secondary"
/> />
</div> </div>
@@ -373,7 +373,7 @@ const destroyAction = () => {
v-model="createForm.decisions" v-model="createForm.decisions"
:items="selectOptions" :items="selectOptions"
placeholder="Dodaj odločitev" placeholder="Dodaj odločitev"
content-class="p-0 w-full" chip-variant="secondary"
/> />
</div> </div>