Skip to content

chore(content-explorer): Migrate Header#3887

Merged
greg-in-a-box merged 2 commits intobox:masterfrom
greg-in-a-box:content-explorer-search
Feb 27, 2025
Merged

chore(content-explorer): Migrate Header#3887
greg-in-a-box merged 2 commits intobox:masterfrom
greg-in-a-box:content-explorer-search

Conversation

@greg-in-a-box
Copy link
Contributor

@greg-in-a-box greg-in-a-box commented Feb 4, 2025

Default Page
Screenshot 2025-02-21 at 3 20 12 PM

With Search Input entered
Screenshot 2025-02-21 at 3 21 07 PM

Box Logo
Screenshot 2025-02-21 at 3 23 10 PM

@greg-in-a-box greg-in-a-box force-pushed the content-explorer-search branch 3 times, most recently from e144539 to f3b56a1 Compare February 7, 2025 21:16
@greg-in-a-box greg-in-a-box marked this pull request as ready for review February 7, 2025 21:24
@greg-in-a-box greg-in-a-box requested review from a team as code owners February 7, 2025 21:24
const isSearch = view === VIEW_SEARCH;

return (
<div className="be-header">
Copy link
Collaborator

Choose a reason for hiding this comment

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

make sure the styles such as background and font size are using blueprint's token to support future customizability.

aria-label={searchMessage}
data-testid="be-Header-searchInput"
<SearchInput
className="my-class"
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove class

data-testid="be-Header-searchInput"
<SearchInput
className="my-class"
defaultValue=""
Copy link
Contributor

Choose a reason for hiding this comment

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

does it need a default value?

Copy link
Collaborator

Choose a reason for hiding this comment

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

checked defaultValue is not a required prop so im gonna remove it

// eslint-disable-next-line react/prop-types
const Header = ({ isHeaderLogoVisible = true, view, isSmall, searchQuery, onSearch, logoUrl, intl }: Props) => {
const { formatMessage } = intl;
const search = ({ currentTarget }: { currentTarget: HTMLInputElement }) => onSearch(currentTarget.value);
Copy link
Contributor

@tjuanitas tjuanitas Feb 19, 2025

Choose a reason for hiding this comment

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

can we double check that this behavior is the same? i.e. onSearch is now passed directly to the component rather than needing this wrapper

Copy link
Collaborator

Choose a reason for hiding this comment

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

verified that the value passed into onSearch function is exact value I typed into the searchbar.

view: View;
}

// eslint-disable-next-line react/prop-types
Copy link
Contributor

Choose a reason for hiding this comment

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

why does it need this eslint?

Copy link
Collaborator

Choose a reason for hiding this comment

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

removed

Comment on lines +7 to +8
max-width: 240px;
max-height: 40px;
Copy link
Contributor

Choose a reason for hiding this comment

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

240px is huge, is this correct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure about this one, looks like intended change for max width and height. @greg-in-a-box could you double confirm this one when you get back. ill leave this as it is for now.

Copy link
Contributor Author

@greg-in-a-box greg-in-a-box Feb 26, 2025

Choose a reason for hiding this comment

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

requested by design to increase the width and height to max the search bar

@@ -0,0 +1 @@
export {default} from './Header';
Copy link
Contributor

Choose a reason for hiding this comment

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

not formatted

Copy link
Collaborator

Choose a reason for hiding this comment

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

updated

}

if (typeof url === 'string') {
return <img alt="" className="be-logo-custom" src={url} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we use an alt for accessibility?


function getLogo(url?: string) {
if (url === 'box') {
return <BoxLogo width={45} height={25} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

im surprised didn't complain about sorted props

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

logoUrl?: string,
onSearch: Function,
onSearch: any,
searchQuery: string,
Copy link
Contributor

Choose a reason for hiding this comment

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

searchQuery isn't required prop anymore?

Copy link
Collaborator

Choose a reason for hiding this comment

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

searchQuery was used for input value prop. The searchInput has a self-controlled value state.

Copy link
Contributor

Choose a reason for hiding this comment

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

can this be moved to the common/__mocks__ folder? needs to rebase first

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, gonna rebase and resolve conflicts for this.

@tjiang-box tjiang-box force-pushed the content-explorer-search branch from f3b56a1 to 49b3c73 Compare February 21, 2025 21:26
@@ -1,2 +1 @@
// @flow
Copy link
Contributor

Choose a reason for hiding this comment

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

flow file still needs this, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

still need it because of contentExplorer.js flow file

@greg-in-a-box greg-in-a-box merged commit 97bc5e7 into box:master Feb 27, 2025
4 checks passed
@greg-in-a-box greg-in-a-box deleted the content-explorer-search branch February 27, 2025 22:04
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.

3 participants