-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] Add Clone dashboard form #5730
Conversation
0793ae7
to
29ca64a
Compare
PR to keep widgets: ManageIQ/manageiq#18900 |
We will discuss with @h-kataria if there should be a multi select for the groups. |
After the changes in backend copying is working well! 👍
|
29ca64a
to
510e209
Compare
@h-kataria at this point dashboard name should be unique. Attempt to create dashboard with the same name for another group generates error: |
it means that multiselect will work only if we dynamically append to the supplied name something to create unique name. I do not think mutiselect in the scope of original RFE |
I agree with @yrudman. Let's finish the work as it is now. And let's ping @Loicavenel if he has comments or wants to update the requirements. If so we can do a follow-up PR and extend the copying to multiple groups once we figure what to do with the name. |
e949340
to
8d9adc4
Compare
@miq-bot add_label hammer/no, react, enhancement, changelog/yes, cloud intel/dashboard, dashboards, |
fb3ad5d
to
3a6bd9f
Compare
This button was added by the previous PR, but I don't see any way how to select any dashboard. am I right? |
@gtanzillo @yrudman changing the scope to
fixes it and seems to be working as expected |
@h-kataria yes, it is original design, when dashboards assigned to group |
Ohh, I submitted my comment on original Harpreet's question ... |
@yrudman when adding a new dashboard for a group, userid cannot be populated anyway so setting owner of group makes more sense. The scope should not be checking for userid i believe, changing the scope to check for set_type and owner fields will work in this case. |
I am not sure @h-kataria , for personal dashboards owner is nil and changed validation will impose the same restriction on personal dashboard name as we have now for groups - should be unique name between all user |
@yrudman how can we populate userid when adding a new Dashboard for a group and users within the group can have a Dashboard with same name. Copy of user's dashboard is added when user logs in for the first time using same name. |
@rvsia @gtanzillo @yrudman so i got this working by adding a line after |
@@ -51,6 +51,61 @@ def db_new | |||
db_edit | |||
end | |||
|
|||
def db_copy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose there is no API support for copy action right?
If not, can you please create a note to the forms sheet so we don't forget to add it afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Yeah, after merging this I will update the sheet!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvsia once we have API support for this, we can enhance this form to show the list of widgets that are part of Dashboard that's getting copied.
@h-kataria right, saving To implement this we would need:
I still think that copying dashboard to multiple groups is out of scope of original RFE |
@Loicavenel is it ok, to only copy a dashboard for a single Group. |
|
||
return http.post(`/report/db_copy/${dashboardId}?button=save`, data, { skipErrors: [400] }) | ||
.then(() => miqAjaxButton('/report/dashboard_render')) | ||
.catch(handleError, miqSparkleOff); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think that you can have multiple executors in promise callbacks(unless we have some polyfill). It will only execute the first one handleError
.
@rvsia i had a discussion with @gtanzillo fixing the Dashboard naming issue to be unique only within a group is a high risk and might introduce other issues at this time, so i am going to open a new GH issue to analyze and address the issue separately in follow up PR. For this PR we will go with single group Copy with a unique Dashboard name, the way you have in your current PR. |
opened a GH issue in core repo ManageIQ/manageiq#18924 |
6d8df75
to
3899b3a
Compare
I changed the success message: |
3899b3a
to
b8087c7
Compare
Checked commits rvsia/manageiq-ui-classic@f34a048~...b8087c7 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 app/controllers/report_controller/dashboards.rb
spec/controllers/miq_report_controller/dashboards_spec.rb
|
Adding @MariSvirik to review. |
|
@terezanovotna it was decided to copy a dashboard and allow user to provide a name, description and a Group that the Dashboard will be copied to. If user wants to edit the Dashboard they will have to go to new Dashboard after creating a copy and then do it there. So this is working as designed. |
@terezanovotna is this good to be merged? |
this can be merged, but we are not improving user experience. The dashboard part needs to be shown in the cloned dashboard. |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1314875
Based on #5728 https://github.com/ManageIQ/manageiq/pull/18550/files
Cloud Intel
>Reports
>Dashboards
> Select one > 'Configuration' > 'Copy selected Dashboard'Description
After