diff --git a/.eslintrc.json b/.eslintrc.json index 368ed0a1..2dd77770 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,35 +1,3 @@ { - "parserOptions": { - "parser": "@typescript-eslint/parser" - }, - // Make sure prettier is the last config defined in the extends array - // as the order of the configs determine duplicate rules in different configs are handled - // (later configs override previous ones)! - "extends": ["eslint:recommended", "plugin:vue/vue3-recommended", "@vue/typescript/recommended", "prettier"], - "env": { - "es6": true, - "browser": true, - "node": true - }, - "plugins": ["@typescript-eslint", "prettier", "import"], - "rules": { - // code quality and code style rules: - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/consistent-type-definitions": ["error", "interface"], - "@typescript-eslint/no-empty-function": "off", - // to avoid conflicts, code formatting rules should go in .prettierrc! - "prettier/prettier": "error" - }, - "settings": { - "import/parsers": { - "@typescript-eslint/parser": [".ts", ".tsx"] - }, - "import/resolver": { - "typescript": { - "alwaysTryTypes": true, - "extensions": [".ts", ".tsx", ".vue"] - } - } - } + "extends": ["./public/.eslintrc.json"] } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79f30bd2..df47aa9e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,19 +10,19 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@2.8.4 + - prettier@3.2.3 types_or: [ts, javascript, scss, css, yaml, json, vue] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.34.0 + rev: v8.56.0 hooks: - id: eslint additional_dependencies: - - eslint@8.34.0 + - eslint@8.56.0 - eslint-config-prettier@8.8.0 - eslint-import-resolver-typescript@3.5.5 - eslint-plugin-cypress@2.12.1 - eslint-plugin-import@2.27.5 - - eslint-plugin-prettier@4.2.1 + - eslint-plugin-prettier@5.1.3 - eslint-plugin-vue@9.11.0 - '@vue/eslint-config-prettier@7.1.0' - '@vue/eslint-config-typescript@11.0.2' diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..a6c57f5f --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..65f52714 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,16 @@ +{ + "plugins": ["@trivago/prettier-plugin-sort-imports"], + "arrowParens": "always", + "printWidth": 120, + "singleQuote": true, + "trailingComma": "es5", + "semi": true, + "importOrder": [ + "css$", + "", + "^@(components|directives|services|models|utils|/)(.*)$", + "", + "^@(components|directives|services|models|utils|/)(.*)$" + ], + "importOrderSortSpecifiers": true +} diff --git a/.prettierrc.yaml b/.prettierrc.yaml deleted file mode 100644 index 6e4b24e8..00000000 --- a/.prettierrc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -arrowParens: always -printWidth: 120 -singleQuote: true -trailingComma: es5 -semi: true -importOrder: - - css$ - - - - ^@(components|directives|services|models|utils|\/)(.*)$ - - - - ^@(components|directives|services|models|utils|\/)(.*)$ -importOrderSortSpecifiers: true -#importOrderSeparation: true diff --git a/.storybook/main.ts b/.storybook/main.ts index b0a1f439..bf5fcda6 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -6,7 +6,7 @@ const config: StorybookConfig = { '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', - '@storybook/addon-mdx-gfm' + '@storybook/addon-mdx-gfm', ], framework: { name: '@storybook/vue3-vite', diff --git a/.storybook/vite.config.ts b/.storybook/vite.config.ts index da1fff1d..d71fe39b 100644 --- a/.storybook/vite.config.ts +++ b/.storybook/vite.config.ts @@ -1,7 +1,7 @@ +import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; import vue from '@vitejs/plugin-vue'; import { resolve } from 'path'; import { defineConfig } from 'vite'; -import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; // https://vitejs.dev/config/ export default defineConfig({ diff --git a/cypress/e2e/tsconfig.json b/cypress/e2e/tsconfig.json index be213aef..ca733a23 100644 --- a/cypress/e2e/tsconfig.json +++ b/cypress/e2e/tsconfig.json @@ -5,6 +5,6 @@ "isolatedModules": false, "target": "es5", "lib": ["es5", "dom"], - "types": ["cypress"] - } + "types": ["cypress"], + }, } diff --git a/cypress/fixtures/actor.json b/cypress/fixtures/actor.json index ec197c70..8d915566 100644 --- a/cypress/fixtures/actor.json +++ b/cypress/fixtures/actor.json @@ -3,326 +3,326 @@ "uri": "https://dev-id.erfgoed.net/actoren/12564", "self": "https://dev-actoren.onroerenderfgoed.be/actoren/12564", "type": { - "id": 1, - "naam": "persoon", - "uri": "foaf:Person" + "id": 1, + "naam": "persoon", + "uri": "foaf:Person" }, "types": [ - "http://xmlns.com/foaf/0.1/Person", - "foaf:Person", - "https://www.w3.org/ns/prov#Person", - "prov:Person", - "https://id.erfgoed.net/vocab/ontology#ErkendArcheoloog", - "oe:ErkendArcheoloog", - "https://id.erfgoed.net/vocab/ontology#ErkendArcheoloog", - "oe:ErkendArcheoloog" + "http://xmlns.com/foaf/0.1/Person", + "foaf:Person", + "https://www.w3.org/ns/prov#Person", + "prov:Person", + "https://id.erfgoed.net/vocab/ontology#ErkendArcheoloog", + "oe:ErkendArcheoloog", + "https://id.erfgoed.net/vocab/ontology#ErkendArcheoloog", + "oe:ErkendArcheoloog" ], "zichtbaarheid": { - "id": 1, - "naam": "privaat" + "id": 1, + "naam": "privaat" }, "omschrijving": "Van Humbeeck, Astrid", "naam": "Van Humbeeck", "voornaam": "Astrid", "afkorting": "", "adressen": [ - { - "id": 2326, - "land": { - "code": "BE", - "naam": "Belgi\u00eb" - }, - "postcode": { - "nummer": "3360", - "uri": "https://data.vlaanderen.be/id/postinfo/3360" - }, - "gemeente": { - "naam": "Bierbeek", - "niscode": "24011" - }, - "straat": { - "naam": "Krijkelberg", - "id": "32284", - "uri": "https://data.vlaanderen.be/id/straatnaam/32284" - }, - "adres": { - "huisnummer": "18", - "busnummer": "", - "id": "3509600", - "uri": "https://data.vlaanderen.be/id/adres/3509600" - }, - "adrestype": { - "id": 2, - "naam": "Extra" - }, - "omschrijving": "Krijkelberg 18, 3360 Bierbeek", - "beschrijving": null, - "startdatum": "2023-04-17", - "einddatum": null + { + "id": 2326, + "land": { + "code": "BE", + "naam": "Belgi\u00eb" }, - { - "id": 2251, - "land": { - "code": "BE", - "naam": "Belgi\u00eb" - }, - "postcode": { - "nummer": "3770", - "uri": "https://data.vlaanderen.be/id/postinfo/3770" - }, - "gemeente": { - "naam": "Riemst", - "niscode": "73066" - }, - "straat": { - "naam": "Achterhofname", - "id": "122648", - "uri": "https://data.vlaanderen.be/id/straatnaam/122648" - }, - "adres": { - "huisnummer": "3", - "busnummer": "", - "id": "1021993", - "uri": "https://data.vlaanderen.be/id/adres/1021993" - }, - "adrestype": { - "id": 1, - "naam": "Primair" - }, - "omschrijving": "Achterhofname 3, 3770 Riemst", - "beschrijving": null, - "startdatum": "2020-10-14", - "einddatum": null + "postcode": { + "nummer": "3360", + "uri": "https://data.vlaanderen.be/id/postinfo/3360" }, - { - "id": 2255, - "land": { - "code": "BE", - "naam": "Belgi\u00eb" - }, - "postcode": { - "nummer": "1790", - "uri": "https://data.vlaanderen.be/id/postinfo/1790" - }, - "gemeente": { - "naam": "Affligem", - "niscode": "23105" - }, - "straat": { - "naam": "Boonhof", - "id": "31373", - "uri": "https://data.vlaanderen.be/id/straatnaam/31373" - }, - "adres": { - "huisnummer": "66", - "busnummer": "", - "id": "701663", - "uri": "https://data.vlaanderen.be/id/adres/701663" - }, - "adrestype": { - "id": 2, - "naam": "Extra" - }, - "omschrijving": "Boonhof 66, 1790 Affligem", - "beschrijving": null, - "startdatum": "2020-10-27", - "einddatum": null - } - ], - "info": [ - { - "id": 1, - "naam": "Aanvaardt opdracht als archeoloog" - } - ], - "urls": [], - "telefoons": [], - "emails": [ - { - "email": "astrid.vanhumbeeck@vlaanderen.be", - "type": { - "id": 2, - "naam": "werk" - } - } - ], - "relaties": [ - { - "id": 15676, - "type": { - "id": 1, - "naam": "is deel van" - }, - "naar_id": 10082, - "naar_omschrijving": "Agentschap Onroerend Erfgoed", - "startdatum": null, - "einddatum": null + "gemeente": { + "naam": "Bierbeek", + "niscode": "24011" + }, + "straat": { + "naam": "Krijkelberg", + "id": "32284", + "uri": "https://data.vlaanderen.be/id/straatnaam/32284" }, - { - "id": 15805, - "type": { - "id": 3, - "naam": "is sleutelgebruiker" - }, - "naar_id": 501, - "naar_omschrijving": "Agentschap Onroerend Erfgoed", - "startdatum": null, - "einddatum": null + "adres": { + "huisnummer": "18", + "busnummer": "", + "id": "3509600", + "uri": "https://data.vlaanderen.be/id/adres/3509600" }, - { - "id": 15678, - "type": { - "id": 3, - "naam": "is sleutelgebruiker" - }, - "naar_id": 12557, - "naar_omschrijving": "Verdugt NV", - "startdatum": "2021-03-01", - "einddatum": null - } - ], - "adres": { + "adrestype": { + "id": 2, + "naam": "Extra" + }, + "omschrijving": "Krijkelberg 18, 3360 Bierbeek", + "beschrijving": null, + "startdatum": "2023-04-17", + "einddatum": null + }, + { "id": 2251, "land": { - "code": "BE", - "naam": "Belgi\u00eb" + "code": "BE", + "naam": "Belgi\u00eb" }, "postcode": { - "nummer": "3770", - "uri": "https://data.vlaanderen.be/id/postinfo/3770" + "nummer": "3770", + "uri": "https://data.vlaanderen.be/id/postinfo/3770" }, "gemeente": { - "naam": "Riemst", - "niscode": "73066" + "naam": "Riemst", + "niscode": "73066" }, "straat": { - "naam": "Achterhofname", - "id": "122648", - "uri": "https://data.vlaanderen.be/id/straatnaam/122648" + "naam": "Achterhofname", + "id": "122648", + "uri": "https://data.vlaanderen.be/id/straatnaam/122648" }, "adres": { - "huisnummer": "3", - "busnummer": "", - "id": "1021993", - "uri": "https://data.vlaanderen.be/id/adres/1021993" + "huisnummer": "3", + "busnummer": "", + "id": "1021993", + "uri": "https://data.vlaanderen.be/id/adres/1021993" }, "adrestype": { - "id": 1, - "naam": "Primair" + "id": 1, + "naam": "Primair" }, "omschrijving": "Achterhofname 3, 3770 Riemst", "beschrijving": null, "startdatum": "2020-10-14", "einddatum": null + }, + { + "id": 2255, + "land": { + "code": "BE", + "naam": "Belgi\u00eb" + }, + "postcode": { + "nummer": "1790", + "uri": "https://data.vlaanderen.be/id/postinfo/1790" + }, + "gemeente": { + "naam": "Affligem", + "niscode": "23105" + }, + "straat": { + "naam": "Boonhof", + "id": "31373", + "uri": "https://data.vlaanderen.be/id/straatnaam/31373" + }, + "adres": { + "huisnummer": "66", + "busnummer": "", + "id": "701663", + "uri": "https://data.vlaanderen.be/id/adres/701663" + }, + "adrestype": { + "id": 2, + "naam": "Extra" + }, + "omschrijving": "Boonhof 66, 1790 Affligem", + "beschrijving": null, + "startdatum": "2020-10-27", + "einddatum": null + } + ], + "info": [ + { + "id": 1, + "naam": "Aanvaardt opdracht als archeoloog" + } + ], + "urls": [], + "telefoons": [], + "emails": [ + { + "email": "astrid.vanhumbeeck@vlaanderen.be", + "type": { + "id": 2, + "naam": "werk" + } + } + ], + "relaties": [ + { + "id": 15676, + "type": { + "id": 1, + "naam": "is deel van" + }, + "naar_id": 10082, + "naar_omschrijving": "Agentschap Onroerend Erfgoed", + "startdatum": null, + "einddatum": null + }, + { + "id": 15805, + "type": { + "id": 3, + "naam": "is sleutelgebruiker" + }, + "naar_id": 501, + "naar_omschrijving": "Agentschap Onroerend Erfgoed", + "startdatum": null, + "einddatum": null + }, + { + "id": 15678, + "type": { + "id": 3, + "naam": "is sleutelgebruiker" + }, + "naar_id": 12557, + "naar_omschrijving": "Verdugt NV", + "startdatum": "2021-03-01", + "einddatum": null + } + ], + "adres": { + "id": 2251, + "land": { + "code": "BE", + "naam": "Belgi\u00eb" + }, + "postcode": { + "nummer": "3770", + "uri": "https://data.vlaanderen.be/id/postinfo/3770" + }, + "gemeente": { + "naam": "Riemst", + "niscode": "73066" + }, + "straat": { + "naam": "Achterhofname", + "id": "122648", + "uri": "https://data.vlaanderen.be/id/straatnaam/122648" + }, + "adres": { + "huisnummer": "3", + "busnummer": "", + "id": "1021993", + "uri": "https://data.vlaanderen.be/id/adres/1021993" + }, + "adrestype": { + "id": 1, + "naam": "Primair" + }, + "omschrijving": "Achterhofname 3, 3770 Riemst", + "beschrijving": null, + "startdatum": "2020-10-14", + "einddatum": null }, "erkenningen": [ - { - "erkenningsnummer": "OE/ERK/Archeoloog/2020/00015", - "id": 55, - "type": "natuurlijk persoon", - "uri": "https://dev-id.erfgoed.net/actoren/12564", - "omschrijving": "Van Humbeeck, Astrid", - "erkend_voor": "Archeologie type 1", - "erkend_als": "Archeoloog type 1", - "type_erkenning_id": 1, - "reden_erkenning": { - "id": 2, - "reden_erkenning": "Van rechtswege erkend" - }, - "geldigheid": "Vanaf 01-12-2020" + { + "erkenningsnummer": "OE/ERK/Archeoloog/2020/00015", + "id": 55, + "type": "natuurlijk persoon", + "uri": "https://dev-id.erfgoed.net/actoren/12564", + "omschrijving": "Van Humbeeck, Astrid", + "erkend_voor": "Archeologie type 1", + "erkend_als": "Archeoloog type 1", + "type_erkenning_id": 1, + "reden_erkenning": { + "id": 2, + "reden_erkenning": "Van rechtswege erkend" }, - { - "erkenningsnummer": "OE/ERK/Archeoloog/2018/00018", - "id": 9, - "type": "rechtspersoon", - "uri": "https://dev-id.erfgoed.net/actoren/501", - "omschrijving": "Agentschap Onroerend Erfgoed", - "erkend_voor": "Archeologie type 1", - "erkend_als": "Archeoloog type 1", - "type_erkenning_id": 1, - "reden_erkenning": { - "id": 2, - "reden_erkenning": "Van rechtswege erkend" - }, - "geldigheid": "Vanaf 01-06-2018 tot 30-06-2030" + "geldigheid": "Vanaf 01-12-2020" + }, + { + "erkenningsnummer": "OE/ERK/Archeoloog/2018/00018", + "id": 9, + "type": "rechtspersoon", + "uri": "https://dev-id.erfgoed.net/actoren/501", + "omschrijving": "Agentschap Onroerend Erfgoed", + "erkend_voor": "Archeologie type 1", + "erkend_als": "Archeoloog type 1", + "type_erkenning_id": 1, + "reden_erkenning": { + "id": 2, + "reden_erkenning": "Van rechtswege erkend" }, - { - "erkenningsnummer": "OE/ERK/Archeoloog/2021/00001", - "id": 59, - "type": "rechtspersoon", - "uri": "https://dev-id.erfgoed.net/actoren/12557", - "omschrijving": "Verdugt NV", - "erkend_voor": "Archeologie type 1", - "erkend_als": "Archeoloog type 1", - "type_erkenning_id": 1, - "reden_erkenning": { - "id": 1, - "reden_erkenning": "Erkend door Onroerend Erfgoed" - }, - "geldigheid": "Vanaf 01-03-2021" - } + "geldigheid": "Vanaf 01-06-2018 tot 30-06-2030" + }, + { + "erkenningsnummer": "OE/ERK/Archeoloog/2021/00001", + "id": 59, + "type": "rechtspersoon", + "uri": "https://dev-id.erfgoed.net/actoren/12557", + "omschrijving": "Verdugt NV", + "erkend_voor": "Archeologie type 1", + "erkend_als": "Archeoloog type 1", + "type_erkenning_id": 1, + "reden_erkenning": { + "id": 1, + "reden_erkenning": "Erkend door Onroerend Erfgoed" + }, + "geldigheid": "Vanaf 01-03-2021" + } ], "overeenkomsten": [], "systemfields": { - "created_at": "2020-10-16T14:03:24.911936+02:00", - "created_by": { - "uri": "https://dev-id.erfgoed.net/actoren/12495", - "description": "Toelatingen Beschermd Erfgoed Aanvragen" - }, - "updated_at": "2023-11-06T11:11:22.308101+01:00", - "updated_by": { - "uri": "https://dev-id.erfgoed.net/actoren/12564", - "description": "Van Humbeeck, Astrid" - } + "created_at": "2020-10-16T14:03:24.911936+02:00", + "created_by": { + "uri": "https://dev-id.erfgoed.net/actoren/12495", + "description": "Toelatingen Beschermd Erfgoed Aanvragen" + }, + "updated_at": "2023-11-06T11:11:22.308101+01:00", + "updated_by": { + "uri": "https://dev-id.erfgoed.net/actoren/12564", + "description": "Van Humbeeck, Astrid" + } }, "status": { - "status": { - "id": 75, - "status": "Actief" - }, - "datum": "2020-12-02T09:24:38.485558+01:00", - "gebruiker": { - "uri": "https://dev-id.erfgoed.net/actoren/12564", - "omschrijving": "Van Humbeeck, Astrid" - }, - "opmerkingen": "" + "status": { + "id": 75, + "status": "Actief" + }, + "datum": "2020-12-02T09:24:38.485558+01:00", + "gebruiker": { + "uri": "https://dev-id.erfgoed.net/actoren/12564", + "omschrijving": "Van Humbeeck, Astrid" + }, + "opmerkingen": "" }, "ids": [ - { - "type": { - "id": 4, - "naam": "rrn" - }, - "extra_id": "90042818619" + { + "type": { + "id": 4, + "naam": "rrn" }, - { - "type": { - "id": 5, - "naam": "persid" - }, - "extra_id": "-DrDAN0sRG4tJMJ0Zl34mQ" + "extra_id": "90042818619" + }, + { + "type": { + "id": 5, + "naam": "persid" }, - { - "type": { - "id": 7, - "naam": "uid" - }, - "extra_id": "vanhumas" + "extra_id": "-DrDAN0sRG4tJMJ0Zl34mQ" + }, + { + "type": { + "id": 7, + "naam": "uid" }, - { - "type": { - "id": 12, - "naam": "orcid" - }, - "extra_id": "https://orcid.org/0000-0002-1825-0097" + "extra_id": "vanhumas" + }, + { + "type": { + "id": 12, + "naam": "orcid" }, - { - "type": { - "id": 15, - "naam": "persoonid" - }, - "extra_id": "34d27418799f0f148485bacb457f7490e4350928a1169095e4501f69c633b21e" - } + "extra_id": "https://orcid.org/0000-0002-1825-0097" + }, + { + "type": { + "id": 15, + "naam": "persoonid" + }, + "extra_id": "34d27418799f0f148485bacb457f7490e4350928a1169095e4501f69c633b21e" + } ], "opmerkingen": "" } diff --git a/package.json b/package.json index 071b0f28..109dbae0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "main": "./dist/vue-components.umd.js", "module": "./dist/vue-components.es.js", "typings": "./dist/src/main.d.ts", - "version": "1.0.0", + "version": "1.1.0", "exports": { ".": { "import": "./dist/vue-components.es.js", @@ -88,7 +88,7 @@ "@storybook/builder-vite": "^7.6.4", "@storybook/testing-library": "^0.2.2", "@storybook/vue3-vite": "^7.6.4", - "@trivago/prettier-plugin-sort-imports": "4.1.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/node": "^18.14.2", "@types/proj4": "^2.5.2", "@types/tinymce": "^4.6.6", @@ -103,17 +103,17 @@ "chromatic": "^6.17.3", "cypress": "^13.2.0", "cypress-watch-and-reload": "^1.10.6", - "eslint": "^8.34.0", + "eslint": "^8.56.0", "eslint-config-prettier": "^8.8.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.27.5", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-storybook": "^0.6.15", "eslint-plugin-vue": "^9.11.0", "npm-run-all": "^4.1.5", "path": "^0.12.7", - "prettier": "^2.8.4", + "prettier": "^3.2.3", "react": "^18.2.0", "react-dom": "^18.2.0", "rollup-plugin-copy": "^3.4.0", diff --git a/public/.eslintrc.json b/public/.eslintrc.json new file mode 100644 index 00000000..368ed0a1 --- /dev/null +++ b/public/.eslintrc.json @@ -0,0 +1,35 @@ +{ + "parserOptions": { + "parser": "@typescript-eslint/parser" + }, + // Make sure prettier is the last config defined in the extends array + // as the order of the configs determine duplicate rules in different configs are handled + // (later configs override previous ones)! + "extends": ["eslint:recommended", "plugin:vue/vue3-recommended", "@vue/typescript/recommended", "prettier"], + "env": { + "es6": true, + "browser": true, + "node": true + }, + "plugins": ["@typescript-eslint", "prettier", "import"], + "rules": { + // code quality and code style rules: + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/consistent-type-definitions": ["error", "interface"], + "@typescript-eslint/no-empty-function": "off", + // to avoid conflicts, code formatting rules should go in .prettierrc! + "prettier/prettier": "error" + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "alwaysTryTypes": true, + "extensions": [".ts", ".tsx", ".vue"] + } + } + } +} diff --git a/src/__tests__/InputPhone.cy.ts b/src/__tests__/InputPhone.cy.ts index f333567e..85337d3f 100644 --- a/src/__tests__/InputPhone.cy.ts +++ b/src/__tests__/InputPhone.cy.ts @@ -1,6 +1,6 @@ +import type { CountryCode } from 'libphonenumber-js'; import { defineComponent, ref } from 'vue'; import InputPhone from '@components/dumb/InputPhone.vue'; -import type { CountryCode } from 'libphonenumber-js'; const TestComponent = defineComponent({ components: { InputPhone }, diff --git a/src/__tests__/NoRowsOverlay.cy.ts b/src/__tests__/NoRowsOverlay.cy.ts new file mode 100644 index 00000000..f60151b2 --- /dev/null +++ b/src/__tests__/NoRowsOverlay.cy.ts @@ -0,0 +1,32 @@ +import { defineComponent } from 'vue'; +import NoRowsOverlay from '@/components/dumb/NoRowsOverlay.vue'; + +describe('NoRowsOverlay', () => { + const TestComponent = defineComponent({ + components: { NoRowsOverlay }, + data: () => { + return { + params: { + noRowsMessage: 'No rows available', + }, + }; + }, + template: '', + }); + + beforeEach(() => { + cy.mount(TestComponent); + }); + + it('has a wrapper with class ag-overlay-loading-center', () => { + cy.dataCy('ag-overlay').should('have.class', 'ag-overlay-loading-center'); + }); + + it('renders a warning icon', () => { + cy.dataCy('warning-icon').should('exist').should('have.attr', 'data-icon', 'circle-exclamation'); + }); + + it('renders the given no rows message', () => { + cy.dataCy('ag-overlay').invoke('text').should('contain', 'No rows available'); + }); +}); diff --git a/src/__tests__/OeZoneerder.cy.ts b/src/__tests__/OeZoneerder.cy.ts index fd9ac222..8bdd05a2 100644 --- a/src/__tests__/OeZoneerder.cy.ts +++ b/src/__tests__/OeZoneerder.cy.ts @@ -1,8 +1,8 @@ /* eslint-disable vue/one-component-per-file */ import { defineComponent } from 'vue'; import { LayerType } from '@/models'; -import { OeZoneerder } from '@components/smart'; import type { OeZoneerderProps } from '@/models'; +import { OeZoneerder } from '@components/smart'; describe('OeZoneerder', () => { describe('default', () => { diff --git a/src/__tests__/SystemFields.cy.ts b/src/__tests__/SystemFields.cy.ts index 3d9f6208..06d760d1 100644 --- a/src/__tests__/SystemFields.cy.ts +++ b/src/__tests__/SystemFields.cy.ts @@ -18,9 +18,9 @@ describe('SystemFields - no data', () => { mount(TestComponent); }); - it('has an empty status field', () => { + it('hides the status field when empty', () => { mount(TestComponent); - cy.dataCy('systemfield-status').should('have.text', 'Status: -'); + cy.dataCy('systemfield-status').should('not.exist'); }); it('has an empty aangemaakt door field', () => { diff --git a/src/components/dumb/FilterDatepicker.vue b/src/components/dumb/FilterDatepicker.vue index a066c62c..92b48efd 100644 --- a/src/components/dumb/FilterDatepicker.vue +++ b/src/components/dumb/FilterDatepicker.vue @@ -5,7 +5,7 @@ :value="dateValue" visual-format="d-m-Y" @input="updateValue" - /> + > diff --git a/src/components/dumb/OeAutocomplete.vue b/src/components/dumb/OeAutocomplete.vue index 77c99768..f28e3698 100644 --- a/src/components/dumb/OeAutocomplete.vue +++ b/src/components/dumb/OeAutocomplete.vue @@ -7,7 +7,7 @@ mod-block @update:model-value="handleInput" > - +
@@ -20,7 +20,7 @@
    • -
    • Status: {{ props.status || '-' }}
    • +
    • Status: {{ props.status }}
    • Aangemaakt door: {{ props.createdBy || '-' }} op {{ createdAt }}
    • diff --git a/src/components/dumb/index.ts b/src/components/dumb/index.ts index 870fde95..e8e8fc9a 100644 --- a/src/components/dumb/index.ts +++ b/src/components/dumb/index.ts @@ -5,6 +5,7 @@ import FilterRadio from './FilterRadio.vue'; import FilterSelect from './FilterSelect.vue'; import FilterText from './FilterText.vue'; import InputPhone from './InputPhone.vue'; +import NoRowsOverlay from './NoRowsOverlay.vue'; import OeAutocomplete from './OeAutocomplete.vue'; import OeButton from './OeButton.vue'; import OeContainer from './OeContainer.vue'; @@ -24,6 +25,7 @@ export { FilterSelect, FilterText, InputPhone, + NoRowsOverlay, OeAutocomplete, OeButton, OeContainer, diff --git a/src/components/smart/FilterAOEActor.vue b/src/components/smart/FilterAOEActor.vue index d527c522..b56c18c0 100644 --- a/src/components/smart/FilterAOEActor.vue +++ b/src/components/smart/FilterAOEActor.vue @@ -11,10 +11,10 @@