@dsivd/prestations-ng 19.2.0-beta.3 → 19.2.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_GUIDELINES.md +152 -0
- package/ANGULAR_SIGNALS.md +6 -2
- package/CHANGELOG.md +476 -0
- package/CONTRIBUTING.md +128 -8
- package/ESLINT_PLUGIN.md +262 -30
- package/GOOD_PRACTICES.md +983 -388
- package/INTRODUCTION_ANGULAR_SIGNALS.md +227 -155
- package/README.md +22 -12
- package/UPGRADING_V18.md +5 -5
- package/UPGRADING_V19.md +636 -19
- package/eslint/configs/spec-ts-recommended.mjs +34 -0
- package/eslint/configs/template-recommended.mjs +2 -0
- package/eslint/configs/template-rules.mjs +14 -2
- package/eslint/configs/ts-recommended.mjs +11 -0
- package/eslint/configs/ts-rules.mjs +6 -2
- package/eslint/form-reads.mjs +63 -0
- package/eslint/index.mjs +17 -0
- package/eslint/rules/index.mjs +6 -0
- package/eslint/rules/no-direct-signal-mutation.mjs +162 -41
- package/eslint/rules/no-item-track-in-form-list.mjs +173 -0
- package/eslint/rules/no-uninvoked-signal-in-template.mjs +8 -3
- package/eslint/rules/require-model-change.mjs +89 -0
- package/eslint/rules/require-track-index.mjs +162 -0
- package/eslint/signal-names.mjs +127 -21
- package/eslint/template-ast.mjs +12 -2
- package/fesm2022/dsivd-prestations-ng.mjs +2889 -2061
- package/fesm2022/dsivd-prestations-ng.mjs.map +1 -1
- package/package.json +1 -2
- package/schematics/migration-collection.json +5 -0
- package/schematics/ng-add/index.js +2 -4
- package/schematics/ng-update/migrations/update-13_2_0/index.js +7 -2
- package/schematics/ng-update/migrations/update-19_2_0/index.js +52 -0
- package/schematics/utility/add-allowed-common-js-dependencies.js +39 -29
- package/schematics/utility/form-signal/class-migration.js +795 -0
- package/schematics/utility/form-signal/edits.js +34 -0
- package/schematics/utility/form-signal/form-members.js +318 -0
- package/schematics/utility/form-signal/form-signal-migration.js +134 -0
- package/schematics/utility/form-signal/page-classes.js +139 -0
- package/schematics/utility/form-signal/template-migration.js +775 -0
- package/schematics/utility/never-connected-migration.js +87 -0
- package/schematics/utility/remove-emit-decorator-metadata.js +8 -9
- package/schematics/utility/typescript-files.js +95 -0
- package/src/eslint/configs/__tests__/configs.test.mjs +61 -2
- package/src/eslint/configs/spec-ts-recommended.mjs +34 -0
- package/src/eslint/configs/template-recommended.mjs +2 -0
- package/src/eslint/configs/template-rules.mjs +14 -2
- package/src/eslint/configs/ts-recommended.mjs +11 -0
- package/src/eslint/configs/ts-rules.mjs +6 -2
- package/src/eslint/form-reads.mjs +63 -0
- package/src/eslint/index.mjs +17 -0
- package/src/eslint/rules/__tests__/no-direct-signal-mutation.test.mjs +200 -0
- package/src/eslint/rules/__tests__/no-item-track-in-form-list.test.mjs +234 -0
- package/src/eslint/rules/__tests__/no-uninvoked-signal-in-template.test.mjs +6 -0
- package/src/eslint/rules/__tests__/require-model-change.test.mjs +93 -0
- package/src/eslint/rules/__tests__/require-track-index.test.mjs +106 -0
- package/src/eslint/rules/index.mjs +6 -0
- package/src/eslint/rules/no-direct-signal-mutation.mjs +162 -41
- package/src/eslint/rules/no-item-track-in-form-list.mjs +173 -0
- package/src/eslint/rules/no-uninvoked-signal-in-template.mjs +8 -3
- package/src/eslint/rules/require-model-change.mjs +89 -0
- package/src/eslint/rules/require-track-index.mjs +162 -0
- package/src/eslint/signal-names.mjs +127 -21
- package/src/eslint/template-ast.mjs +12 -2
- package/types/dsivd-prestations-ng.d.ts +719 -243
- package/dsivd-prestations-ng-19.2.0-beta.3.tgz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,11 +8,469 @@
|
|
|
8
8
|
|
|
9
9
|
## [19.2.0] - should be aligned with prestations-be 19.2.x
|
|
10
10
|
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Public helpers `AbstractHttpService` for reporting HTTP failures with a danger growl and
|
|
14
|
+
`downloadFile` for saving browser-generated or server-provided data under a chosen filename.
|
|
15
|
+
|
|
16
|
+
- [AI_GUIDELINES.md](AI_GUIDELINES.md) (since 19.2.0-beta.27): the rules an AI assistant follows in a project using
|
|
17
|
+
the library (the form of a page, the types of the fields, the components extending `FoehnInputComponent`, signals,
|
|
18
|
+
TypeScript, tests), published with it for the version installed. The rules depending on the optional steps of the
|
|
19
|
+
migration are marked _strict_ or _zoneless_. Import it into the instructions of your assistant as soon as the
|
|
20
|
+
library is installed, e.g. `@../front/node_modules/@dsivd/prestations-ng/AI_GUIDELINES.md` in the
|
|
21
|
+
`.claude/CLAUDE.md` of your project: see
|
|
22
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#instructions-for-your-ai-assistant-since-1920).
|
|
23
|
+
|
|
24
|
+
- [object-path.helper.ts](projects/prestations-ng/src/helpers/object-path.helper.ts)
|
|
25
|
+
- New `ObjectPathHelper`: reads and writes a value at a path of any object, without modifying it: a write copies
|
|
26
|
+
the objects and arrays along the path (with their prototype), keeps the others as they are, and gives the object
|
|
27
|
+
itself when the value is already there.
|
|
28
|
+
- `get(object, path)`, `patch(object, path, value)` and `patchSignal(signal, path, value)` (for a signal holding
|
|
29
|
+
an object: its readers are notified only when the value changes) take a path checked by TypeScript, typed with
|
|
30
|
+
the new `ObjectPath<T>` (`['address', 'street']`, `['children', 0, 'firstName']`, the paths of each member of a
|
|
31
|
+
union) and `ObjectPathValue<T, P>`.
|
|
32
|
+
- `getByKeys(object, keys)` and `patchByKeys(object, keys, value)` take keys known at runtime only
|
|
33
|
+
(`'address.street'`, or a list of keys), not checked.
|
|
34
|
+
- `patchForm()`, `patchItem()`, `PendingUploadService`, the custom errors of the street of `foehn-input-address`
|
|
35
|
+
and the elements of `foehn-select`, `foehn-radio`, `foehn-checkbox` and the autocompletes use it.
|
|
36
|
+
- `FoehnInputComponent.patchNgModel(path, value)` (since 19.2.0-beta.22): writes a value at a typed path of the
|
|
37
|
+
model, in a new model given to `updateNgModel()`, e.g.
|
|
38
|
+
`[model]="model()?.lastName" (modelChange)="patchNgModel(['lastName'], $event)"` in a component editing an object
|
|
39
|
+
as is, or `(modelChange)="patchNgModel([i], $event)"` on the items of a list. The new protected `emptyModel()`
|
|
40
|
+
gives the model it starts from when the page gives none (none by default: `patchNgModel()` then throws). See
|
|
41
|
+
"Editing an object field by field" in [GOOD_PRACTICES.md](GOOD_PRACTICES.md).
|
|
42
|
+
- `ng update` migration of 19.2.0: migrates your pages to their form and their reference held by signals, their
|
|
43
|
+
classes and their templates (see the 🚨 entries below and
|
|
44
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#the-form-of-your-pages-is-a-signal-since-1920)). It lists what it can't
|
|
45
|
+
migrate, and running it again changes nothing. Since 19.2.0-beta.29, it also writes with `patchForm()` through a
|
|
46
|
+
getter of the page returning a path of the form (`this.step.motif = x`, `[(model)]="step.motif"` with
|
|
47
|
+
`get step() { return this.form.etape; }`, in the page or in a page it extends), and lists the writes through a
|
|
48
|
+
getter computing its value, the `effect()`s reading the form (directly or through a method: they run again at every
|
|
49
|
+
input of the user) and the methods writing the form called by the template outside an event (NG0600 while the view
|
|
50
|
+
is rendered).
|
|
51
|
+
- 🚨 ESLint rules [`require-model-change`](ESLINT_PLUGIN.md#require-model-change) and
|
|
52
|
+
[`no-item-track-in-form-list`](ESLINT_PLUGIN.md#no-item-track-in-form-list), in `configs.templateRules` and
|
|
53
|
+
`configs.templateRecommended`: a one-way `[model]` reading the form without `(modelChange)` (the input of the user
|
|
54
|
+
is lost; a component always disabled, `foehn-input-hidden`, `foehn-table` and a component listening to
|
|
55
|
+
`(userInput)` excepted), and a `@for` over a list of the form tracked by its item while its rows edit it (the field loses the focus
|
|
56
|
+
at every input). Since 19.2.0-beta.22, `no-item-track-in-form-list` also reports the list held by the `model` of a
|
|
57
|
+
component, and a row reading its item at its index (`[model]="model()[i]"`).
|
|
58
|
+
- 🚨 ESLint rule [`require-track-index`](ESLINT_PLUGIN.md#require-track-index) (since 19.2.0-beta.28), in
|
|
59
|
+
`configs.templateRules` and `configs.templateRecommended`: a `@for` whose rows name their fields (or the
|
|
60
|
+
`errorPrefix` of `foehn-error-pill`) with the index of the row must track them by `$index`. Tracked by an identifier,
|
|
61
|
+
a row whose item moves (an item removed before it, the list sorted) keeps the names of its former position:
|
|
62
|
+
`foehn-form` keeps its fields registered under them, and the values and the errors of the rows get mixed up. To turn
|
|
63
|
+
it off: `'@dsivd/prestations-ng/require-track-index': 'off'`.
|
|
64
|
+
|
|
65
|
+
- [foehn-date-model.type.ts](projects/prestations-ng/src/foehn-input-date/foehn-date-model.type.ts)
|
|
66
|
+
- New `FoehnDateModel` type, the model of `foehn-input-date` (`(number | null)[]`, the JSON of a
|
|
67
|
+
`LenientLocalDate` of prestations-be), to type the date fields of your forms, e.g.
|
|
68
|
+
`birthDate: FoehnDateModel | null = null;`.
|
|
69
|
+
- `DateHelper.isValid()`, `isToday()` and `toDayjsFromNumberArray()` accept it, `null` and `undefined`
|
|
70
|
+
included: no cast in a strict project. A date with a part not entered is still neither valid nor today, and
|
|
71
|
+
gives `null`.
|
|
72
|
+
- [foehn-date-time-model.type.ts](projects/prestations-ng/src/foehn-input-date-time/foehn-date-time-model.type.ts)
|
|
73
|
+
- New `FoehnDateTimeModel` type, the model of `foehn-input-date-time` (`(number | null)[]`: year, month, day,
|
|
74
|
+
hour, minute, the JSON of a `LenientLocalDateTime` of prestations-be).
|
|
75
|
+
- The `displayDate` pipe, `DateHelper.toDateFromNumberArray()`, `arrayToDisplayDateDMY()`, `isValid()` and
|
|
76
|
+
`isToday()` accept it, as well as a `FoehnDateModel`. The new `DateHelper.hasTime()` tells whether a date-time
|
|
77
|
+
has its time entered.
|
|
78
|
+
`DateHelper.leftPad()` accepts `null` and `undefined` (it already returned `''`).
|
|
79
|
+
- [eslint/configs/spec-ts-recommended.mjs](projects/prestations-ng/src/eslint/configs/spec-ts-recommended.mjs)
|
|
80
|
+
- New `prestationsNg.configs.specTsRecommended` ESLint config for the Vitest specs, to use in the `extends` of a
|
|
81
|
+
`**/*.spec.ts` block: the `recommended` config of `@vitest/eslint-plugin`, which also counts the assertions of
|
|
82
|
+
the `HttpTestingController` and of the helpers of the specs. It needs `@vitest/eslint-plugin` in the
|
|
83
|
+
devDependencies of your project, only when you use it: 1.6.27 with the TypeScript 5.9 of Angular 21, later
|
|
84
|
+
versions need TypeScript 6. See
|
|
85
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#migrate-to-eslint-flat-configuration).
|
|
86
|
+
- [foehn-bo-multi-upload.component.ts](projects/prestations-ng/src/foehn-upload/foehn-bo-multi-upload/foehn-bo-multi-upload.component.ts)
|
|
87
|
+
- New `localUpload` input. When set to `true`, selected files are kept purely local
|
|
88
|
+
(as `DocumentReferenceWithFile`, no `uploadUrl()` call) so they can be cancelled before
|
|
89
|
+
being sent. Files show up immediately in the list with a "pending" indicator (dictionary
|
|
90
|
+
key `foehn-uploader.pending-label`, French default provided) since they're not uploaded
|
|
91
|
+
yet. It is your responsibility to upload/delete them at save time,
|
|
92
|
+
e.g. via the new
|
|
93
|
+
[document-changes.helper.ts](projects/prestations-ng/src/foehn-upload/document-changes.helper.ts)
|
|
94
|
+
(`splitDocumentChanges`) which computes `filesToAdd`/`documentsToDelete` from the model.
|
|
95
|
+
- The default (direct upload) mode is unchanged.
|
|
96
|
+
- New `maxFileSizeInMo` input: a client-side, per-file size limit that doesn't depend on
|
|
97
|
+
the `fileMaxSizeInBytesByFormKey` server configuration (useful for consumers that don't
|
|
98
|
+
expose that config yet). When both are set, the smallest limit applies. A file too big gets
|
|
99
|
+
the usual `413` error, which can be customized with `customErrors` (`{fileName}`,
|
|
100
|
+
`{fileMaxSize}`).
|
|
101
|
+
- New `chooseButtonStyleModifier` input, appended to the choose button's CSS classes
|
|
102
|
+
(e.g. `btn-sm`), mirroring the same input already available on other uploaders.
|
|
103
|
+
|
|
104
|
+
- [foehn-input-address.component.ts](projects/prestations-ng/src/foehn-address/foehn-input-address.component.ts)
|
|
105
|
+
- Added `streetAllowCustomValue` input to control whether the street field allows custom values (defaults to `true`).
|
|
106
|
+
- Added `swissNpaLocalityBaseUrl` input to control the base URL for Swiss NPA localities (defaults to `'api/refinf/locality'`).
|
|
107
|
+
|
|
108
|
+
- [foehn-navigation.component.html](projects/prestations-ng/src/foehn-navigation/foehn-navigation/foehn-navigation.component.html)
|
|
109
|
+
- [foehn-simple-navigation.component.html](projects/prestations-ng/src/foehn-navigation/foehn-simple-navigation/foehn-simple-navigation.component.html)
|
|
110
|
+
- while the page targeted by "next", "transmit" or "previous" is loading for more than 200 ms (e.g. lazy loaded
|
|
111
|
+
route), the clicked button displays a spinner with the new `loadingLabel` input (dictionary key
|
|
112
|
+
`foehn-navigation.loading.label`, "Chargement...") and the navigation buttons are disabled (`aria-disabled`;
|
|
113
|
+
clicks are ignored from the start of the navigation); a live `output` region announces the loading to screen
|
|
114
|
+
readers (also in 18.3.15)
|
|
115
|
+
- this state is exposed by read-only signals: `pendingNavigationDirection`, `loadingDirection`, `isNavigating`,
|
|
116
|
+
`isLoading`, `isLoadingNext` and `isLoadingPrevious`
|
|
117
|
+
- [foehn-navigation.service.ts](projects/prestations-ng/src/foehn-navigation/foehn-navigation.service.ts)
|
|
118
|
+
- new method `pendingNavigationDirection()`: direction of the navigation started with `next()` or `previous()`
|
|
119
|
+
until it ends, `null` otherwise (also in 18.3.15)
|
|
120
|
+
- [form-error.helper.ts](projects/prestations-ng/src/validation/form-error.helper.ts) and
|
|
121
|
+
[validation-handler.service.ts](projects/prestations-ng/src/validation/validation-handler.service.ts) (since
|
|
122
|
+
19.2.0-beta.29)
|
|
123
|
+
- new `FormErrorHelper.withoutListItem(errors, itemPath)`: the errors left once the item at `itemPath` (e.g.
|
|
124
|
+
`'hearings[0].exchanges[1]'`) is removed from its list, in a new array: its errors are dropped, and those of the
|
|
125
|
+
following items take the new index of their item, the items of their nested lists included
|
|
126
|
+
- new method `ValidationHandlerService.removeListItemErrors(itemPath)`: applies it to the errors given to
|
|
127
|
+
`updateErrors()` and publishes them. For a page keeping the errors of the server until its next save (e.g. a
|
|
128
|
+
back office) when it removes an item of a list whose fields are named with the index: the errors of the
|
|
129
|
+
following items would otherwise stay on their former index. No component of the library calls it. See
|
|
130
|
+
"Avoiding error display problems in a `@for` loop" in [GOOD_PRACTICES.md](GOOD_PRACTICES.md).
|
|
131
|
+
|
|
11
132
|
### Changed
|
|
12
133
|
|
|
13
134
|
Library now runs as strict mode, which may cause some errors to appear in your project after updating.
|
|
14
135
|
Please check the [UPGRADING_V19.md](UPGRADING_V19.md) guide for more information.
|
|
15
136
|
|
|
137
|
+
- [foehn-list-summary.component.ts](projects/prestations-ng/src/foehn-menu-prestation/foehn-list-summary/foehn-list-summary.component.ts)
|
|
138
|
+
- `FoehnListSummaryComponent` is now generic: `FoehnListSummaryComponent<T extends FoehnListItem>`,
|
|
139
|
+
so the model, `getListItemTitle` and `listItemDescriptions` are typed with your own item class
|
|
140
|
+
instead of the base `FoehnListItem`
|
|
141
|
+
- The rows are tracked by their index (since 19.2.0-beta.28), as the prefix of their errors: sorted, a row no
|
|
142
|
+
longer keeps the errors of its former position. `trackFoehnListItem` returns the index, and the id of a row is
|
|
143
|
+
`list-summary-<its position from 1>` instead of `list-summary-<its trackingIndex>`.
|
|
144
|
+
- [foehn-list-item.ts](projects/prestations-ng/src/foehn-menu-prestation/foehn-list-summary/foehn-list-item.ts)
|
|
145
|
+
- 🚨 `FoehnListItem.trackingIndex` is removed (since 19.2.0-beta.28): the library tracks the rows of a list by
|
|
146
|
+
their index (`require-track-index`). `AbstractListDetailPageComponent` no longer sets it on a new item, and its
|
|
147
|
+
`getNextTrackingIndex()` is removed. A project whose backend needs the field declares it in its item class and
|
|
148
|
+
sets it in `getNewListItem()` (see UPGRADING_V19.md).
|
|
149
|
+
- [foehn-list-item-description.ts](projects/prestations-ng/src/foehn-menu-prestation/foehn-list-summary/foehn-list-item-description.ts)
|
|
150
|
+
- 🚨 `FoehnListItemDescription` now takes a type parameter: `FoehnListItemDescription<T>`.
|
|
151
|
+
`getFormattedValue(item: T)` and `hideIfEmpty(item: T)` receive your item type directly, no cast needed.
|
|
152
|
+
Replace `FoehnListItemDescription[]` with `FoehnListItemDescription<MyItem>[]` in your project.
|
|
153
|
+
- [uploader.helper.ts](projects/prestations-ng/src/foehn-upload/uploader.helper.ts)
|
|
154
|
+
- 🚨 `UploaderHelper.addCustomErrorOrDefault()` takes the limits of the uploader in an object (`UploaderErrorLimits`,
|
|
155
|
+
all optional) instead of its last three parameters:
|
|
156
|
+
`addCustomErrorOrDefault(name, errors, errorCode, fileName, customErrors, { overrideAcceptedExtensions, overrideMaxFileNameLength, overrideIllegalCharacters, maxFileSizeInMo })`.
|
|
157
|
+
The custom error 413 returned by the server now also displays the `maxFileSizeInMo` limit of
|
|
158
|
+
`foehn-bo-multi-upload`.
|
|
159
|
+
- [foehn-modal.component.ts](projects/prestations-ng/src/foehn-modal/foehn-modal.component.ts)
|
|
160
|
+
- 🚨 `modalSize` is now typed with the new `FoehnModalSize` type
|
|
161
|
+
(`'' | 'modal-sm' | 'modal-md' | 'modal-lg' | 'modal-xl'`) instead of `string`, as are `HelpModal.modalSize`
|
|
162
|
+
and therefore the `helpModal` of the `foehn-input-*` components. Other values, such as `modal-xs`, are not
|
|
163
|
+
Bootstrap classes, had no effect and no longer compile: replace them with `modal-md` to keep the same size
|
|
164
|
+
(removing them in a `HelpModal` would fall back to `modal-lg`).
|
|
165
|
+
- [foehn-table.component.ts](projects/prestations-ng/src/foehn-table/foehn-table.component.ts)
|
|
166
|
+
- 🚨 `columnsConfiguration` is now an `input()` instead of a `model()`: the table never changes it. The
|
|
167
|
+
two-way binding `[(columnsConfiguration)]` and the `columnsConfigurationChange` output no longer exist, and
|
|
168
|
+
`columnsConfiguration.set()` no longer compiles: bind it with `[columnsConfiguration]`.
|
|
169
|
+
- 🚀 **prestations-ng is now zoneless**: its components no longer need zone.js to be refreshed. They keep
|
|
170
|
+
working in an application using zone.js, and your application can now drop zone.js, see
|
|
171
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#zoneless-optional-but-recommended).
|
|
172
|
+
- the state displayed by the components is held by signals (`signal()`, `computed()`, `linkedSignal()`)
|
|
173
|
+
- what was waiting for `NgZone.onMicrotaskEmpty` or a `setTimeout()` to reach the rendered DOM (focus,
|
|
174
|
+
scroll, value displayed by the autocompletes, default values...) now uses `afterNextRender()`
|
|
175
|
+
- the short asynchronous work of the components is tracked with `PendingTasks`, so that
|
|
176
|
+
`ApplicationRef.whenStable()` (and `fixture.whenStable()` in your tests) waits for it: the debounced
|
|
177
|
+
`userInput` output of the `foehn-input-*` components, the debounced time of `foehn-input-date-time`,
|
|
178
|
+
the locale of `foehn-date-picker`, the default country and the sanitized model of `foehn-input-address`
|
|
179
|
+
- `providePrestationsNgCore()` now provides `provideBrowserGlobalErrorListeners()`: without zone.js, the
|
|
180
|
+
errors thrown in a timer or a promise still reach your `ErrorHandler`
|
|
181
|
+
- 🚨 **The inputs and outputs of the components are unchanged** (except `columnsConfiguration` of `foehn-table`,
|
|
182
|
+
see above), but the following public fields are now signals. If your code reads them (e.g. through
|
|
183
|
+
`viewChild()` or in your tests), call them (`isVisible()` instead of `isVisible`) and write them with `.set()`. Those marked _read-only_ are `computed()` signals.
|
|
184
|
+
- `foehn-agenda`: `srAnnouncements`
|
|
185
|
+
- `foehn-agenda-timeslot-panel`: `selectedTimeSlot` (_read-only_), `timeInputValue` (_read-only_), `isClosed`,
|
|
186
|
+
`timeSlots` (_read-only_), `timeslotRemaining` (_read-only_), `canClose` (_read-only_)
|
|
187
|
+
- `foehn-autocomplete`: `searchValue`, `inputHasFocus`, `hideSuggestions`, `displayedElements`,
|
|
188
|
+
`notificationMessageUpdated`, `VIEW_PORT_HEIGHT` (_read-only_)
|
|
189
|
+
- `foehn-multiselect-autocomplete`: `autocompleteInputValue`, `showEmptyListMessage` (_read-only_), `srAnnouncements`
|
|
190
|
+
- `foehn-select`, `foehn-radio`, `foehn-checkbox` and the autocompletes (`FoehnCheckableGroupComponent`):
|
|
191
|
+
`groupedElements`
|
|
192
|
+
- `foehn-radio`: `inputValue` (_read-only_)
|
|
193
|
+
- `foehn-confirm-modal`: `isVisible` (`content` is now a read-only field instead of a getter)
|
|
194
|
+
- `foehn-date-picker`: `hostId`, `weekDays`, `weeks`, `selectedDate`, `monthListItem`
|
|
195
|
+
- `foehn-dropdown-menu`: `isDropdownVisible`, `popupPosition`
|
|
196
|
+
- `foehn-header`: `connectedEsMenu` (_read-only_)
|
|
197
|
+
- `foehn-input-address`: `country`, `locality`, `street`, `houseNumber`, `postOfficeBoxText`,
|
|
198
|
+
`addressLine1`, `addressLine2` (linked to the model: they follow it and can still be set),
|
|
199
|
+
`streetCustomErrors`
|
|
200
|
+
- `foehn-input-foreign-locality`: `zipCode`, `longName` (linked to the model: they follow it and can still be set)
|
|
201
|
+
- `foehn-input-foreign-street`: `longName` (linked to the model: it follows it and can still be set)
|
|
202
|
+
- `foehn-input-date`: `day`, `month`, `year`, `datePickerModel` (linked to the model: they follow it and can
|
|
203
|
+
still be set)
|
|
204
|
+
- `foehn-input-date-time`: `date`, `time` (linked to the model: they follow it and can still be set)
|
|
205
|
+
- `foehn-input-time`: `hour`, `minute` (linked to the model: they follow it and can still be set)
|
|
206
|
+
- `foehn-input-nav13`: `part2`, `part3`, `part4` (linked to the model: they follow it and can still be set)
|
|
207
|
+
- `foehn-input-textarea`: `isCharCountExceeded`, `charCountLeft`, `charCountLabel`, `ariaLiveStatus` (all
|
|
208
|
+
_read-only_; the methods `countCharLeft()` and `checkCharCountExceeded()` are removed, the count follows the
|
|
209
|
+
model, `max` and `displayCharCount`)
|
|
210
|
+
- `foehn-list`: `currentPage`, `filteredList`
|
|
211
|
+
- `foehn-table`: `currentPage` (linked to the model, `itemsPerPage`, `fixedPageCount` and `sort`: back to the
|
|
212
|
+
first page when its page no longer exists), `filteredList` (_read-only_)
|
|
213
|
+
- `foehn-list-summary`: `listCopyForTable` (_read-only_), `tableConfiguration` (_read-only_)
|
|
214
|
+
- `foehn-notfound`: `seconds`
|
|
215
|
+
- `foehn-page`: `pageTitle`
|
|
216
|
+
- `foehn-page-counter`: `isStable` (was an `Observable<boolean>`)
|
|
217
|
+
- `foehn-page-modal`: `wrongPublicModalVisible`, `formattedPublicsCibles`
|
|
218
|
+
- `foehn-picture-upload`: `pictureToCrop`, `croppedPictureAsBlob`, `loading`
|
|
219
|
+
- `foehn-status-progress-bar`: `isTransmitted`
|
|
220
|
+
- `gesdem-action-recovery-login`: `demandeNotFound`, `rateLimited`, `rateLimitCounter`, `otpRecipient`,
|
|
221
|
+
`otp`
|
|
222
|
+
- `gesdem-action-recovery-registration`: `mailSent`, `model` (replaced by the new `updateModel()` method,
|
|
223
|
+
never mutated)
|
|
224
|
+
- `epayment-form` (`SdkEpaymentComponent`): `failureModalDisplayed`, `redirectModalDisplayed`
|
|
225
|
+
- `captcha` (`SdkRecaptchaComponent`): `isLoaded`, `hasLoadingError`
|
|
226
|
+
- `redirector` (`RedirectComponent`): `counter`
|
|
227
|
+
- 🚨 `AbstractPageComponent`: `reference` is now a signal. Read it with `reference()` in your pages and their
|
|
228
|
+
templates, and write it with `reference.set()`. A template, a `computed()` or an `effect()` reading it follows the
|
|
229
|
+
reference, also when your page sets it, without `markForCheck()`. A page declaring its own `reference` field no
|
|
230
|
+
longer compiles: remove it. The `ng update` migration rewrites your pages, see
|
|
231
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#reference-of-your-pages-is-a-signal-since-1920).
|
|
232
|
+
- 🚨 ESLint: `configs.tsRecommended` enables `@typescript-eslint/restrict-template-expressions`. A template literal
|
|
233
|
+
only takes strings, numbers, booleans, `null`, `undefined`, `any` and `RegExp`: a signal not called
|
|
234
|
+
(`` `api/${this.reference}` ``) or an object turned into text by its `toString()` is reported. See
|
|
235
|
+
[ESLINT_PLUGIN.md](ESLINT_PLUGIN.md#the-typescript-counterpart).
|
|
236
|
+
- 🚨 ESLint: `configs.tsRecommended` enables `@typescript-eslint/no-useless-constructor` (since 19.2.0-beta.26). A
|
|
237
|
+
constructor only passing its parameters to `super()`, typically the `constructor() { super(); }` left once the
|
|
238
|
+
services are injected with `inject()`, is reported: remove it. See
|
|
239
|
+
[ESLINT_PLUGIN.md](ESLINT_PLUGIN.md#a-constructor-only-calling-super) for a parent with a `protected` constructor.
|
|
240
|
+
- 🚨 `AbstractPageComponent`: `form` is now a signal (`WritableSignal<T | null | undefined>`). Read it with `form()`,
|
|
241
|
+
never modify its value in place: write it with the new `patchForm(path, value)`
|
|
242
|
+
(`[model]="form.firstName" (modelChange)="patchForm(['firstName'], $event)"`), `form.set()` or `form.update()`. A
|
|
243
|
+
template, a `computed()` or an `effect()` reading it follows every input of the user, and no `markForCheck()` is
|
|
244
|
+
needed after a write anymore. The `ng update` migration rewrites your pages, see
|
|
245
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#the-form-of-your-pages-is-a-signal-since-1920).
|
|
246
|
+
- 🚨 `AbstractListDetailPageComponent`: the abstract `getListPath()` (the path of the list in the form) replaces the
|
|
247
|
+
abstract `getList()`, which reads the list at that path. `list`, `itemIndex` and `itemToEdit` are now signals. The
|
|
248
|
+
item edited is written with the new `patchItem(path, value)`, `updateItem(update)` (several fields in one write)
|
|
249
|
+
and `setItem(item)`. A new item is added without modifying the list of the form in place.
|
|
250
|
+
- 🚨 `SessionInfo` reads the `NEVER_CONNECTED` token (since 19.2.0-beta.1): a provider
|
|
251
|
+
`{ provide: 'neverConnected', useValue: true }` is ignored without any error, and the application fetches the
|
|
252
|
+
session and displays the connected user or the login button. Provide `{ provide: NEVER_CONNECTED, useValue: true }`
|
|
253
|
+
instead. The `ng update` migration rewrites the providers, see
|
|
254
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#neverconnected-is-provided-with-never_connected-since-1920).
|
|
255
|
+
- `PendingUploadService` writes the documents uploaded with the form into a new form, instead of modifying the form
|
|
256
|
+
in place.
|
|
257
|
+
- 🚨 ESLint rule [`no-direct-signal-mutation`](ESLINT_PLUGIN.md#no-direct-signal-mutation) sees through the
|
|
258
|
+
TypeScript wrappers keeping the value: `this.form()!.name = value` and `(this.model() as Model).name = value` are
|
|
259
|
+
now reported. In a template, it sees through `!` and the parentheses, and follows the alias of an `@if`:
|
|
260
|
+
`[(model)]="form.name"` inside `@if (form(); as form)` is now reported.
|
|
261
|
+
- 🚨 ESLint rule [`no-direct-signal-mutation`](ESLINT_PLUGIN.md#getters-handing-out-the-value) (since
|
|
262
|
+
19.2.0-beta.29) follows the getters of the class returning the value of a signal or a part of it, through its
|
|
263
|
+
inheritance chain: `this.step.motif = value` and `[(model)]="step.motif"` with
|
|
264
|
+
`get step() { return this.form()!.etape; }` are now reported, as `this.form().count++` in TypeScript. Write the form
|
|
265
|
+
with `patchForm()`. To turn it off: `'@dsivd/prestations-ng/no-direct-signal-mutation': 'off'`.
|
|
266
|
+
- The lifecycle hooks that have nothing left to do are removed: `ngOnChanges()` of
|
|
267
|
+
`foehn-agenda-timeslot-panel` and `foehn-table`, `ngAfterViewInit()` of `foehn-list-summary`, `ngOnInit()` of
|
|
268
|
+
`foehn-radio` and `foehn-input-textarea`, `ngOnInit()` and `ngOnDestroy()` of `captcha`.
|
|
269
|
+
- `FoehnInputComponent.onModelChange()` does nothing by default (it set `model_`): override it only to act on a new
|
|
270
|
+
model, e.g. to normalize it. A component deriving its fields from the model with `linkedSignal()` no longer needs
|
|
271
|
+
to override it, see "Creating a reusable component" in [GOOD_PRACTICES.md](GOOD_PRACTICES.md). `model_` is set
|
|
272
|
+
by `FoehnInputComponent` alone, for every component: known once the model of the page has a value to display, then
|
|
273
|
+
following it, and staying known (`null`) when the page sets it back to `undefined`.
|
|
274
|
+
- A component which doesn't override `onModelChange()`, or calls `super.onModelChange()`, now handles `model_` as
|
|
275
|
+
those overriding it without `super` already did: it no longer replaces by `null` a model without any value to
|
|
276
|
+
display given by the page (e.g. `[]`, `''`) when it updates its model without any input of the user, and a
|
|
277
|
+
model set back to `undefined` by the page stays known.
|
|
278
|
+
- If one of your components reads the value of `model_`, not only `model_ !== undefined`: it is `undefined` as
|
|
279
|
+
long as the model of the page has had no value to display, and `null` once the page sets it back to
|
|
280
|
+
`undefined`.
|
|
281
|
+
- `FoehnInputComponent.buildId()` and `buildChildId()` return a `string`, no longer `string | null`: the `name` of a
|
|
282
|
+
component is required. Remove the `?? ''` written after them for the strict mode, which the build now reports
|
|
283
|
+
(NG8102).
|
|
284
|
+
- `modelChange` of the `foehn-input-*` components is emitted only when the component writes its model (an input of
|
|
285
|
+
the user, a correction of the model given by the page), not when the page changes the model: true since 19.0.0,
|
|
286
|
+
now documented in
|
|
287
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#modelchange-is-emitted-only-when-the-component-writes-its-model), and on the
|
|
288
|
+
Lifecycle page of the documentation, which said the opposite.
|
|
289
|
+
- `updateNgModel()` with the object or the array the model already holds emits no `modelChange` (the model is a
|
|
290
|
+
signal): true since 19.0.0, now documented in
|
|
291
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#your-components-write-a-new-model). A component modifying its model in place
|
|
292
|
+
and giving it back no longer notifies its page. The list of vehicles of [GOOD_PRACTICES.md](GOOD_PRACTICES.md) now
|
|
293
|
+
shows a complete item, its fields in linked signals, and a list which reads its `model()` and writes a new array.
|
|
294
|
+
- `FoehnInputComponent.updateNgModel()` is typed `T | null | undefined` (since 19.2.0-beta.24), as the `modelChange`
|
|
295
|
+
of a `foehn-*` component: a component wrapping a single `foehn-*` component binds it with
|
|
296
|
+
`(modelChange)="updateNgModel($event)"`, which `strictTemplates` rejected (TS2345). Nothing changes at runtime:
|
|
297
|
+
`undefined` is written as is.
|
|
298
|
+
- 🚨 The `onModelChange()` methods which were not the hook of `FoehnInputComponent` are removed or renamed (they are
|
|
299
|
+
not called by the model anymore):
|
|
300
|
+
- `foehn-date-picker-button`: `model_`, `onModelChange()` and `updateNgModel()` are removed, they had no effect
|
|
301
|
+
(`model_` was never read).
|
|
302
|
+
- `foehn-date-picker`: `model_` is removed (never read), `onModelChange()` is now private (`syncWithModel()`).
|
|
303
|
+
- `numberCurrencyFormatter`: `onModelChange()` is now private (`formatModel()`), and the directive no longer
|
|
304
|
+
listens to the `modelChange` of its host: its `effect()` already formats every model, the ones written by the
|
|
305
|
+
host were formatted twice.
|
|
306
|
+
- `SdkDictionaryService.getKeySync()` reads a signal: a `computed()` or a template calling it is refreshed
|
|
307
|
+
when the dictionary is (re)loaded, e.g. when the language changes.
|
|
308
|
+
- `foehn-autocomplete` and `foehn-multiselect-autocomplete`: the value to display, its reset, the default
|
|
309
|
+
values and the focus after a click on a suggestion are applied after the next rendering instead of in a
|
|
310
|
+
`setTimeout()`.
|
|
311
|
+
- Unit tests of the library: Karma and Jasmine are replaced by Vitest 4 in browser mode (Playwright,
|
|
312
|
+
headless Chromium), see [CONTRIBUTING.md](CONTRIBUTING.md#unit-testing).
|
|
313
|
+
- `core-js` is no longer a peer dependency: prestations-ng no longer imports it since 19.1.1, see
|
|
314
|
+
[UPGRADING_V19.md](UPGRADING_V19.md#core-js-is-no-longer-needed-since-1920).
|
|
315
|
+
- `ng add @dsivd/prestations-ng` adds `iban` and `dayjs` (the CommonJS dependencies of prestations-ng) to the
|
|
316
|
+
`allowedCommonJsDependencies` of `angular.json`, instead of `core-js/modules/es.array.includes`, `iban` and
|
|
317
|
+
`zone.js/dist/zone-error`, and no longer sets `allowSyntheticDefaultImports` (implied by the `tsconfig.json` of
|
|
318
|
+
Angular 21: `"module": "preserve"` or `"moduleResolution": "bundler"`).
|
|
319
|
+
- `GOOD_PRACTICES.md` and `INTRODUCTION_ANGULAR_SIGNALS.md` are now in English, like the rest of the
|
|
320
|
+
documentation: the titles of their sections, and so their anchors, have changed.
|
|
321
|
+
|
|
322
|
+
### Deprecated
|
|
323
|
+
|
|
324
|
+
- `AbstractMenuPageComponent.ngZone` is no longer used and will be removed: `NgZone.onStable` never emits
|
|
325
|
+
without zone.js.
|
|
326
|
+
- `ObjectHelper.getNestedProperty(obj, key)` will be removed: use `ObjectPathHelper.getByKeys(obj, key)`, which it
|
|
327
|
+
now calls (see Fixed).
|
|
328
|
+
|
|
329
|
+
### Fixed
|
|
330
|
+
|
|
331
|
+
- `foehn-checkbox` and `foehn-agenda` track their rows by their index (since 19.2.0-beta.28), as the names of their
|
|
332
|
+
fields: the checkboxes of elements reordered or replaced no longer share the control of the former ones.
|
|
333
|
+
- `foehn-agenda` follows its `disabled` input (since 19.2.0-beta.29), ignored until then: its time slots are disabled,
|
|
334
|
+
the navigation between the weeks stays usable. The time slot picked writes its model through `updateNgModel()`,
|
|
335
|
+
no longer with a two-way binding of its `model` (which bypassed the guard of a disabled component and the overrides
|
|
336
|
+
of `updateNgModel()`).
|
|
337
|
+
- 🚨 `ObjectHelper.getNestedProperty()`, and the keys given as text to `elementValue`, `elementLabel`, `elementGroup`,
|
|
338
|
+
`elementDisabled` and `elementSuggestionLabel` of `foehn-select`, `foehn-radio`, `foehn-checkbox` and the
|
|
339
|
+
autocompletes, read the value at the path of the key (`'country.name'`): a value which is an object, or a getter of
|
|
340
|
+
a class, is no longer `undefined`, and a nested key is no longer looked up in another nested object holding the same
|
|
341
|
+
key (`'country.name'` gave the `name` of the first nested object having one). A value `null` is no longer
|
|
342
|
+
`undefined` either: an element `{ value: null }` is now selected by a model `null` (e.g. sent by the backend), no
|
|
343
|
+
longer by a model `undefined` (e.g. a field missing from the JSON), and choosing it writes `null` into the model, no
|
|
344
|
+
longer `undefined`.
|
|
345
|
+
- 🚨 `DateHelper.isValid()` also checks the time of a date-time (5 parts or more, e.g. the model of
|
|
346
|
+
`foehn-input-date-time`), as `LenientLocalDateTime.isValid()` of prestations-be: an hour (0 to 23) and a minute (0
|
|
347
|
+
to 59) are required. It only checked the date: a date-time without its time, or at 25:00, was valid. Check your
|
|
348
|
+
calls on a date-time. `isToday()` still considers only the date.
|
|
349
|
+
- The `displayDate` pipe, `DateHelper.toDateFromNumberArray()` and `arrayToDisplayDateDMY()` no longer give a wrong
|
|
350
|
+
date for a date with a part not entered (e.g. a draft saved with an incomplete date): `[2020, null, null]` was
|
|
351
|
+
displayed `30.11.2019`, it now gives nothing. A date-time without its time gives only the date (it displayed
|
|
352
|
+
`00:00:00`), and an empty array gives nothing (it threw an error). `DateHelper.isToday()`: a date which does not
|
|
353
|
+
exist is no longer today (the 30.02.2026 was the 02.03.2026).
|
|
354
|
+
- `AbstractPageComponent` and `AbstractPageFromMenuComponent`: a second click on "next" or "transmit" while the next
|
|
355
|
+
page is loading (lazy loaded route, resolver, async guard) no longer saves again and skips the next page:
|
|
356
|
+
`send()`, `sendAndTransmit()` and `transmit()` are ignored until the navigation to the next page ends. Pages
|
|
357
|
+
overriding `onFormSent()` should call the new protected method `navigateToNextPage()` instead of
|
|
358
|
+
`this._navigation.next()` to get this protection (also in 18.3.15).
|
|
359
|
+
- `captcha`: no more `NG0953` warning ("Unexpected emit for destroyed `OutputRef`") when the captcha script fails to
|
|
360
|
+
load after the component has been destroyed (e.g. the user left the page meanwhile).
|
|
361
|
+
- `foehn-multiselect-autocomplete`: the suggestions and the message displayed once every element is selected follow a
|
|
362
|
+
model changed by the project, not only by the user. Once every element was selected, a model set back to some of
|
|
363
|
+
them kept the message and the hidden input; a model selecting every element did not display the message; the
|
|
364
|
+
suggestions still contained the elements selected by the project. An empty list of elements no longer displays
|
|
365
|
+
the message (every element of the list has already been added).
|
|
366
|
+
- `providePrestationsNgCore()` registers again the HTTP interceptors lost with `FoehnPageModule` in 19.0.0: the
|
|
367
|
+
`foehn-transmit-waiting-modal` is displayed again during a long transmission, the warning before the expiration of
|
|
368
|
+
the session receives its date again, and a new version of the application deployed meanwhile is detected again.
|
|
369
|
+
- `foehn-select`, `foehn-radio`, `foehn-checkbox` and the autocompletes:
|
|
370
|
+
- the model is no longer set back to its previous value when the parent changes `elements` and `model`
|
|
371
|
+
at the same time
|
|
372
|
+
- no more error when the component is destroyed while its `elementsUrl` is loading
|
|
373
|
+
- with a `defaultElementValue`, the model can be emptied again (e.g. set to `null` by the parent): the
|
|
374
|
+
default value was set back at once
|
|
375
|
+
- a change of the model or of `disabled` no longer processes the elements again (the default value, the
|
|
376
|
+
display of the model, the grouped elements and, for the autocompletes, the matching of the model)
|
|
377
|
+
- `foehn-autocomplete`:
|
|
378
|
+
- the model is subscribed only once, whatever the number of times the elements are retrieved: the value
|
|
379
|
+
to display was selected again for each retrieval
|
|
380
|
+
- the height of the suggestion list always follows `itemHeightInSuggestionListInPx`, even before the first
|
|
381
|
+
search returning less than 5 suggestions
|
|
382
|
+
- dynamic list (`isSuggestionListDynamic`): a model already set is no longer reset, even for a moment
|
|
383
|
+
(`modelChange` emitted `null`, then the value again), when the loaded elements do not contain it; it is
|
|
384
|
+
displayed once the elements loaded for it contain it, including when they are given at once with the model
|
|
385
|
+
- `isSuggestionListDynamic` can change at runtime: only the matching of the current kind of list is active,
|
|
386
|
+
the matching of the previous kind went on
|
|
387
|
+
- dynamic list: a model changed by the project (another value, `null`) is displayed again; once a value had been
|
|
388
|
+
displayed, the display no longer followed the model. The elements loaded for the search of the user still do
|
|
389
|
+
not replace what they type.
|
|
390
|
+
- `foehn-input-address` without zone.js: an address given by the parent right after the initialization of the
|
|
391
|
+
component (e.g. prefilled with `SessionInfoWithApplicationService.prefillForm()` for a connected user) is no
|
|
392
|
+
longer overwritten by the model with the default country only; the default country and the clean-up of the model
|
|
393
|
+
are applied after the next rendering, from the latest model.
|
|
394
|
+
- `foehn-input-address` in Switzerland only (`isOnlySwiss`): an address given by the page without country after the
|
|
395
|
+
initialization of the component (e.g. a form loaded from the backend) gets the Swiss country again, as in v18: it
|
|
396
|
+
kept `country: null` until the user changed a field. The default country is checked again for every model given by
|
|
397
|
+
the page, and written only when it changes the model: an identical model is no longer written back (one
|
|
398
|
+
`modelChange` less), and an address without any value to display is left as it is.
|
|
399
|
+
- `foehn-input-address`: the streets and the street numbers of an address given by the page are loaded again, as in
|
|
400
|
+
v18. Since 19.0.0, they were only loaded once the user chose a locality and a street (the autocompletes no longer
|
|
401
|
+
emit `modelChange` for a model given by the page), and a locality given with its `zipCodeId` only (without
|
|
402
|
+
`postalLocalityHistoryId`) never loaded its streets. The lists now follow the locality and the street, whether
|
|
403
|
+
they come from the page or from the user. The Swiss localities are requested once the Swiss fields are displayed,
|
|
404
|
+
and again only when their URL changes (`swissNpaLocalityBaseUrl`, `specifiedCanton`, `withCompanyLocalities`), no
|
|
405
|
+
longer each time Switzerland is chosen again. The methods `userInputCountry()`, `userInputLocality()` and
|
|
406
|
+
`userInputStreet()` no longer take a parameter.
|
|
407
|
+
- `foehn-input-address`: the deferred clean-up of the model (hidden address lines and post office box) applies
|
|
408
|
+
to the latest model, it could restore a previous value (e.g. remove the default country); nothing is
|
|
409
|
+
updated anymore once the component is destroyed.
|
|
410
|
+
- `FoehnInputComponent`: when the user empties at once every field of a model given by the page, the model is `null`
|
|
411
|
+
again, as in v18, for the components overriding `onModelChange()` without calling `super.onModelChange()`: in
|
|
412
|
+
prestations-ng `foehn-input-date`, `foehn-input-date-time`, `foehn-input-foreign-locality` and
|
|
413
|
+
`foehn-input-foreign-street` (also in the foreign address of `foehn-input-address`), and in your project e.g. a
|
|
414
|
+
list whose last item is removed. Since 19.0.0, the model kept its previous value, which was then saved. The model
|
|
415
|
+
of the page is now known (`model_`) once it has a value to display, and then follows it, before `onModelChange()`,
|
|
416
|
+
which can still change it. Nothing to change in your components, except one whose model can hold a value only in a part it doesn't
|
|
417
|
+
display (e.g. an id) and which updates its model without any input of the user: override the new protected method
|
|
418
|
+
`hasValueToDisplay()`, as `foehn-input-address` does for the country of an address only Swiss.
|
|
419
|
+
- `foehn-input-date-time`: emptying its only filled field empties the model, it kept its value also in v18.
|
|
420
|
+
- `foehn-input-hidden`, `foehn-input-email` and `foehn-input-password` handle their model as `foehn-input-text` does:
|
|
421
|
+
a number `0` given by the page (e.g. a number field in Java bound to a `foehn-input-hidden`) is kept, it was
|
|
422
|
+
replaced by `null`, which was then saved. An empty string is replaced by `null` at once, instead of after a timer
|
|
423
|
+
that `fixture.whenStable()` didn't wait for, and that could overwrite a value given by the page meanwhile. Their
|
|
424
|
+
public field `timeoutReference` is removed.
|
|
425
|
+
- `foehn-input-textarea` replaces by `null` an empty string given by the page, as the other text fields do. Its
|
|
426
|
+
character count follows a change of `max` or `displayCharCount` at once: it kept the previous count until the next
|
|
427
|
+
input, and the textarea stayed `aria-invalid` once the count was no longer displayed.
|
|
428
|
+
- `foehn-radio`: `inputValue` follows a change of `elementValue` or `elementValueIdentity`, not only of the model.
|
|
429
|
+
- `foehn-input-time` replaces by `null` an empty string given by the page, as the other text fields do: the backend
|
|
430
|
+
rejected it (`@ValidStringTime` accepts `null`, not `''`), although the user had entered nothing.
|
|
431
|
+
- 🚨 `ObjectHelper.hasAnyValue()` and `ObjectHelper.isEmpty()`: a number (`0` included), a boolean (`false`
|
|
432
|
+
included) and a date are values. `true`, `5` or a date were empty, as well as `0`, `false` or a date in an object
|
|
433
|
+
or an array (e.g. `{ checked: false }`, `[0, 0]`). Only `null`, `undefined`, `''` and the arrays and objects
|
|
434
|
+
holding none but them are empty. Check your calls on such values, e.g. in the `getValidValue()` of your
|
|
435
|
+
components: a field holding `true` no longer counts as empty.
|
|
436
|
+
- `foehn-multi-upload` and `foehn-bo-multi-upload`:
|
|
437
|
+
- after a failed upload (network, HTTP error), the next files are uploaded: nothing was uploaded anymore,
|
|
438
|
+
without any message, until the page was reloaded
|
|
439
|
+
- after a failed deletion (HTTP error, readonly document), the next files are deleted: nothing was deleted
|
|
440
|
+
anymore, and the error also reached the `ErrorHandler` as unhandled (its message is still displayed)
|
|
441
|
+
- `PendingUploadService.removePendingFile()`: a file which is not pending no longer removes the last pending file.
|
|
442
|
+
- `foehn-multi-upload` and `foehn-bo-multi-upload`: `customErrors` is used again for the errors which have a default
|
|
443
|
+
message (`413`, `415`, `500`, `FILENAME_TOO_LONG`, `FILENAME_SHOULD_NOT_CONTAIN`...): the default messages
|
|
444
|
+
overwrote the given object. Its messages can use `{fileName}` and `{fileMaxSize}`, `{fileExtensions}`,
|
|
445
|
+
`{maxFileNameLength}`, `{fileNameIllegalCharacters}` (as documented) as well as `%1$s` and `%2$s`.
|
|
446
|
+
- `UploaderHelper`: `getDefaultCustomErrors()` and `mergeCustomErrors()` are added, `createDefaultCustomErrors()` is
|
|
447
|
+
deprecated as it overwrites the given custom errors.
|
|
448
|
+
- `foehn-agenda-timeslot-panel`: when the time slots of the day change, the panel is closed again (only the
|
|
449
|
+
first time slots are displayed) unless the selected slot would be hidden; the list was cut while the panel
|
|
450
|
+
stayed open.
|
|
451
|
+
- `foehn-breadcrumb`: a breadcrumb updated in place is displayed again when it is emitted.
|
|
452
|
+
- `fromDictionary` pipe: its subscription is released when the pipe is destroyed.
|
|
453
|
+
- `SdkLogsService`: a log is not sent anymore once the application is destroyed (e.g. at the end of a test),
|
|
454
|
+
when it made the `HttpClient` throw `NG0205`.
|
|
455
|
+
- `SessionInfoWithApplicationService`: `isReady` and `isUserConnected` return the same `Observable` at each read. A
|
|
456
|
+
new one at each read made the `async` pipe of a template subscribe again at each refresh: on a resumed application
|
|
457
|
+
whose form is loaded before the session, `isReady` went back to `null` and hid the content until the session
|
|
458
|
+
arrived.
|
|
459
|
+
- `foehn-list-summary` with `showAsTable`: the table displays the list given by the page when the page replaces it
|
|
460
|
+
(e.g. with the form returned by the backend). Since 19.0.0, it only followed the removals and the sorts made in
|
|
461
|
+
the component.
|
|
462
|
+
- `ng add @dsivd/prestations-ng` works again on the Angular workspaces created since Angular 14: it failed because
|
|
463
|
+
`angular.json` no longer has a `defaultProject` (the dependencies are now added to every application), then
|
|
464
|
+
because of the comments of `tsconfig.json` (now kept, like its formatting).
|
|
465
|
+
- `foehn-feedback-notification`: an error of `api/feedbacknotification/queryparams/{reference}` is logged and the
|
|
466
|
+
links are displayed without the feedback url, it reached the `ErrorHandler` as unhandled.
|
|
467
|
+
- The npm package no longer contains its own archive (`dsivd-prestations-ng-<version>.tgz`).
|
|
468
|
+
- ESLint rules [`no-direct-signal-mutation`](ESLINT_PLUGIN.md#no-direct-signal-mutation) and
|
|
469
|
+
[`no-uninvoked-signal-in-template`](ESLINT_PLUGIN.md#no-uninvoked-signal-in-template): an explicit `(xChange)`
|
|
470
|
+
handler is no longer taken for the target of a two-way binding `[(x)]`. `no-direct-signal-mutation` reported
|
|
471
|
+
`(modelChange)="updateModel()"` in a template shared by several components (its component file not found), and
|
|
472
|
+
`no-uninvoked-signal-in-template` let `(valueChange)="mySignal"` through.
|
|
473
|
+
|
|
16
474
|
## [19.1.1]
|
|
17
475
|
|
|
18
476
|
### Fixed
|
|
@@ -155,6 +613,24 @@ Please check the [UPGRADING_V19.md](UPGRADING_V19.md) guide for more information
|
|
|
155
613
|
- [foehn-list-summary.component.ts](projects/prestations-ng/src/foehn-menu-prestation/foehn-list-summary/foehn-list-summary.component.ts)
|
|
156
614
|
- `[list]` attribut has been removed. Use `[model]` instead.
|
|
157
615
|
|
|
616
|
+
## [18.3.15]
|
|
617
|
+
|
|
618
|
+
### Updated
|
|
619
|
+
|
|
620
|
+
- [foehn-navigation.component.html](projects/prestations-ng/src/foehn-navigation/foehn-navigation/foehn-navigation.component.html)
|
|
621
|
+
- [foehn-simple-navigation.component.html](projects/prestations-ng/src/foehn-navigation/foehn-simple-navigation/foehn-simple-navigation.component.html)
|
|
622
|
+
- while the page targeted by "next", "transmit" or "previous" is loading for more than 200 ms (e.g. lazy loaded route), the clicked button displays a spinner with the new `loadingLabel` input (dictionary key `foehn-navigation.loading.label`, "Chargement...") and the navigation buttons are disabled (`aria-disabled`; clicks are ignored from the start of the navigation); a `role="status"` region announces the loading to screen readers
|
|
623
|
+
- [foehn-navigation.service.ts](projects/prestations-ng/src/foehn-navigation/foehn-navigation.service.ts)
|
|
624
|
+
- new method `pendingNavigationDirection()`: direction of the navigation started with `next()` or `previous()` until it ends, `null` otherwise
|
|
625
|
+
|
|
626
|
+
### Fixed
|
|
627
|
+
|
|
628
|
+
- [abstract-page-component.ts](projects/prestations-ng/src/abstract-page-component.ts)
|
|
629
|
+
- fixed a second click on "next" or "transmit" while the next page is loading (lazy loaded route, resolver, async guard) saving again and skipping the next page: `send()`, `sendAndTransmit()` and `transmit()` are now ignored until the navigation to the next page ends
|
|
630
|
+
- new protected method `navigateToNextPage()`: pages overriding `onFormSent()` should call it instead of `this._navigation.next()` to get this protection
|
|
631
|
+
- [abstract-page-from-menu.component.ts](projects/prestations-ng/src/foehn-menu-prestation/abstract-page-from-menu.component.ts)
|
|
632
|
+
- same fix when returning to the parent page
|
|
633
|
+
|
|
158
634
|
## [18.3.13]
|
|
159
635
|
|
|
160
636
|
### Fixed
|