-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix(dashboard-list): change name of dashboard is not reflected instantly #15186
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15186 +/- ##
==========================================
- Coverage 76.88% 76.87% -0.01%
==========================================
Files 976 976
Lines 51318 51322 +4
Branches 6907 6910 +3
==========================================
Hits 39455 39455
- Misses 11644 11648 +4
Partials 219 219
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -157,7 +157,7 @@ function DashboardList(props: DashboardListProps) { | |||
({ json = {} }) => { | |||
setDashboards( | |||
dashboards.map(dashboard => { | |||
if (dashboard.id === json.id) { | |||
if (dashboard.id === json?.result.id) { |
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.
Nice 😄 Can we add 1 more null check, just to be safe? json?.result?.id
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.
Sure! But there will be another problem, here I only need to update the title, colorSchema, json_metadata, etc., but the modified time is controlled by changed_on_delta_humanized
, the response does not have this field.
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.
Can we just add that param to the response in backend? @zhaoyongjie @villebro
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.
@kgabryje makes sense - I'll see if it's easy to add it.
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.
Thanks! BTW, If we update the dashboard's title, since the list is sorted by modified_time or modified_by, not only update the title, the order of the list also needs to be updated. This may be a case I need to consider. So I think refreshData
can simplify a lot, but it will add additional requests.
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 have added changed_on_delta_humanized
field in the RESTful response.
link to: #15542
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 changing the order of the list will be surprising for the user. It may look like the dashboard they were editing has disappeared.
2b5b600
to
10f8acf
Compare
10f8acf
to
32f3f68
Compare
/testenv up |
@junlincc Ephemeral environment spinning up at http://54.218.174.21:8080. Credentials are |
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.
this lgtm
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
Ephemeral environment shutdown and build artifacts deleted. |
…tly (apache#15186) * fix: change name of dashboard is not reflected instantly * fix: id * fix: update info * fix: add changed_on_delta_humanized
…tly (apache#15186) * fix: change name of dashboard is not reflected instantly * fix: id * fix: update info * fix: add changed_on_delta_humanized
…tly (apache#15186) * fix: change name of dashboard is not reflected instantly * fix: id * fix: update info * fix: add changed_on_delta_humanized
SUMMARY
Fix the title of dashboard list is not reflected instantly after editing.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before
2021-06-16.1.02.49.mov
after
2021-06-16.1.03.35.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION