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

Migrate CreateDashboardDialog to React #3826

Merged
merged 3 commits into from
May 27, 2019

Conversation

kravets-levko
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Feature

Description

Migrate CreateDashboardDialog to React. Restore some DynamicComponent usages (missed during React migration).

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

image
image

@kravets-levko kravets-levko added Frontend Frontend: React Frontend codebase migration to React labels May 23, 2019
@kravets-levko kravets-levko requested a review from arikfr May 23, 2019 16:53
@kravets-levko kravets-levko self-assigned this May 23, 2019
}
}, 100);
return () => clearTimeout(timer);
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can substitute this for <Input autofocus />, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does not work in modals. This fix was suggested in related discussion

Copy link
Member

Choose a reason for hiding this comment

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

Weird, it seems to work on CreateSourceDialog and ChangePasswordDialog 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gabrieldutra I'll check once more

Copy link
Collaborator Author

@kravets-levko kravets-levko May 24, 2019

Choose a reason for hiding this comment

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

@gabrieldutra I see that autoFocus works in other modals, but it doesn't work in this one - I really have no idea what's wrong 🤔 I tried to simplify that dialog as much as I can - removed almost all attributes, <DynamicComponent>, etc. - just <Modal ...><Input autoFocus /></Modal> - input does not get focused.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's one significant difference - Class component vs Functional component 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ranbena Interesting idea. I'll try to implement it as class component - will see what happens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ranbena Tried class component - the same issue (no autofocus).

Upd.: When this dialog is opened from React code - Input gets autofocus, when from Angular - no. I'll add a comment with ANGULAR_REMOVE_ME

Copy link
Member

Choose a reason for hiding this comment

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

When this dialog is opened from React code - Input gets autofocus, when from Angular - no.

Makes sense and also good to know this sort of thing happens 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah... But usually applications are built using only one framework, so such shit does not happen 🙂

@ranbena ranbena self-requested a review May 23, 2019 20:23
Copy link
Contributor

@ranbena ranbena left a comment

Choose a reason for hiding this comment

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

Looks awesome, great code 🤟🤟
Left two comments.

@kravets-levko kravets-levko merged commit 9480d89 into master May 27, 2019
@kravets-levko kravets-levko deleted the feature/migrate-create-dashboard-dialog branch May 27, 2019 20:13
harveyrendell pushed a commit to pushpay/redash that referenced this pull request Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend: React Frontend codebase migration to React Frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants