stable

Clone or download

Read-only

feat: add getResponse and suffix fetch result methods with "Response"

Implements request #38300 Add "Response" suffix to fetch-result methods How to test: - No functional change in the Timetracking personal widget. In the "details" modal, it still retrieves the list of times entered by the user and shows a "Load more" button. You can simulate that by entering a bunch of times and changing the "limit" parameter to 2. - No functional change expected elsewhere. Why? - getResponse is useful in cases like the timetracking widget because we can do just 1 call to the API to get the total number of items and retrieve the first batch of items. - Naming is hard, I chose to suffix the methods to suggest their return type: either JSON is decoded, or a Response is returned. Note that some methods that return a Response such as del(), head() and options() are NOT renamed because it's not possible for them to return anything else than a Response. There is never any body for them to decode. Change-Id: Id52e1180d0b501aa290ebdc6172b83bd61705c1d

Modified Files

Name
M lib/frontend/fetch-result/README.md +74 −15 Go to diff View file
M lib/frontend/fetch-result/package.json +4 −3 Go to diff View file
M lib/frontend/fetch-result/src/main.ts +39 −6 Go to diff View file
M lib/frontend/fetch-result/src/restler-methods.test.ts +43 −29 Go to diff View file
M lib/frontend/fetch-result/src/restler-methods.ts +10 −0 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/helpers/rest-querier.test.ts +4 −2 Go to diff View file
M plugins/artidoc/scripts/artidoc/src/helpers/rest-querier.ts +2 −2 Go to diff View file
M plugins/gitlab/scripts/artifact-create-branch-action/src/api/rest-querier.test.ts +1 −1 Go to diff View file
M plugins/gitlab/scripts/artifact-create-branch-action/src/api/rest-querier.ts +2 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/api/tuleap-rest-querier.test.ts +7 −7 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/api/tuleap-rest-querier.ts +10 −3 Go to diff View file
M plugins/timetracking/scripts/personal-timetracking-widget/src/api/rest-querier.test.ts +5 −9 Go to diff View file
M plugins/timetracking/scripts/personal-timetracking-widget/src/api/rest-querier.ts +10 −30 Go to diff View file
M plugins/timetracking/scripts/timetracking-overview-widget/src/api/rest-querier.ts +2 −2 Go to diff View file
M plugins/webauthn/scripts/account/src/delete.ts +2 −2 Go to diff View file
M plugins/webauthn/scripts/account/src/register.ts +2 −2 Go to diff View file
M src/scripts/site-admin/src/userdetails.ts +2 −2 Go to diff View file
M src/scripts/switch-to/src/helpers/search-querier.test.ts +64 −112 Go to diff View file
M src/scripts/switch-to/src/helpers/search-querier.ts +2 −2 Go to diff View file