stable

Clone or download

Read-only

Convert File field to hybrids

part of request #22648 Convert AngularJS directives and controllers to hybrids web components How to test: No functional change expected in the file fields. You can still attach multiple new files (with description). On submit, the files will be uploaded and attached to the artifact. There is a "Reset" button that lets you clear the attached file and its description. For existing files, you can mark them for deletion. Unless you cancel that deletion, on submit the files will be removed from the artifact. Please check that the "required" behaviour is still active and that the field is disabled if you don't have permission to update / submit the field. You can test basic non-regression with cypress end-to-end tests for agiledashboard. Notes: - angular-sanitize could probably have been removed earlier, I just noticed it now. - It would be better from a hexagonal architecture point of view to handle the "Files marked for removal" and generally the field data in a Memory adapter, however it produced a change too big to review so this patch focuses on the template (which is the more pressing issue). The controller mutates the "value model" for now, it can be refactored later. Change-Id: Iccfe9eb2b8dcbc2fffea02b254e51fba27ee1429

Modified Files

Name
M plugins/tracker/scripts/lib/artifact-modal/package.json +2 −5 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/pnpm-lock.yaml +1 −15 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/po/fr_FR.po +5 −5 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/AttachedFileDescription.ts +34 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/FileField.test.ts +273 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/FileField.ts +218 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/FileFieldController.test.ts +172 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/FileFieldController.ts +115 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/FileFieldType.ts +34 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/FileFieldValueModel.ts +31 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/NewFileToAttach.test.ts +51 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/NewFileToAttach.ts +47 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/NewFileToAttachElement.test.ts +106 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/file-field/NewFileToAttachElement.ts +104 −0 Go to diff View file
R plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/_file-field.scss Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/file-field-controller.js +0 −70 Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/file-field-controller.test.js +0 −141 Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/file-field-directive.js +0 −22 Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/file-field.tpl.html +0 −78 Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/file-input-directive.js +0 −14 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/fields/file-field/file-uploader.js +1 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/gettext-catalog.ts +7 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/model/field-values-formatter.js +2 −6 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/model/field-values-formatter.test.js +3 −12 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal-controller.js +4 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal-service.test.js +2 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal.js +2 −13 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal.scss +1 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal.tpl.html +6 −6 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/tests/stubs/AttachedFileDescriptionStub.ts +61 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/webpack.common.js +0 −1 Go to diff View file