stable

Clone or download

Read-only

Using Faults in artifact-modal

part of story #24969 [modal] add and remove links without types No functional change expected when fetching a parent artifact or fetching linked artifacts. Notes: Using Faults lets us move more logic to the Domain instead of the Controllers. The Domain now knows that if there is no ParentArtifactIdentifier, it means we are in creation mode. It tells the Controller (via a Fault) to create an empty presenter. The Domain still has no knowledge of Presenters, but it handles the different cases, instead of letting the Controller decide this. Change-Id: I84c30ab7aa02a5041aa2a162831f72be2fd861a3

Modified Files

Name
M plugins/tracker/scripts/lib/artifact-modal/package.json +1 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/pnpm-lock.yaml +2 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ModalFeedbackController.test.ts +6 −5 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ModalFeedbackController.ts +8 −8 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ParentFeedbackPresenter.test.ts +0 −5 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ParentFeedbackPresenter.ts +1 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkField.test.ts +2 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldController.test.ts +14 −7 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldController.ts +15 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldPresenter.test.ts +2 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldPresenter.ts +3 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/LinksRetriever.test.ts +42 −8 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/LinksRetriever.ts +14 −4 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/NoLinksInCreationModeFault.ts +25 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/RetrieveAllLinkedArtifacts.ts +3 −2 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/parent/ParentRetriever.test.ts +55 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/parent/ParentRetriever.ts +33 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/parent/RetrieveParent.ts +26 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal-controller.js +2 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveAllLinkedArtifactsStub.ts +3 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveLinkTypesStub.ts +4 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveLinkedArtifactsByTypeStub.ts +5 −0 Go to diff View file
A src/scripts/lib/fault/.gitignore +1 −0 Go to diff View file
A src/scripts/lib/fault/README.md +254 −0 Go to diff View file
A src/scripts/lib/fault/jest.config.js +25 −0 Go to diff View file
A src/scripts/lib/fault/package.json +22 −0 Go to diff View file
A src/scripts/lib/fault/src/Fault.test.ts +92 −0 Go to diff View file
A src/scripts/lib/fault/src/Fault.ts +81 −0 Go to diff View file
A src/scripts/lib/fault/tsconfig.json +10 −0 Go to diff View file
A src/scripts/lib/fault/vite.config.ts +32 −0 Go to diff View file