Skip to content
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

Merged
merged 4 commits into from Jul 9, 2021

Conversation

stephenLYZ
Copy link
Member

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

@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #15186 (23b7720) into master (301b94f) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            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              
Flag Coverage Δ
javascript 71.41% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rontend/src/views/CRUD/dashboard/DashboardList.tsx 72.46% <0.00%> (-2.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 301b94f...23b7720. Read the comment docs.

@kgabryje
Copy link
Member

Could we try to use the response from the request we're already making? There's the updated title available:
image

After your change, we make additional 2 request, which seems like a waste
image

@stephenLYZ
Copy link
Member Author

Could we try to use the response from the request we're already making? There's the updated title available:
image

After your change, we make additional 2 request, which seems like a waste
image

Cool. It seems that we have updated the data using the response, but the list view is not updated. I will look at why there is no update.

@@ -157,7 +157,7 @@ function DashboardList(props: DashboardListProps) {
({ json = {} }) => {
setDashboards(
dashboards.map(dashboard => {
if (dashboard.id === json.id) {
if (dashboard.id === json?.result.id) {
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member

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.

@junlincc
Copy link
Member

junlincc commented Jul 8, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2021

@junlincc Ephemeral environment spinning up at http://54.218.174.21:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lgtm

@zhaoyongjie zhaoyongjie added hold! On hold and removed hold! On hold labels Jul 9, 2021
@zhaoyongjie zhaoyongjie self-requested a review July 9, 2021 03:28
Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhaoyongjie zhaoyongjie merged commit 1d572ca into apache:master Jul 9, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2021

Ephemeral environment shutdown and build artifacts deleted.

cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
…tly (apache#15186)

* fix: change name of dashboard is not reflected instantly

* fix: id

* fix: update info

* fix: add changed_on_delta_humanized
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
…tly (apache#15186)

* fix: change name of dashboard is not reflected instantly

* fix: id

* fix: update info

* fix: add changed_on_delta_humanized
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
…tly (apache#15186)

* fix: change name of dashboard is not reflected instantly

* fix: id

* fix: update info

* fix: add changed_on_delta_humanized
@mistercrunch mistercrunch added the 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants