stable

Clone or download

Read-only

Have dynamic SVG preview for Program Increments

part of story #21793 configure Program Management How to test: - In Program admin, when you edit the label for Program increments, the section name in the SVG preview will reflect it - when you edit the label for the milestone type (sub-label), the "New" button's label and the example program increments' labels will reflect it Note to reviewer: I tried to reproduce the pattern we use in PHP: static methods with interfaces and parameters. Document is already an interface, but it allows to do so much that it can't really be stubbed. Stubbing the DOM is not as radically necessary as stubbing a database for example, but it allows to concentrate on read-only operations and does not require us to recreate the entire form in our tests. By using stubs, we don't even have to actually append elements to the <body>. It also creates a layer of separation between the DOM and our domain code. Using dedicated classes for the label inputs also lets us know what we are using in method signatures. This patch is big enough so I didn't go the extra mile, but we should probably be reusing those classes in the rest of the TS code, instead of querying them all the time. Change-Id: Ib9633d4db7c3820d1bd82601e284bf874df0f546

Modified Files

Name
M plugins/program_management/package-lock.json +11 −0 Go to diff View file
M plugins/program_management/package.json +2 −0 Go to diff View file
M plugins/program_management/scripts/admin/po/fr_FR.po +10 −1 Go to diff View file
A plugins/program_management/scripts/admin/src/GettextProvider.ts +22 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/dom/DocumentAdapter.test.ts +66 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/dom/DocumentAdapter.ts +40 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/dom/RetrieveElement.ts +24 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/dom/RetrieveElementStub.ts +55 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/dom/TimeboxLabel.test.ts +50 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/dom/TimeboxLabel.ts +40 −0 Go to diff View file
M plugins/program_management/scripts/admin/src/index.ts +14 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/milestones/preview-actualizer.test.ts +101 −0 Go to diff View file
A plugins/program_management/scripts/admin/src/milestones/preview-actualizer.ts +77 −0 Go to diff View file
M plugins/program_management/site-content/fr_FR/LC_MESSAGES/tuleap-program_management.po +4 −1 Go to diff View file
M plugins/program_management/templates/admin/milestones/admin-configuration-program-increment-section.mustache +66 −62 Go to diff View file
A plugins/program_management/templates/admin/milestones/program-increments-illustration.mustache +241 −0 Go to diff View file
M plugins/program_management/themes/program_management/_admin.scss +19 −1 Go to diff View file