Add button to star/unstar dashboards
What does this MR do?
Adds a button to "star/unstar" a dashboard. frontend implementation of #214581 (closed)
Note: Pending on backend implementation at: !31316 (merged) and !31892 (merged)
Screenshots
desktop | mobile |
---|---|
In action
(not needed anymore)
Test locally without a backend EDIT:
Click here if still want to see the diff 👇
While we wait for the backend to be merged we can test by:
diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js
index 4481395cbbd..afce782b011 100644
--- a/app/assets/javascripts/monitoring/stores/actions.js
+++ b/app/assets/javascripts/monitoring/stores/actions.js
@@ -356,6 +356,13 @@ export const toggleStarredValue = ({ commit, state, getters }) => {
return;
}
+ // TODO REMOVE THIS AND REPLACE WITH REAL AXIOS
+ const axios = config => {
+ console.log(config);
+ return new Promise(resolve => setTimeout(resolve, 1000));
+ };
+ // END TODO
+
const method = selectedDashboard.starred ? 'DELETE' : 'POST';
const url = selectedDashboard.user_starred_path;
const newStarredValue = !selectedDashboard.starred;
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) In progress at: !31579 (merged) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖