stable

Clone or download

Read-only

"Static method" style

part of story #24969 [modal] add and remove links without types No functional change expected in the "Parent feedback" and the new Artifact link field Notes: In PHP we use static class methods to build objects. It offers good readability: we can build a Presenter "from" an Artifact, for example. Same thing for stubs: we can build a stub "with" a return value. Since we are not using classes in TypeScript, we used simple factory functions. However, it is harder to name them to have the same readability without writing very long names. We can "simulate" static class methods by exporting a const object with the name we want. We could also use "import * as Name" pattern, but this naming cannot be guaranteed to be consistent, as any class is free to rename its imports. Change-Id: I210cf916cc0070c4343fd1d9f00bc05bae2270bc

Modified Files

Name
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/REST/APILinkedArtifact.ts +32 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/REST/TuleapAPIClient.test.ts +23 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/REST/TuleapAPIClient.ts +1 −13 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ModalFeedback.test.ts +3 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ModalFeedback.ts +5 −6 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ModalFeedbackController.test.ts +2 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ModalFeedbackController.ts +7 −6 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ParentFeedbackPresenter.test.ts +4 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/feedback/ParentFeedbackPresenter.ts +6 −5 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkField.test.ts +5 −10 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkField.ts +2 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldController.test.ts +6 −12 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldController.ts +3 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldPresenter.test.ts +5 −10 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldPresenter.ts +26 −24 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/LinksRetriever.test.ts +4 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/parent/ParentRetriever.test.ts +8 −8 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveAllLinkedArtifactsStub.ts +15 −12 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveArtifactStub.ts +5 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveLinkTypesStub.ts +7 −8 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveLinkedArtifactsByTypeStub.ts +16 −14 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/RetrieveParentStub.ts +5 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/VerifyIsInCreationModeStub.ts +8 −6 Go to diff View file