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(storage-browser): clear search on refresh and navigation #6063

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

pranavosu
Copy link
Member

@pranavosu pranavosu commented Nov 12, 2024

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • yarn test passes and tests are updated/added
  • PR title and commit messages follow conventional commit syntax
  • If this change should result in a version bump, changeset added (This can be done after creating the PR.) This does not apply to changes made to docs, e2e, examples, or other private packages.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@pranavosu pranavosu requested a review from a team as a code owner November 12, 2024 17:10
Copy link

changeset-bot bot commented Nov 12, 2024

⚠️ No Changeset found

Latest commit: 1a80d38

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

dindjarinjs
dindjarinjs previously approved these changes Nov 12, 2024
AllanZhengYP
AllanZhengYP previously approved these changes Nov 12, 2024
ashwinkumar6
ashwinkumar6 previously approved these changes Nov 12, 2024
Comment on lines 12 to 19
export interface SearchProps {
onSearch?: (term: string, includeSubfolders: boolean) => void;
onSearch?: () => void;
onSearchClear?: () => void;
searchQuery?: string;
onSearchQueryChange?: (query: string) => void;
searchPlaceholder?: string;
showIncludeSubfolders?: boolean;
children?: React.ReactNode;
}
Copy link
Member

Choose a reason for hiding this comment

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

Since you are touching the structure of the component code could you make some updates, can be done in a follow up:

export interface SearchFieldProps {
  id?: string;
  label?: React.ReactNode
  query?: string;
  onQuery?: (query: string) => void;
  onSearch?: () => void;
  onClear?: () => void;
  placeholder?: string;
}

@@ -68,23 +65,11 @@ export const Search = ({
</Field>
<ButtonElement
className={`${BLOCK_NAME}__submit-button`}
onClick={() => onSearch?.(term, subfoldersIncluded)}
onClick={() => onSearch?.()}
Copy link
Member

Choose a reason for hiding this comment

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

Should be able to just pass onSearch idiomatically, same with onSearchClear?

</LabelElement>
</SpanElement>
) : null}
{children ?? null}
Copy link
Member

Choose a reason for hiding this comment

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

Since we have decoupled the subfolder checkbox we should remove children and let the parent view wrap the controls for positioning

Copy link
Member Author

@pranavosu pranavosu Nov 12, 2024

Choose a reason for hiding this comment

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

I know we're trying to get rid of the wrapping divs, I can remove those and the children from Search at the same time in a follow up, if that makes sense. It's non-trivial to address it here

@pranavosu pranavosu merged commit bff2bc3 into feat-storage-browser/main Nov 12, 2024
36 checks passed
@pranavosu pranavosu deleted the feat-storage-browser/search-nav branch November 12, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants