diff --git a/.ai/angular-patterns.md b/.ai/angular-patterns.md index ac08d02..6272804 100644 --- a/.ai/angular-patterns.md +++ b/.ai/angular-patterns.md @@ -1,21 +1,21 @@ # Angular Patterns -# Zoneless component pattern +## Zoneless component pattern Components rely on signals for UI updates. Example: +```ts @Component({ - selector: 'app-counter' + selector: 'app-counter', }) export class CounterComponent { - store = inject(CounterStore); count = this.store.count; - } +``` ## NgRx Signal Store @@ -23,30 +23,34 @@ Application state should be implemented using NgRx Signal Store. Example pattern: -import { signalStore, withState, withMethods } from '@ngrx/signals'; +```ts +import { signalStore, withMethods, withState } from '@ngrx/signals'; export const CounterStore = signalStore( { providedIn: 'root' }, withState({ - count: 0 + count: 0, }), withMethods((store) => ({ increment() { - store.count.update(v => v + 1); - } - })) - ) + store.count.update((v) => v + 1); + }, + })), +); +``` Usage in component: +```ts @Component({ - selector: 'app-counter' + selector: 'app-counter', }) export class CounterComponent { store = inject(CounterStore); } +``` ## UI components with optimus-ui @@ -54,6 +58,7 @@ UI components come from `@openng/optimus-ui`, imported per-component from their Example: +```ts import { Component, input, output } from '@angular/core'; import { Paginator, PaginatorState } from '@openng/optimus-ui/paginator'; @@ -61,12 +66,8 @@ import { Paginator, PaginatorState } from '@openng/optimus-ui/paginator'; selector: 'app-list', imports: [Paginator], template: ` - - ` + + `, }) export class ListComponent { first = input.required(); @@ -74,3 +75,4 @@ export class ListComponent { total = input.required(); pageChange = output(); } +``` diff --git a/.ai/dev-commands.md b/.ai/dev-commands.md index 0675eea..0a1e840 100644 --- a/.ai/dev-commands.md +++ b/.ai/dev-commands.md @@ -46,3 +46,13 @@ pnpm lint Run ESLint and automatically fix issues: pnpm lint:fix + +## Format + +Format all files with Prettier (also sorts imports): + +pnpm format + +Check formatting without writing changes: + +pnpm format:check diff --git a/.editorconfig b/.editorconfig index f166060..131bc49 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,10 +3,13 @@ root = true [*] charset = utf-8 +end_of_line = lf indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true +# Same as the Prettier `printWidth` (.prettierrc) +max_line_length = 120 [*.ts] quote_type = single diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..02b827f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +# Generated files (Prettier also honours .gitignore) +pnpm-lock.yaml +.angular +dist +coverage diff --git a/.prettierrc b/.prettierrc index d6c16d7..239076d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,11 @@ { - "printWidth": 100, + "printWidth": 120, "singleQuote": true, + "bracketSameLine": true, + "plugins": ["@ianvs/prettier-plugin-sort-imports"], + "importOrder": ["", "", "", "^[.]"], + "importOrderParserPlugins": ["typescript", "decorators"], + "importOrderTypeScriptVersion": "6.0.3", "overrides": [ { "files": "*.html", diff --git a/README.md b/README.md index 322f812..2af078a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Projet pour tester Angular POC Vous devez avoir au préalable installer pnpm sur votre système. ## Installation de bibliothèques + ```bash pnpm install ``` diff --git a/angular.json b/angular.json index 65abc63..d5d5ae7 100644 --- a/angular.json +++ b/angular.json @@ -26,9 +26,7 @@ "input": "public" } ], - "styles": [ - "src/styles.scss" - ] + "styles": ["src/styles.scss"] }, "configurations": { "production": { @@ -62,11 +60,11 @@ "extractLicenses": false, "sourceMap": true, "fileReplacements": [ - { - "replace": "src/app/app.config.ts", - "with": "src/app/app.config.mock.ts" - } - ] + { + "replace": "src/app/app.config.ts", + "with": "src/app/app.config.mock.ts" + } + ] } }, "defaultConfiguration": "production" diff --git a/eslint.config.ts b/eslint.config.ts index ce85208..6bea11e 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,7 +1,6 @@ import eslint from '@eslint/js'; import angular from 'angular-eslint'; import { defineConfig } from 'eslint/config'; -import simpleImportSort from 'eslint-plugin-simple-import-sort'; import tseslint from 'typescript-eslint'; export default defineConfig([ @@ -17,9 +16,6 @@ export default defineConfig([ angular.configs.tsRecommended, ], processor: angular.processInlineTemplates, - plugins: { - 'simple-import-sort': simpleImportSort, - }, rules: { '@angular-eslint/directive-selector': [ 'error', @@ -37,8 +33,6 @@ export default defineConfig([ style: 'kebab-case', }, ], - 'simple-import-sort/imports': 'error', - 'simple-import-sort/exports': 'error', }, }, { diff --git a/package.json b/package.json index d970aef..d8f0865 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "test:watch": "vitest", "test:coverage": "vitest run --coverage", "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "format": "prettier --write .", + "format:check": "prettier --check ." }, "private": true, "packageManager": "pnpm@11.22.0", @@ -38,12 +40,12 @@ "@angular/cli": "^22.3.0", "@angular/compiler-cli": "^22.3.0", "@eslint/js": "^10.0.1", + "@ianvs/prettier-plugin-sort-imports": "^4.7.1", "@tailwindcss/postcss": "^4.3.5", "@vitest/coverage-v8": "^5.1.1", "angular-eslint": "^22.8.0", "baseline-browser-mapping": "^2.11.39", "eslint": "^10.15.0", - "eslint-plugin-simple-import-sort": "^14.0.0", "jsdom": "^31.0.1", "postcss": "^8.5.33", "prettier": "^3.10.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ab1d15d..4249a09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,6 +69,9 @@ importers: '@eslint/js': specifier: ^10.0.1 version: 10.0.1(eslint@10.15.0(jiti@2.7.0)(supports-color@8.1.1)) + '@ianvs/prettier-plugin-sort-imports': + specifier: ^4.7.1 + version: 4.7.1(prettier@3.10.1)(supports-color@8.1.1) '@tailwindcss/postcss': specifier: ^4.3.5 version: 4.3.5 @@ -84,9 +87,6 @@ importers: eslint: specifier: ^10.15.0 version: 10.15.0(jiti@2.7.0)(supports-color@8.1.1) - eslint-plugin-simple-import-sort: - specifier: ^14.0.0 - version: 14.0.0(eslint@10.15.0(jiti@2.7.0)(supports-color@8.1.1)) jsdom: specifier: ^31.0.1 version: 31.0.1 @@ -396,10 +396,6 @@ packages: resolution: {integrity: sha512-C2FuapQ2Kh1OnVHAoLi5rD3GBJ8COb9Q609T6HEpLqaBAo560PDP5OxBE5dCI/h951MBO/+bCUYU5SZ+8ZlV+w==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.29.7': - resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@8.1.3': resolution: {integrity: sha512-5HTuREtgj0xIc345zU4gtD2+3vIPkZpJw7wUYytt/mzBTQN2mWpGr1nxYiocYa2E8sWggRkrSg/k7BK51pAxIg==} engines: {node: ^22.18.0 || >=24.11.0} @@ -433,11 +429,6 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@7.29.9': - resolution: {integrity: sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/parser@8.1.3': resolution: {integrity: sha512-v3ck2WN7jn8gEJlEfIDEwTM8dCBjOac1CZjolvB6/r0O1ome6E7xS2cDQEOQqESRQZWWrLrhnjxD0qjmZ8QBgg==} engines: {node: ^22.18.0 || >=24.11.0} @@ -463,10 +454,6 @@ packages: resolution: {integrity: sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ==} engines: {node: '>=6.9.0'} - '@babel/types@7.29.8': - resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} - engines: {node: '>=6.9.0'} - '@babel/types@8.1.3': resolution: {integrity: sha512-eBREGwDHRPHtdsg44t071GE2KRDEuJrf0J2uT5/qvJPB2+pfPZOKlx93dMZOFkE7QW5G0JWoczySD7a01Jf0iw==} engines: {node: ^22.18.0 || >=24.11.0} @@ -730,6 +717,24 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} + '@ianvs/prettier-plugin-sort-imports@4.7.1': + resolution: {integrity: sha512-jmTNYGlg95tlsoG3JLCcuC4BrFELJtLirLAkQW/71lXSyOhVt/Xj7xWbbGcuVbNq1gwWgSyMrPjJc9Z30hynVw==} + peerDependencies: + '@prettier/plugin-oxc': ^0.0.4 || ^0.1.0 + '@vue/compiler-sfc': 2.7.x || 3.x + content-tag: ^4.0.0 + prettier: 2 || 3 || ^4.0.0-0 + prettier-plugin-ember-template-tag: ^2.1.0 + peerDependenciesMeta: + '@prettier/plugin-oxc': + optional: true + '@vue/compiler-sfc': + optional: true + content-tag: + optional: true + prettier-plugin-ember-template-tag: + optional: true + '@inquirer/ansi@2.1.1': resolution: {integrity: sha512-WwCc5T9554vU/M3W6mztOJvZK/5RgMwQsGlSZSZpKA/H2IfsTWIPdn1WiS8+HHjhe3H0IsmQCXUlDbvGM6vvuA==} engines: {node: '>=23.5.0 || ^22.13.0 || ^20.17.0'} @@ -1719,9 +1724,6 @@ packages: cpu: [x64] os: [win32] - '@rolldown/pluginutils@1.0.1': - resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} - '@rolldown/pluginutils@1.1.1': resolution: {integrity: sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==} @@ -2203,11 +2205,6 @@ packages: resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} engines: {node: ^4.5.0 || >= 5.9} - baseline-browser-mapping@2.11.26: - resolution: {integrity: sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==} - engines: {node: '>=6.0.0'} - hasBin: true - baseline-browser-mapping@2.11.39: resolution: {integrity: sha512-Q9buOYhr2ggrEZpImICecZTJHCCd8yXkRUokFlUEQ8uiD6oP82F4W4jWnhOHZYV+wlvrC51V7Wy0ULyWjil5Wg==} engines: {node: '>=6.0.0'} @@ -2246,11 +2243,6 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.28.8: - resolution: {integrity: sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - browserslist@4.29.6: resolution: {integrity: sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -2274,9 +2266,6 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - caniuse-lite@1.0.30001809: - resolution: {integrity: sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ==} - caniuse-lite@1.0.30001827: resolution: {integrity: sha512-YWEDr46gSO81M8w6uPbaIy4++IXsirx2asUqvllNiD4BPf75ibxclUjWEqp8ObCenRv+UM2n5Y8xuRPT8V8FrQ==} @@ -2466,9 +2455,6 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.412: - resolution: {integrity: sha512-z4rMe3esBzlzovKHj4gxJnsCGZRK5l4baUvm+gCGJBPE+gsyUMKsuU9tnEUtI1dOebXz1ytAPGjvXhmQ7rIPwA==} - electron-to-chromium@1.5.492: resolution: {integrity: sha512-4uMs7omhajKiud0GqALLTazS/zyvHLTLmDWVTR+e6BnyJo5bSNrph/JoRWEFJJmY75ct9hCiSGsbFF9fLe5gDw==} @@ -2545,11 +2531,6 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - eslint-plugin-simple-import-sort@14.0.0: - resolution: {integrity: sha512-NUJO0+XFCkk+o5EsAJruTgnfMEpeWrPWeJS15UVF60GgXmqz1BJ9/3hzlvG7lkL8Bubzos5cCLptThbFfPnSMQ==} - peerDependencies: - eslint: '>=5.0.0' - eslint-scope@9.1.2: resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} @@ -2692,10 +2673,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.6.0: - resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} - engines: {node: '>=18'} - get-east-asian-width@1.7.0: resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} engines: {node: '>=18'} @@ -2728,9 +2705,6 @@ packages: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graceful-fs@4.2.12: resolution: {integrity: sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==} @@ -3144,10 +3118,6 @@ packages: resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==} hasBin: true - node-releases@2.0.53: - resolution: {integrity: sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==} - engines: {node: '>=18'} - node-releases@2.0.65: resolution: {integrity: sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA==} engines: {node: '>=18'} @@ -3596,10 +3566,6 @@ packages: resolution: {integrity: sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==} engines: {node: '>=10.2.0'} - source-map-js@1.2.2: - resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} - engines: {node: '>=0.10.0'} - source-map-js@1.2.4: resolution: {integrity: sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==} engines: {node: '>=6.0.0'} @@ -3726,9 +3692,6 @@ packages: peerDependencies: typescript: '>=4.8.4' - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - tslib@2.9.1: resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} @@ -3771,12 +3734,6 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} - update-browserslist-db@1.3.1: - resolution: {integrity: sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - update-browserslist-db@1.4.0: resolution: {integrity: sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w==} hasBin: true @@ -4202,7 +4159,7 @@ snapshots: '@angular/platform-browser': 22.3.0(@angular/common@22.3.0(@angular/core@22.3.0(@angular/compiler@22.3.0)(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@22.3.0(@angular/compiler@22.3.0)(rxjs@7.8.2)(zone.js@0.15.1)) parse5: 8.1.1 rxjs: 7.8.2 - tslib: 2.8.1 + tslib: 2.9.1 '@angular/cli@22.3.0(@types/node@24.9.2)(chokidar@6.0.0)': dependencies: @@ -4285,7 +4242,6 @@ snapshots: '@babel/helper-validator-identifier': 7.29.7 js-tokens: 4.0.0 picocolors: 1.1.1 - optional: true '@babel/code-frame@8.0.6': dependencies: @@ -4304,10 +4260,10 @@ snapshots: '@babel/helper-compilation-targets': 7.29.7 '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1) '@babel/helpers': 7.29.7 - '@babel/parser': 7.29.9 + '@babel/parser': 7.29.15 '@babel/template': 7.29.7 '@babel/traverse': 7.29.8(supports-color@8.1.1) - '@babel/types': 7.29.8 + '@babel/types': 7.29.15 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 debug: 4.4.3(supports-color@8.1.1) @@ -4339,12 +4295,11 @@ snapshots: '@babel/generator@7.29.8': dependencies: - '@babel/parser': 7.29.9 - '@babel/types': 7.29.8 + '@babel/parser': 7.29.15 + '@babel/types': 7.29.15 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 - optional: true '@babel/generator@8.1.3': dependencies: @@ -4359,7 +4314,7 @@ snapshots: dependencies: '@babel/compat-data': 7.29.7 '@babel/helper-validator-option': 7.29.7 - browserslist: 4.28.8 + browserslist: 4.29.6 lru-cache: 5.1.1 semver: 6.3.1 optional: true @@ -4372,15 +4327,14 @@ snapshots: flru: 1.0.2 verkit: 0.5.0 - '@babel/helper-globals@7.29.7': - optional: true + '@babel/helper-globals@7.29.7': {} '@babel/helper-globals@8.0.6': {} '@babel/helper-module-imports@7.29.7(supports-color@8.1.1)': dependencies: '@babel/traverse': 7.29.8(supports-color@8.1.1) - '@babel/types': 7.29.8 + '@babel/types': 7.29.15 transitivePeerDependencies: - supports-color optional: true @@ -4397,9 +4351,6 @@ snapshots: '@babel/helper-string-parser@7.29.15': {} - '@babel/helper-string-parser@7.29.7': - optional: true - '@babel/helper-string-parser@8.1.3': {} '@babel/helper-validator-identifier@7.29.7': {} @@ -4414,7 +4365,7 @@ snapshots: '@babel/helpers@7.29.7': dependencies: '@babel/template': 7.29.7 - '@babel/types': 7.29.8 + '@babel/types': 7.29.15 optional: true '@babel/helpers@8.1.3': @@ -4426,11 +4377,6 @@ snapshots: dependencies: '@babel/types': 7.29.15 - '@babel/parser@7.29.9': - dependencies: - '@babel/types': 7.29.8 - optional: true - '@babel/parser@8.1.3': dependencies: '@babel/types': 8.1.3 @@ -4438,9 +4384,8 @@ snapshots: '@babel/template@7.29.7': dependencies: '@babel/code-frame': 7.29.7 - '@babel/parser': 7.29.9 - '@babel/types': 7.29.8 - optional: true + '@babel/parser': 7.29.15 + '@babel/types': 7.29.15 '@babel/template@8.1.2': dependencies: @@ -4453,13 +4398,12 @@ snapshots: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 '@babel/helper-globals': 7.29.7 - '@babel/parser': 7.29.9 + '@babel/parser': 7.29.15 '@babel/template': 7.29.7 - '@babel/types': 7.29.8 + '@babel/types': 7.29.15 debug: 4.4.3(supports-color@8.1.1) transitivePeerDependencies: - supports-color - optional: true '@babel/traverse@8.1.3': dependencies: @@ -4476,12 +4420,6 @@ snapshots: '@babel/helper-string-parser': 7.29.15 '@babel/helper-validator-identifier': 7.29.7 - '@babel/types@7.29.8': - dependencies: - '@babel/helper-string-parser': 7.29.7 - '@babel/helper-validator-identifier': 7.29.7 - optional: true - '@babel/types@8.1.3': dependencies: '@babel/helper-string-parser': 8.1.3 @@ -4515,7 +4453,7 @@ snapshots: '@emnapi/core@2.0.0-beta.2': dependencies: '@emnapi/wasi-threads': 2.2.0 - tslib: 2.8.1 + tslib: 2.9.1 optional: true '@emnapi/runtime@2.0.0-alpha.6': @@ -4525,12 +4463,12 @@ snapshots: '@emnapi/runtime@2.0.0-beta.2': dependencies: - tslib: 2.8.1 + tslib: 2.9.1 optional: true '@emnapi/wasi-threads@2.2.0': dependencies: - tslib: 2.8.1 + tslib: 2.9.1 optional: true '@esbuild/aix-ppc64@0.28.2': @@ -4666,6 +4604,17 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} + '@ianvs/prettier-plugin-sort-imports@4.7.1(prettier@3.10.1)(supports-color@8.1.1)': + dependencies: + '@babel/generator': 7.29.8 + '@babel/parser': 7.29.15 + '@babel/traverse': 7.29.8(supports-color@8.1.1) + '@babel/types': 7.29.15 + prettier: 3.10.1 + semver: 7.8.6 + transitivePeerDependencies: + - supports-color + '@inquirer/ansi@2.1.1': {} '@inquirer/checkbox@5.3.1(@types/node@24.9.2)': @@ -5326,8 +5275,6 @@ snapshots: '@rolldown/binding-win32-x64-msvc@1.3.1': optional: true - '@rolldown/pluginutils@1.0.1': {} - '@rolldown/pluginutils@1.1.1': {} '@rollup/rollup-android-arm-eabi@4.52.3': @@ -5756,9 +5703,6 @@ snapshots: base64id@2.0.0: optional: true - baseline-browser-mapping@2.11.26: - optional: true - baseline-browser-mapping@2.11.39: {} bcp-47-match@2.0.3: {} @@ -5819,15 +5763,6 @@ snapshots: fill-range: 7.1.1 optional: true - browserslist@4.28.8: - dependencies: - baseline-browser-mapping: 2.11.26 - caniuse-lite: 1.0.30001809 - electron-to-chromium: 1.5.412 - node-releases: 2.0.53 - update-browserslist-db: 1.3.1(browserslist@4.28.8) - optional: true - browserslist@4.29.6: dependencies: baseline-browser-mapping: 2.11.39 @@ -5861,9 +5796,6 @@ snapshots: get-intrinsic: 1.3.0 optional: true - caniuse-lite@1.0.30001809: - optional: true - caniuse-lite@1.0.30001827: {} chai@6.3.0: {} @@ -6060,9 +5992,6 @@ snapshots: ee-first@1.1.1: optional: true - electron-to-chromium@1.5.412: - optional: true - electron-to-chromium@1.5.492: {} emoji-regex@10.6.0: {} @@ -6163,10 +6092,6 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-plugin-simple-import-sort@14.0.0(eslint@10.15.0(jiti@2.7.0)(supports-color@8.1.1)): - dependencies: - eslint: 10.15.0(jiti@2.7.0)(supports-color@8.1.1) - eslint-scope@9.1.2: dependencies: '@types/esrecurse': 4.3.1 @@ -6311,7 +6236,7 @@ snapshots: fs-extra@8.1.0: dependencies: - graceful-fs: 4.2.11 + graceful-fs: 4.2.12 jsonfile: 4.0.0 universalify: 0.1.2 optional: true @@ -6329,8 +6254,6 @@ snapshots: get-caller-file@2.0.5: {} - get-east-asian-width@1.6.0: {} - get-east-asian-width@1.7.0: {} get-intrinsic@1.3.0: @@ -6379,9 +6302,6 @@ snapshots: gopd@1.2.0: optional: true - graceful-fs@4.2.11: - optional: true - graceful-fs@4.2.12: {} has-flag@4.0.0: {} @@ -6536,7 +6456,7 @@ snapshots: istanbul-lib-instrument@6.0.3(supports-color@8.1.1): dependencies: '@babel/core': 7.29.7(supports-color@8.1.1) - '@babel/parser': 7.29.9 + '@babel/parser': 7.29.15 '@istanbuljs/schema': 0.1.6 istanbul-lib-coverage: 3.2.2 semver: 7.8.6 @@ -6548,8 +6468,7 @@ snapshots: js-tokens@10.0.1: {} - js-tokens@4.0.0: - optional: true + js-tokens@4.0.0: {} jsdom@31.0.1: dependencies: @@ -6588,7 +6507,7 @@ snapshots: jsonfile@4.0.0: optionalDependencies: - graceful-fs: 4.2.11 + graceful-fs: 4.2.12 optional: true karma@6.4.4(debug@4.4.3(supports-color@8.1.1))(supports-color@8.1.1): @@ -6601,7 +6520,7 @@ snapshots: di: 0.0.1 dom-serialize: 2.2.1 glob: 7.2.3 - graceful-fs: 4.2.11 + graceful-fs: 4.2.12 http-proxy: 1.18.1(debug@4.4.3(supports-color@8.1.1)) isbinaryfile: 4.0.10 lodash: 4.17.21 @@ -6841,9 +6760,6 @@ snapshots: detect-libc: 2.1.2 optional: true - node-releases@2.0.53: - optional: true - node-releases@2.0.65: {} normalize-path@3.0.0: @@ -7107,7 +7023,7 @@ snapshots: rolldown@1.2.19: dependencies: '@oxc-project/types': 0.156.0 - '@rolldown/pluginutils': 1.0.1 + '@rolldown/pluginutils': 1.1.1 optionalDependencies: '@rolldown/binding-android-arm-eabi': 1.2.19 '@rolldown/binding-android-arm64': 1.2.19 @@ -7281,7 +7197,7 @@ snapshots: dependencies: chokidar: 5.0.0 immutable: 5.1.9 - source-map-js: 1.2.2 + source-map-js: 1.2.4 optionalDependencies: '@parcel/watcher': 2.6.0 @@ -7380,8 +7296,6 @@ snapshots: - utf-8-validate optional: true - source-map-js@1.2.2: {} - source-map-js@1.2.4: {} source-map-support@0.5.21: @@ -7427,7 +7341,7 @@ snapshots: string-width@8.3.0: dependencies: - get-east-asian-width: 1.6.0 + get-east-asian-width: 1.7.0 strip-ansi: 7.2.0 strip-ansi@6.0.1: @@ -7495,8 +7409,6 @@ snapshots: dependencies: typescript: 6.0.3 - tslib@2.8.1: {} - tslib@2.9.1: {} type-check@0.4.0: @@ -7537,13 +7449,6 @@ snapshots: unpipe@1.0.0: optional: true - update-browserslist-db@1.3.1(browserslist@4.28.8): - dependencies: - browserslist: 4.28.8 - escalade: 3.2.0 - picocolors: 1.1.1 - optional: true - update-browserslist-db@1.4.0(browserslist@4.29.6): dependencies: browserslist: 4.29.6 diff --git a/src/app/app.config.mock.ts b/src/app/app.config.mock.ts index 12a20a1..7db343b 100644 --- a/src/app/app.config.mock.ts +++ b/src/app/app.config.mock.ts @@ -1,9 +1,15 @@ import { provideHttpClient } from '@angular/common/http'; -import { ApplicationConfig, inject, provideBrowserGlobalErrorListeners, provideEnvironmentInitializer, provideZonelessChangeDetection } from '@angular/core'; +import { + ApplicationConfig, + inject, + provideBrowserGlobalErrorListeners, + provideEnvironmentInitializer, + provideZonelessChangeDetection, +} from '@angular/core'; import { provideRouter, TitleStrategy } from '@angular/router'; +import Lara from '@openng/optimus-ui-themes/lara'; import { MessageService } from '@openng/optimus-ui/api'; import { provideOptimus } from '@openng/optimus-ui/config'; -import Lara from '@openng/optimus-ui-themes/lara'; import { AppStateStore } from '@shared/appSate/app-state-store'; import { PageTitleStrategy } from '@shared/page-title-strategy'; @@ -21,14 +27,14 @@ export const appConfig: ApplicationConfig = { inject(AppStateStore).loadSettings(); }), provideOptimus({ - ripple: true, - theme: { - preset: Lara - } + ripple: true, + theme: { + preset: Lara, + }, }), { provide: TitleStrategy, useClass: PageTitleStrategy }, { provide: OpenLibraryBase, useClass: OpenLibraryMock }, MessageService, - AppStateStore - ] + AppStateStore, + ], }; diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 3639234..3fa3c22 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,9 +1,15 @@ import { provideHttpClient, withInterceptors } from '@angular/common/http'; -import { ApplicationConfig, inject, provideBrowserGlobalErrorListeners, provideEnvironmentInitializer, provideZonelessChangeDetection } from '@angular/core'; +import { + ApplicationConfig, + inject, + provideBrowserGlobalErrorListeners, + provideEnvironmentInitializer, + provideZonelessChangeDetection, +} from '@angular/core'; import { provideRouter, TitleStrategy } from '@angular/router'; +import Aura from '@openng/optimus-ui-themes/aura'; import { MessageService } from '@openng/optimus-ui/api'; import { provideOptimus } from '@openng/optimus-ui/config'; -import Aura from '@openng/optimus-ui-themes/aura'; import { AppStateStore } from '@shared/appSate/app-state-store'; import { httpResponseErrorInterceptor } from '@shared/interceptor/http-response-error-interceptor'; import { PageTitleStrategy } from '@shared/page-title-strategy'; @@ -17,21 +23,19 @@ export const appConfig: ApplicationConfig = { provideBrowserGlobalErrorListeners(), provideZonelessChangeDetection(), provideRouter(routes), - provideHttpClient( - withInterceptors([httpResponseErrorInterceptor]) - ), + provideHttpClient(withInterceptors([httpResponseErrorInterceptor])), provideEnvironmentInitializer(() => { inject(AppStateStore).loadSettings(); }), provideOptimus({ - ripple: true, - theme: { - preset: Aura - } + ripple: true, + theme: { + preset: Aura, + }, }), { provide: TitleStrategy, useClass: PageTitleStrategy }, { provide: OpenLibraryBase, useClass: OpenLibraryApi }, MessageService, - AppStateStore - ] + AppStateStore, + ], }; diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 1176f64..f6ae0df 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -5,27 +5,27 @@ export const routes: Routes = [ path: '', pathMatch: 'full', loadComponent: () => import('./features/home/home'), - title: 'Home' + title: 'Home', }, { path: 'login', pathMatch: 'full', loadComponent: () => import('./features/login/login'), - title: 'Login' + title: 'Login', }, { path: 'todo', - pathMatch:'full', + pathMatch: 'full', loadComponent: () => import('./features/todo/todo'), - title: 'Tâches' + title: 'Tâches', }, { path: 'books', - loadChildren: () => import('./features/books/books.routes').then(m => m.routes), + loadChildren: () => import('./features/books/books.routes').then((m) => m.routes), }, { path: '**', loadComponent: () => import('./features/not-found/not-found'), - title: 'Not Found' - } + title: 'Not Found', + }, ]; diff --git a/src/app/app.ts b/src/app/app.ts index 9339cac..aebafef 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -9,19 +9,20 @@ import { Sidebar } from './features/sidebar/sidebar'; selector: 'app-root', imports: [RouterOutlet, Sidebar, Toast], template: ` -
- -
-
- +
+ +
+
+ +
+ @defer (on immediate) { + + }
- @defer (on immediate) { - - }
-
`, }) export class App { diff --git a/src/app/features/books/book-detail.ts b/src/app/features/books/book-detail.ts index f948f9d..79e2d33 100644 --- a/src/app/features/books/book-detail.ts +++ b/src/app/features/books/book-detail.ts @@ -41,10 +41,7 @@ import { map } from 'rxjs'; ], template: `
- + Retour à la bibliothèque @@ -53,8 +50,7 @@ import { map } from 'rxjs';
+ class="md:w-64 flex-shrink-0 bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center min-h-64"> @if (coverUrl()) { } @else { @@ -78,21 +74,14 @@ import { map } from 'rxjs'; @if (descriptionHtml()) {
-

- Description -

-
+

Description

+
} @if (work().subjects && work().subjects!.length > 0) {
-

- Sujets -

+

Sujets

@for (subject of work().subjects!.slice(0, 10); track subject) { diff --git a/src/app/features/books/book.ts b/src/app/features/books/book.ts index 59ae376..f0f522a 100644 --- a/src/app/features/books/book.ts +++ b/src/app/features/books/book.ts @@ -8,9 +8,11 @@ import { OpenLibraryRecord } from './model/open-library.model'; selector: 'app-book', imports: [RouterLink], template: ` -
+
-
+
@if (coverUrl()) { @if (book().first_publish_year) { -
+
{{ book().first_publish_year }}
} @@ -35,8 +38,7 @@ import { OpenLibraryRecord } from './model/open-library.model';

- {{ book().title }} + {{ book().title }}

diff --git a/src/app/features/books/books.html b/src/app/features/books/books.html index ba30a60..66b9590 100644 --- a/src/app/features/books/books.html +++ b/src/app/features/books/books.html @@ -11,40 +11,39 @@

Bibliothèque

- @if(store.total() > 0) { - -
-
- - {{ store.total() }} résultat{{ store.total() > 1 ? 's' : '' }} trouvé{{ store.total() > - 1 ? 's' : '' }} + @if (store.total() > 0) { + +
+
+ + {{ resultLabel() }} +
-
- -
- @for(document of store.documents(); track document.key) { - - } -
+ +
+ @for (document of store.documents(); track document.key) { + + } +
- -
- -
- } @else { - -
-
- + +
+
-

Aucun résultat trouvé

-

Essayez une autre recherche ou modifiez vos critères

-
- - Utilisez la barre de recherche ci-dessus pour explorer la bibliothèque + } @else { + +
+
+ +
+

Aucun résultat trouvé

+

Essayez une autre recherche ou modifiez vos critères

+
+ + Utilisez la barre de recherche ci-dessus pour explorer la bibliothèque +
-
}
diff --git a/src/app/features/books/books.routes.ts b/src/app/features/books/books.routes.ts index f438009..45b8e40 100644 --- a/src/app/features/books/books.routes.ts +++ b/src/app/features/books/books.routes.ts @@ -19,7 +19,7 @@ export const workResolver: ResolveFn = (route: ActivatedRouteSn catchError(() => { void router.navigate(['/not-found']); return EMPTY; - }) + }), ); }; @@ -27,7 +27,7 @@ export const routes: Routes = [ { path: '', title: 'Bibliothèque', - loadComponent: () => import('./books') + loadComponent: () => import('./books'), }, { path: ':key', @@ -35,6 +35,6 @@ export const routes: Routes = [ resolve: { work: workResolver, }, - loadComponent: () => import('./book-detail') + loadComponent: () => import('./book-detail'), }, -] +]; diff --git a/src/app/features/books/books.ts b/src/app/features/books/books.ts index f76be43..f323679 100644 --- a/src/app/features/books/books.ts +++ b/src/app/features/books/books.ts @@ -1,4 +1,4 @@ -import { Component, inject } from '@angular/core'; +import { Component, computed, inject } from '@angular/core'; import { PaginatorComponent } from '@shared/component/paginator'; import { Book } from './book'; @@ -13,4 +13,10 @@ import { OpenLibraryStore } from './store/open-library.store'; }) export default class Books { protected store = inject(OpenLibraryStore); + + protected resultLabel = computed(() => { + const total = this.store.total(); + const plural = total > 1 ? 's' : ''; + return `${total} résultat${plural} trouvé${plural}`; + }); } diff --git a/src/app/features/books/search.ts b/src/app/features/books/search.ts index ad1fd2b..74f00d4 100644 --- a/src/app/features/books/search.ts +++ b/src/app/features/books/search.ts @@ -1,6 +1,6 @@ import { Component, inject } from '@angular/core'; import { Button } from '@openng/optimus-ui/button'; -import { InputText } from "@openng/optimus-ui/inputtext"; +import { InputText } from '@openng/optimus-ui/inputtext'; import { OpenLibraryStore } from './store/open-library.store'; @@ -18,8 +18,7 @@ import { OpenLibraryStore } from './store/open-library.store'; placeholder="Rechercher un livre, un auteur..." [value]="store.filter()" (keyup.enter)="store.search(input.value)" - class="w-full transition-all" - /> + class="w-full transition-all" />
@if (store.filter()) { diff --git a/src/app/features/books/service/open-library-api.ts b/src/app/features/books/service/open-library-api.ts index 14c2b79..52261cb 100644 --- a/src/app/features/books/service/open-library-api.ts +++ b/src/app/features/books/service/open-library-api.ts @@ -3,8 +3,8 @@ import { inject, Service } from '@angular/core'; import { environment } from '@env/environment'; import { Observable } from 'rxjs'; -import { availableFields, OpenLibraryApiResult } from '../model/open-library.model'; import { OpenLibraryWork } from '../model/open-library-work.model'; +import { availableFields, OpenLibraryApiResult } from '../model/open-library.model'; import { OpenLibraryBase } from './open-library-base'; // Docs: https://openlibrary.org/dev/docs/api/search diff --git a/src/app/features/books/service/open-library-base.ts b/src/app/features/books/service/open-library-base.ts index c314320..59b6769 100644 --- a/src/app/features/books/service/open-library-base.ts +++ b/src/app/features/books/service/open-library-base.ts @@ -1,7 +1,7 @@ import { Observable } from 'rxjs'; -import { OpenLibraryApiResult } from '../model/open-library.model'; import { OpenLibraryWork } from '../model/open-library-work.model'; +import { OpenLibraryApiResult } from '../model/open-library.model'; export abstract class OpenLibraryBase { abstract search(query: string, page: number, limit: number): Observable; diff --git a/src/app/features/books/service/open-library-mock.ts b/src/app/features/books/service/open-library-mock.ts index 39da968..87bb9c9 100644 --- a/src/app/features/books/service/open-library-mock.ts +++ b/src/app/features/books/service/open-library-mock.ts @@ -1,8 +1,8 @@ import { Service } from '@angular/core'; import { delay, Observable, of } from 'rxjs'; -import { OpenLibraryApiResult, OpenLibraryRecord } from '../model/open-library.model'; import { OpenLibraryWork } from '../model/open-library-work.model'; +import { OpenLibraryApiResult, OpenLibraryRecord } from '../model/open-library.model'; import { OpenLibraryBase } from './open-library-base'; import data from './open-library-results.json'; diff --git a/src/app/features/books/service/open-library-results.json b/src/app/features/books/service/open-library-results.json index 3ea613f..92d92e2 100644 --- a/src/app/features/books/service/open-library-results.json +++ b/src/app/features/books/service/open-library-results.json @@ -59,41 +59,14 @@ "author_key": ["OL25788A"], "author_name": ["John Steinbeck"], "key": "/works/OL23197W", - "language": [ - "eng", - "dan", - "und", - "heb", - "per", - "ice", - "tam", - "chi", - "fre", - "cat", - "dut", - "ger" - ], + "language": ["eng", "dan", "und", "heb", "per", "ice", "tam", "chi", "fre", "cat", "dut", "ger"], "title": "The Red Pony" }, { "author_key": ["OL25788A"], "author_name": ["John Steinbeck"], "key": "/works/OL23166W", - "language": [ - "vie", - "chi", - "pol", - "spa", - "gre", - "ita", - "heb", - "swe", - "fre", - "cze", - "eng", - "ger", - "jpn" - ], + "language": ["vie", "chi", "pol", "spa", "gre", "ita", "heb", "swe", "fre", "cze", "eng", "ger", "jpn"], "title": "East of Eden" }, { @@ -255,20 +228,7 @@ "author_key": ["OL108289A"], "author_name": ["John Stuart Mill"], "key": "/works/OL1068091W", - "language": [ - "ger", - "eng", - "urd", - "spa", - "heb", - "chi", - "jpn", - "dan", - "swe", - "yid", - "fre", - "per" - ], + "language": ["ger", "eng", "urd", "spa", "heb", "chi", "jpn", "dan", "swe", "yid", "fre", "per"], "title": "On Liberty" }, { @@ -282,21 +242,7 @@ "author_key": ["OL25788A"], "author_name": ["John Steinbeck"], "key": "/works/OL23199W", - "language": [ - "tur", - "ice", - "gre", - "swe", - "eng", - "spa", - "dan", - "dut", - "fin", - "ger", - "fre", - "chi", - "jpn" - ], + "language": ["tur", "ice", "gre", "swe", "eng", "spa", "dan", "dut", "fin", "ger", "fre", "chi", "jpn"], "title": "Cannery Row" }, { @@ -310,20 +256,7 @@ "author_key": ["OL39329A"], "author_name": ["John Grisham"], "key": "/works/OL76972W", - "language": [ - "por", - "ger", - "fre", - "eng", - "dut", - "rus", - "ita", - "fin", - "spa", - "und", - "jpn", - "chi" - ], + "language": ["por", "ger", "fre", "eng", "dut", "rus", "ita", "fin", "spa", "und", "jpn", "chi"], "title": "The Firm" } ] diff --git a/src/app/features/home/home.ts b/src/app/features/home/home.ts index 4d45631..14d0c0f 100644 --- a/src/app/features/home/home.ts +++ b/src/app/features/home/home.ts @@ -5,5 +5,4 @@ import { Component } from '@angular/core'; imports: [], templateUrl: './home.html', }) -export default class Home { -} +export default class Home {} diff --git a/src/app/features/login/login.html b/src/app/features/login/login.html index 9c64886..411350d 100644 --- a/src/app/features/login/login.html +++ b/src/app/features/login/login.html @@ -9,9 +9,7 @@
RERO + -

- Connectez-vous à votre compte -

+

Connectez-vous à votre compte

@@ -24,28 +22,18 @@

pInputText [formField]="loginForm.username" class="block w-full" - [class.untouched-field]=" - !loginForm.username().dirty() && !loginForm.username().touched() - " - /> + [class.untouched-field]="!loginForm.username().dirty() && !loginForm.username().touched()" />

- @if ( - loginForm.username().invalid() && - (loginForm.username().dirty() || loginForm.username().touched()) - ) { + @if (loginForm.username().invalid() && (loginForm.username().dirty() || loginForm.username().touched())) {
{{ loginForm.username().errors()[0].message }}
}
- +
@@ -54,15 +42,9 @@

[formField]="loginForm.password" type="password" class="block w-full" - [class.untouched-field]=" - !loginForm.password().dirty() && !loginForm.password().touched() - " - /> + [class.untouched-field]="!loginForm.password().dirty() && !loginForm.password().touched()" />

- @if ( - loginForm.password().invalid() && - (loginForm.password().dirty() || loginForm.password().touched()) - ) { + @if (loginForm.password().invalid() && (loginForm.password().dirty() || loginForm.password().touched())) {
{{ loginForm.password().errors()[0].message }}
}
@@ -72,8 +54,7 @@

type="submit" severity="info" [disabled]="loginForm().invalid()" - styleClass="flex w-full justify-center" - > + styleClass="flex w-full justify-center"> S'identifier

diff --git a/src/app/features/not-found/not-found.ts b/src/app/features/not-found/not-found.ts index 011be31..f980b63 100644 --- a/src/app/features/not-found/not-found.ts +++ b/src/app/features/not-found/not-found.ts @@ -5,6 +5,4 @@ import { Component } from '@angular/core'; imports: [], templateUrl: './not-found.html', }) -export default class NotFound { - -} +export default class NotFound {} diff --git a/src/app/features/sidebar/sidebar.html b/src/app/features/sidebar/sidebar.html index 6ad3d8b..7c29f09 100644 --- a/src/app/features/sidebar/sidebar.html +++ b/src/app/features/sidebar/sidebar.html @@ -1,7 +1,8 @@
- + [class.w-64]="expanded()" + [class.w-16]="!expanded()" + [class.hover:w-64]="!expanded()">
Logo @@ -11,7 +12,8 @@ RERO+ POC - - } + @if (item.visible) { + + } }
diff --git a/src/app/features/sidebar/sidebar.ts b/src/app/features/sidebar/sidebar.ts index 1733f4a..8e3e683 100644 --- a/src/app/features/sidebar/sidebar.ts +++ b/src/app/features/sidebar/sidebar.ts @@ -32,18 +32,18 @@ export class Sidebar { { label: 'Accueil', icon: 'pi pi-home', - routerLink: ['/'] + routerLink: ['/'], }, { label: 'Tâche', icon: 'pi pi-check-square', - routerLink: ['/', 'todo'] + routerLink: ['/', 'todo'], }, { label: 'Bibliothèque', icon: 'pi pi-book', - routerLink: ['/', 'books'] - } + routerLink: ['/', 'books'], + }, ]); userItems = computed(() => [ @@ -53,7 +53,7 @@ export class Sidebar { visible: !this.store.isConnected(), command: () => { this.router.navigate(['login']); - } + }, }, { label: 'Se déconnecter', @@ -61,7 +61,7 @@ export class Sidebar { visible: this.store.isConnected(), command: () => { this.store.logout(); - } - } + }, + }, ]); } diff --git a/src/app/features/todo/model/todo.mock.ts b/src/app/features/todo/model/todo.mock.ts index b8d2029..72cb8cb 100644 --- a/src/app/features/todo/model/todo.mock.ts +++ b/src/app/features/todo/model/todo.mock.ts @@ -1,4 +1,4 @@ -import { Todo } from "./todo.model"; +import { Todo } from './todo.model'; export const TODOS: Todo[] = [ { id: 1, title: 'Apprendre Vue', completed: false }, @@ -6,5 +6,5 @@ export const TODOS: Todo[] = [ { id: 3, title: 'Apprendre Symfony', completed: false }, { id: 4, title: 'Apprendre Python', completed: false }, { id: 5, title: 'Apprendre React', completed: false }, - { id: 6, title: 'Apprendre Rust', completed: false } + { id: 6, title: 'Apprendre Rust', completed: false }, ]; diff --git a/src/app/features/todo/service/todo.service.ts b/src/app/features/todo/service/todo.service.ts index 143e2bb..5106d88 100644 --- a/src/app/features/todo/service/todo.service.ts +++ b/src/app/features/todo/service/todo.service.ts @@ -1,7 +1,7 @@ -import { Service } from "@angular/core"; +import { Service } from '@angular/core'; -import { TODOS } from "../model/todo.mock"; -import { Todo } from "../model/todo.model"; +import { TODOS } from '../model/todo.mock'; +import { Todo } from '../model/todo.model'; @Service({ autoProvided: false }) export class TodoService { @@ -9,10 +9,10 @@ export class TodoService { return TODOS; } - addTodo(todo: Partial): Todo{ + addTodo(todo: Partial): Todo { return { id: Math.random().toString(36).substring(2, 9), - ...todo + ...todo, } as Todo; } } diff --git a/src/app/features/todo/store/todo.store.ts b/src/app/features/todo/store/todo.store.ts index 33789cf..60a89ac 100644 --- a/src/app/features/todo/store/todo.store.ts +++ b/src/app/features/todo/store/todo.store.ts @@ -1,22 +1,22 @@ -import { computed, inject } from "@angular/core"; -import { patchState, signalStore, withComputed, withHooks, withMethods, withProps, withState } from "@ngrx/signals"; -import { MessageService } from "@openng/optimus-ui/api"; +import { computed, inject } from '@angular/core'; +import { patchState, signalStore, withComputed, withHooks, withMethods, withProps, withState } from '@ngrx/signals'; +import { MessageService } from '@openng/optimus-ui/api'; -import { Todo } from "../model/todo.model"; -import { TodoService } from "../service/todo.service"; +import { Todo } from '../model/todo.model'; +import { TodoService } from '../service/todo.service'; -export type TodoFilter = "all" | "pending" | "completed"; +export type TodoFilter = 'all' | 'pending' | 'completed'; interface TodosState { - todos: Todo[], - loading: boolean, - filter: TodoFilter + todos: Todo[]; + loading: boolean; + filter: TodoFilter; } const initialState: TodosState = { todos: [], loading: false, - filter: "all" + filter: 'all', }; export const TodoStore = signalStore( @@ -25,14 +25,14 @@ export const TodoStore = signalStore( filteredTodos: computed(() => { const todos = state.todos(); switch (state.filter()) { - case "all": + case 'all': return todos; - case "pending": - return todos.filter(todo => !todo.completed); - case "completed": - return todos.filter(todo => todo.completed); + case 'pending': + return todos.filter((todo) => !todo.completed); + case 'completed': + return todos.filter((todo) => todo.completed); } - }) + }), })), withProps(() => ({ todoService: inject(TodoService), @@ -41,60 +41,66 @@ export const TodoStore = signalStore( withMethods((store) => ({ loadAll() { const todos = store.todoService.loadAll(); - patchState(store, { todos }, { loading: true }) + patchState(store, { todos }, { loading: true }); }, addTodo(title: string) { - const todo = store.todoService.addTodo({ title, completed: false}); + const todo = store.todoService.addTodo({ title, completed: false }); patchState(store, (state) => ({ - todos: [...state.todos,todo] + todos: [...state.todos, todo], })); store.messageService.add({ severity: 'success', summary: 'Succès', - detail: `Le tâche "${todo.title}" a été ajouté` + detail: `Le tâche "${todo.title}" a été ajouté`, }); }, updateTodo(id: number, completed: boolean) { - const todo = store.todos().filter((todo: Todo) => todo.id === id).pop(); + const todo = store + .todos() + .filter((todo: Todo) => todo.id === id) + .pop(); if (todo) { patchState(store, (state) => ({ - todos: state.todos.map(todo => todo.id == id ? {...todo, completed} : todo) + todos: state.todos.map((todo) => (todo.id == id ? { ...todo, completed } : todo)), })); if (completed) { store.messageService.add({ severity: 'success', summary: 'Terminé', - detail: `Le tâche "${todo.title}" est terminée` + detail: `Le tâche "${todo.title}" est terminée`, }); } else { store.messageService.add({ severity: 'warn', summary: 'En cours', - detail: `Le tâche "${todo.title}" est en cours` + detail: `Le tâche "${todo.title}" est en cours`, }); } } }, deleteTodo(id: number) { - const todo = store.todos().filter((todo: Todo) => todo.id === id).pop(); + const todo = store + .todos() + .filter((todo: Todo) => todo.id === id) + .pop(); if (todo) { patchState(store, (state) => ({ - todos: state.todos.filter(todo => todo.id != id) + todos: state.todos.filter((todo) => todo.id != id), })); store.messageService.add({ severity: 'warn', summary: 'Succès', - detail: `Le tâche "${todo.title}" a été supprimée` + detail: `Le tâche "${todo.title}" a été supprimée`, }); } }, updateFilter(filter: TodoFilter) { patchState(store, { filter }); - } + }, })), - withHooks(store => ({ + withHooks((store) => ({ onInit() { - store.loadAll() - } - })) + store.loadAll(); + }, + })), ); diff --git a/src/app/features/todo/todo.html b/src/app/features/todo/todo.html index d2cf8aa..c27de37 100644 --- a/src/app/features/todo/todo.html +++ b/src/app/features/todo/todo.html @@ -11,7 +11,11 @@

Mes Tâches

-
@@ -31,83 +35,90 @@

Mes Tâches

- +
@if (store.filteredTodos().length === 0) { - -
-
- + +
+
+ +
+

+ @if (filter() === 'all') { + Aucune tâche pour le moment + } @else if (filter() === 'pending') { + Aucune tâche en cours + } @else { + Aucune tâche terminée + } +

+

+ @if (filter() === 'all') { + Commencez par ajouter une nouvelle tâche ci-dessus + } @else { + Essayez un autre filtre pour voir vos tâches + } +

-

- @if (filter() === 'all') { - Aucune tâche pour le moment - } @else if (filter() === 'pending') { - Aucune tâche en cours - } @else { - Aucune tâche terminée - } -

-

- @if (filter() === 'all') { - Commencez par ajouter une nouvelle tâche ci-dessus - } @else { - Essayez un autre filtre pour voir vos tâches - } -

-
} @else { - -
    - @for (todo of store.filteredTodos(); track todo.id) { -
  • -
    - -
    - -
    + +
      + @for (todo of store.filteredTodos(); track todo.id) { +
    • +
      + +
      + +
      - -
      -

      - {{ todo.title }} -

      -
      + +
      +

      + {{ todo.title }} +

      +
      - -
      - - - -
      -
      -
    • - } -
    + +
    + + + +
    +
    +
  • + } +
}
@if (store.todos().length > 0) { -
-
-
- {{ completedCount() }} terminée{{ completedCount() > 1 ? 's' : '' }} -
-
-
- {{ pendingTotalCount() }} en cours +
+
+
+ {{ completedCount() }} terminée{{ completedCount() > 1 ? 's' : '' }} +
+
+
+ {{ pendingTotalCount() }} en cours +
-
}
diff --git a/src/app/features/todo/todo.ts b/src/app/features/todo/todo.ts index ed0ecd1..1b7fd5e 100644 --- a/src/app/features/todo/todo.ts +++ b/src/app/features/todo/todo.ts @@ -28,17 +28,11 @@ export default class Todo implements OnInit { { label: 'Terminé', value: 'completed' }, ]); - pendingCount = computed(() => - this.store.filteredTodos().filter(t => !t.completed).length - ); + pendingCount = computed(() => this.store.filteredTodos().filter((t) => !t.completed).length); - completedCount = computed(() => - this.store.todos().filter(t => t.completed).length - ); + completedCount = computed(() => this.store.todos().filter((t) => t.completed).length); - pendingTotalCount = computed(() => - this.store.todos().filter(t => !t.completed).length - ); + pendingTotalCount = computed(() => this.store.todos().filter((t) => !t.completed).length); ngOnInit(): void { this.filter.set(this.store.filter()); diff --git a/src/app/shared/appSate/app-state-store.ts b/src/app/shared/appSate/app-state-store.ts index a8a06ee..35f082d 100644 --- a/src/app/shared/appSate/app-state-store.ts +++ b/src/app/shared/appSate/app-state-store.ts @@ -1,29 +1,29 @@ -import { computed, inject } from "@angular/core"; -import { patchState, signalStore, withComputed, withMethods, withState } from "@ngrx/signals"; -import { firstValueFrom } from "rxjs"; +import { computed, inject } from '@angular/core'; +import { patchState, signalStore, withComputed, withMethods, withState } from '@ngrx/signals'; +import { firstValueFrom } from 'rxjs'; -import { AppStateApi } from "./app-state-api"; -import { Settings } from "./model/settings.model"; -import { User } from "./model/user.model"; +import { AppStateApi } from './app-state-api'; +import { Settings } from './model/settings.model'; +import { User } from './model/user.model'; export interface AppState { - user: Partial, - settings: Settings + user: Partial; + settings: Settings; } const initialAppState: AppState = { user: {}, settings: { - availableLanguages: ["fr"], - currentLanguage: "fr", - } -} + availableLanguages: ['fr'], + currentLanguage: 'fr', + }, +}; export const AppStateStore = signalStore( { providedIn: 'root' }, withState(initialAppState), withComputed((store) => ({ - isConnected: computed(() => 'id' in store.user()) + isConnected: computed(() => 'id' in store.user()), })), withMethods((store, appStateApi = inject(AppStateApi)) => ({ async loadSettings() { @@ -31,10 +31,10 @@ export const AppStateStore = signalStore( patchState(store, { user: {}, settings }); }, login(user: User) { - patchState(store, { user }) + patchState(store, { user }); }, logout() { - patchState(store, { user: {}}) - } - })) + patchState(store, { user: {} }); + }, + })), ); diff --git a/src/app/shared/appSate/model/user.data.ts b/src/app/shared/appSate/model/user.data.ts index 9c48560..f4a5591 100644 --- a/src/app/shared/appSate/model/user.data.ts +++ b/src/app/shared/appSate/model/user.data.ts @@ -1,8 +1,8 @@ -import { User } from "./user.model"; +import { User } from './user.model'; export const userData: User = { id: 1, - firstName: "John", - lastName: "Doe", - username: "admin" -} + firstName: 'John', + lastName: 'Doe', + username: 'admin', +}; diff --git a/src/app/shared/component/paginator.ts b/src/app/shared/component/paginator.ts index 2b3bcfa..6448e2c 100644 --- a/src/app/shared/component/paginator.ts +++ b/src/app/shared/component/paginator.ts @@ -17,7 +17,6 @@ import { Pager } from '../store/paginator-feature'; `, }) export class PaginatorComponent { - pager = input.required(); total = input.required(); diff --git a/src/app/shared/interceptor/http-response-error-interceptor.ts b/src/app/shared/interceptor/http-response-error-interceptor.ts index 0c4959b..28e24d4 100644 --- a/src/app/shared/interceptor/http-response-error-interceptor.ts +++ b/src/app/shared/interceptor/http-response-error-interceptor.ts @@ -7,12 +7,14 @@ export const httpResponseErrorInterceptor: HttpInterceptorFn = (req, next) => { const messageService = inject(MessageService); return next(req).pipe( catchError((error: HttpErrorResponse) => { - messageService.add({ severity: "error", summary: "Http response error" }) + messageService.add({ severity: 'error', summary: 'Http response error' }); - return of(new HttpResponse({ - body: undefined, - status: error.status - })); - }) + return of( + new HttpResponse({ + body: undefined, + status: error.status, + }), + ); + }), ); }; diff --git a/src/app/shared/layout/layout.service.ts b/src/app/shared/layout/layout.service.ts index e194ff9..2317463 100644 --- a/src/app/shared/layout/layout.service.ts +++ b/src/app/shared/layout/layout.service.ts @@ -2,9 +2,9 @@ import { Service, signal } from '@angular/core'; @Service() export class LayoutService { - sidebarExpanded = signal(false); + sidebarExpanded = signal(false); - toggleSidebar() { - this.sidebarExpanded.update((v) => !v); - } + toggleSidebar() { + this.sidebarExpanded.update((v) => !v); + } } diff --git a/src/app/shared/model/es-result.ts b/src/app/shared/model/es-result.ts index 55541c3..088f20e 100644 --- a/src/app/shared/model/es-result.ts +++ b/src/app/shared/model/es-result.ts @@ -1,20 +1,20 @@ export interface EsRecord { created: string; id: string; - links: Links - metadata: unknown, + links: Links; + metadata: unknown; updated: string; } export interface EsResult { - aggregations: Record, + aggregations: Record; hits: { - hits: EsRecord[], + hits: EsRecord[]; total: { relation: string; value: number; - } - }, + }; + }; links: Links; } @@ -26,15 +26,15 @@ export interface Links { } export const EsResultInitialState: EsResult = { - aggregations: {}, - hits: { - hits: [], - total: { - relation: 'eq', - value: 0 - } + aggregations: {}, + hits: { + hits: [], + total: { + relation: 'eq', + value: 0, }, - links: { - self: '' - } + }, + links: { + self: '', + }, }; diff --git a/src/app/shared/page-title-strategy.spec.ts b/src/app/shared/page-title-strategy.spec.ts index c2b8048..bc81cb8 100644 --- a/src/app/shared/page-title-strategy.spec.ts +++ b/src/app/shared/page-title-strategy.spec.ts @@ -12,10 +12,7 @@ describe('PageTitleStrategy', () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [ - PageTitleStrategy, - { provide: TitleStrategy, useExisting: PageTitleStrategy }, - ], + providers: [PageTitleStrategy, { provide: TitleStrategy, useExisting: PageTitleStrategy }], }); strategy = TestBed.inject(PageTitleStrategy); titleService = TestBed.inject(Title); diff --git a/src/app/shared/page-title-strategy.ts b/src/app/shared/page-title-strategy.ts index d6c355f..d184b87 100644 --- a/src/app/shared/page-title-strategy.ts +++ b/src/app/shared/page-title-strategy.ts @@ -1,6 +1,6 @@ -import { inject, Service } from "@angular/core"; -import { Title } from "@angular/platform-browser"; -import { RouterStateSnapshot, TitleStrategy } from "@angular/router"; +import { inject, Service } from '@angular/core'; +import { Title } from '@angular/platform-browser'; +import { RouterStateSnapshot, TitleStrategy } from '@angular/router'; @Service({ autoProvided: false }) export class PageTitleStrategy extends TitleStrategy { diff --git a/src/app/shared/store/paginator-feature.spec.ts b/src/app/shared/store/paginator-feature.spec.ts index 0f3d22a..0223c64 100644 --- a/src/app/shared/store/paginator-feature.spec.ts +++ b/src/app/shared/store/paginator-feature.spec.ts @@ -24,9 +24,7 @@ describe('withPaginator()', () => { it('changes page correctly when rows stay the same', () => { const store = createStore(); - TestBed.runInInjectionContext(() => - store.changePage({ page: 1, rows: 10, first: 11, pageCount: 5 }) - ); + TestBed.runInInjectionContext(() => store.changePage({ page: 1, rows: 10, first: 11, pageCount: 5 })); expect(store.pager().page).toBe(2); expect(store.pager().first).toBe(11); expect(store.pager().rows).toBe(10); @@ -34,9 +32,7 @@ describe('withPaginator()', () => { it('resets to first page when rows per page changes', () => { const store = createStore(); - TestBed.runInInjectionContext(() => - store.changePage({ page: 2, rows: 25, first: 51, pageCount: 5 }) - ); + TestBed.runInInjectionContext(() => store.changePage({ page: 2, rows: 25, first: 51, pageCount: 5 })); expect(store.pager().page).toBe(1); expect(store.pager().first).toBe(1); expect(store.pager().rows).toBe(25); @@ -44,17 +40,13 @@ describe('withPaginator()', () => { it('preserves rowsPerPageOptions when changing page', () => { const store = createStore(); - TestBed.runInInjectionContext(() => - store.changePage({ page: 1, rows: 10, first: 11, pageCount: 5 }) - ); + TestBed.runInInjectionContext(() => store.changePage({ page: 1, rows: 10, first: 11, pageCount: 5 })); expect(store.pager().rowsPerPageOptions).toEqual([10, 25, 50]); }); it('handles page 0 (first page) correctly', () => { const store = createStore(); - TestBed.runInInjectionContext(() => - store.changePage({ page: 0, rows: 10, first: 1, pageCount: 5 }) - ); + TestBed.runInInjectionContext(() => store.changePage({ page: 0, rows: 10, first: 1, pageCount: 5 })); expect(store.pager().page).toBe(1); expect(store.pager().first).toBe(1); }); @@ -62,7 +54,7 @@ describe('withPaginator()', () => { it('falls back to initial rows when event rows is undefined', () => { const store = createStore(); TestBed.runInInjectionContext(() => - store.changePage({ page: 2, rows: undefined as unknown as number, first: 21, pageCount: 5 }) + store.changePage({ page: 2, rows: undefined as unknown as number, first: 21, pageCount: 5 }), ); expect(store.pager().rows).toBe(defaultPager.rows); }); diff --git a/src/app/shared/store/paginator-feature.ts b/src/app/shared/store/paginator-feature.ts index 737dc3d..cf8f59e 100644 --- a/src/app/shared/store/paginator-feature.ts +++ b/src/app/shared/store/paginator-feature.ts @@ -1,5 +1,5 @@ -import { patchState, signalMethod, signalStoreFeature, withMethods, withState } from "@ngrx/signals"; -import { PaginatorState } from "@openng/optimus-ui/paginator"; +import { patchState, signalMethod, signalStoreFeature, withMethods, withState } from '@ngrx/signals'; +import { PaginatorState } from '@openng/optimus-ui/paginator'; export interface Pager { page: number; @@ -15,10 +15,10 @@ export interface Paginator { export function withPaginator(pager: Pager) { return signalStoreFeature( withState({ - pager: pager + pager: pager, }), withMethods((store) => ({ - changePage: signalMethod(event => { + changePage: signalMethod((event) => { if (event.rows !== store.pager.rows()) { event.page = 0; event.first = 1; @@ -27,11 +27,11 @@ export function withPaginator(pager: Pager) { pager: { page: (event.page || 0) + 1, first: (event.page || 0) * (event.rows || pager.rows) + 1, - rows: (event.rows || pager.rows), - rowsPerPageOptions: store.pager().rowsPerPageOptions - } + rows: event.rows || pager.rows, + rowsPerPageOptions: store.pager().rowsPerPageOptions, + }, }); }), - })) + })), ); } diff --git a/src/app/shared/store/request-status-feature.spec.ts b/src/app/shared/store/request-status-feature.spec.ts index 70f6c48..1f70aff 100644 --- a/src/app/shared/store/request-status-feature.spec.ts +++ b/src/app/shared/store/request-status-feature.spec.ts @@ -1,13 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { patchState, signalStore, withMethods } from '@ngrx/signals'; -import { - RequestStatus, - setError, - setFulfilled, - setPending, - withRequestStatus, -} from './request-status-feature'; +import { RequestStatus, setError, setFulfilled, setPending, withRequestStatus } from './request-status-feature'; const TestStore = signalStore( withRequestStatus(), @@ -15,7 +9,7 @@ const TestStore = signalStore( setStatus(status: RequestStatus) { patchState(store, { requestStatus: status }); }, - })) + })), ); describe('request-status-feature', () => { @@ -74,9 +68,7 @@ describe('request-status-feature', () => { }); it('error returns the error message when status is an error object', () => { - TestBed.runInInjectionContext(() => - store.setStatus({ error: 'network error' }) - ); + TestBed.runInInjectionContext(() => store.setStatus({ error: 'network error' })); expect(store.error()).toBe('network error'); expect(store.isPending()).toBe(false); expect(store.isFulfilled()).toBe(false); diff --git a/src/app/shared/store/request-status-feature.ts b/src/app/shared/store/request-status-feature.ts index 100d43e..edfeba4 100644 --- a/src/app/shared/store/request-status-feature.ts +++ b/src/app/shared/store/request-status-feature.ts @@ -1,24 +1,26 @@ -import { computed } from "@angular/core"; -import { signalStoreFeature, withComputed, withState } from "@ngrx/signals"; +import { computed } from '@angular/core'; +import { signalStoreFeature, withComputed, withState } from '@ngrx/signals'; export type RequestStatus = 'idle' | 'pending' | 'fulfilled' | { error: string }; -export interface RequestStatusState { requestStatus: RequestStatus } +export interface RequestStatusState { + requestStatus: RequestStatus; +} export function withRequestStatus() { return signalStoreFeature( - withState({requestStatus: 'idle'}), + withState({ requestStatus: 'idle' }), withComputed(({ requestStatus }) => { return { isPending: computed(() => requestStatus() === 'pending'), isFulfilled: computed(() => requestStatus() === 'fulfilled'), error: computed(() => { const status = requestStatus(); - return (typeof status === 'object') ? status.error : null; - }) - } - }) - ) + return typeof status === 'object' ? status.error : null; + }), + }; + }), + ); } export function setPending(): RequestStatusState { diff --git a/src/index.html b/src/index.html index 0bf70db..c9a9003 100644 --- a/src/index.html +++ b/src/index.html @@ -1,13 +1,13 @@ - - - Angular POC - - - - - - - + + + Angular POC + + + + + + + diff --git a/src/main.ts b/src/main.ts index 92975ea..2fb39d2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,5 +3,4 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { App } from './app/app'; import { appConfig } from './app/app.config'; -bootstrapApplication(App, appConfig) - .catch((err) => console.error(err)); +bootstrapApplication(App, appConfig).catch((err) => console.error(err)); diff --git a/tsconfig.app.json b/tsconfig.app.json index e23df31..16e5822 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -7,11 +7,6 @@ "rootDir": "./src", "types": [] }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "src/**/*.spec.ts", - "src/test-setup.ts" - ] + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.spec.ts", "src/test-setup.ts"] } diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 0224d45..fb20455 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -5,11 +5,6 @@ "rootDir": "./src", "types": ["vitest/globals", "node"] }, - "files": [ - "src/test-setup.ts" - ], - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] + "files": ["src/test-setup.ts"], + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] } diff --git a/vite.config.mts b/vite.config.mts index 0472280..c0435a6 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,5 +1,5 @@ -import angular from '@analogjs/vite-plugin-angular'; import { resolve } from 'path'; +import angular from '@analogjs/vite-plugin-angular'; import { defineConfig } from 'vitest/config'; export default defineConfig({