stable
Clone or download
request #10970 - Artifact-modal: Replace restangular dependency
This patch aims to remove entirely the dependency to restangular and to replace it with our custom tlp fetch-wrapper methods. How to test: - Create an artifact (either using the new PV2 draft or by creating a bug in TTM) - Edit an artifact - Choose a parent artifact while editing - Upload files through the attachment field - Search for users in a user-bound open list field - Add follow-up comments. Verify they are present when editing Check that when the server returns an error, it is shown at the top of the modal. It should be the case when you: - upload a file, edit / create the artifact on submit - get the parent / list of possible parents - load follow-up comments - get user prefs (text type, comments order) Note: using native Promises (async/await) does not work in AngularJS context. It causes AngularJS to stop reacting (because no $digest loop is triggered). Things stay "loading" forever, so you must wrap native Promise with $q.when() A following patch will move the rest-service out of angular entirely Change-Id: I9a48a2468eb5379af5d8abf0414dfe67eec5ff5c
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/tracker/www/scripts/angular-artifact-modal/src/rest/rest-service.js | +110 | −127 | Go to diff View file |
M | plugins/tracker/www/scripts/angular-artifact-modal/src/rest/rest-service.spec.js | +243 | −219 | Go to diff View file |
M | plugins/tracker/www/scripts/angular-artifact-modal/src/rest/rest.js | +2 | −6 | Go to diff View file |
M | plugins/tracker/www/scripts/angular-artifact-modal/src/tlp-mock.spec.js | +4 | −1 | Go to diff View file |
M | plugins/tracker/www/scripts/package-lock.json | +0 | −15 | Go to diff View file |
M | plugins/tracker/www/scripts/package.json | +0 | −1 | Go to diff View file |
M | src/www/themes/common/tlp/doc/resources/fetch/manifest.json | +2 | −1 | Go to diff View file |
A | src/www/themes/common/tlp/doc/resources/fetch/options/doc.html | +10 | −0 | Go to diff View file |
A | src/www/themes/common/tlp/doc/resources/fetch/options/example.html | +17 | −0 | Go to diff View file |
A | src/www/themes/common/tlp/doc/resources/fetch/options/manifest.json | +4 | −0 | Go to diff View file |
M | src/www/themes/common/tlp/src/js/fetch-wrapper.js | +22 | −16 | Go to diff View file |
M | src/www/themes/common/tlp/src/js/index.js | +2 | −8 | Go to diff View file |