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
mgr/dashboard: Update selected items on table refresh #21099
mgr/dashboard: Update selected items on table refresh #21099
Conversation
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 think you need to add trackBy
to some tables or save the state some other way.
ATM if you select a row in the OSD page, the details keep being recreated.
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.
Which tables are affected by this problem?
The detail view should update itself if it's data has changed, through the usage of Observables through Angular.
e3bca67
to
e8717d2
Compare
@tspmelo I've added a new table input |
@Devp00l this will affect all pages where you have a In particual, it affects my WIP RBD details page: And also my WIP RBD snapshots page (because snapshots list is included in the row data, so I don't have to do a separate server request). Do you still think that |
@@ -67,6 +67,9 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O | |||
// e.g. 'single' or 'multi'. | |||
@Input() selectionType: string = undefined; | |||
|
|||
// If `true` selected item details will be updated on table refresh | |||
@Input() updateSelectionOnRefresh = false; |
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 suggest to set it to true
by default and force the developer to explicitly set it to false
if he does not like this behaviour for his table.
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.
@votdev I've changed the default value to true
@ricardoasmarques I was assuming that angular would update the details accordingly as it uses observables in the background. Also the ngx-table should update the selection accordingly. Maybe it's a bug in the table? |
Signed-off-by: Ricardo Marques <rimarques@suse.com>
e8717d2
to
9d316c3
Compare
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.
lgtm
After updating table data (either by pressing refresh button or by automatic refresh), selected rows should be updated to guarantee that user will see the updated details of the selected row.
Signed-off-by: Ricardo Marques rimarques@suse.com