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 AddToDashboard dialog #4408

Merged
merged 5 commits into from
Dec 4, 2019

Conversation

kravets-levko
Copy link
Collaborator

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

  • Refactor

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

image
image
image
image

@kravets-levko kravets-levko added Frontend Frontend: React Frontend codebase migration to React labels Nov 27, 2019
@kravets-levko kravets-levko self-assigned this Nov 27, 2019
Copy link
Member

@gabrieldutra gabrieldutra left a comment

Choose a reason for hiding this comment

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

Looks good, only thing I missed was a loading indicator (mainly for when it is not that fast to load - which was my case testing it on Preview 😅)

import { useState, useEffect } from 'react';
import { useDebouncedCallback } from 'use-debounce';

export default function useSearchResults(
Copy link
Member

Choose a reason for hiding this comment

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

Cool 👍, I will keep it in mind for next search uses

@kravets-levko
Copy link
Collaborator Author

@gabrieldutra

image

const [searchTerm, setSearchTerm] = useState('');

const [doSearch, dashboards, isLoading] = useSearchResults((term) => {
if (isString(term) && (term.length >= 3)) {
Copy link
Member

Choose a reason for hiding this comment

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

The loading indicator was not the only thing that caused me a bit of confusion 😕, do we really need this term.length >= 3? (I mean, the results are paged, right?) There is the option of using Antd form to indicate that minimum length, but I don't think it's that worth it. Well, wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure why it was implemented this way; of course that API can search by a single character. Also, here we don't show all results, but only a most relevant ones (20 or 25 - don't remember exactly) - I think it makes sense.

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 the idea was to reduce number of requests we send because it's less likely that a <3 characters term will be meaningful. We can drop this.

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
Copy link
Member

(The dragged parameters spec is flaky, will fix that in a few minutes)

@kravets-levko kravets-levko merged commit ba36b4e into master Dec 4, 2019
@kravets-levko kravets-levko deleted the migrate-add-visualization-to-dashboard-dialog branch December 4, 2019 15:50
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