Skip to content

Commit

Permalink
Remove query parameters from UI browse button
Browse files Browse the repository at this point in the history
- Fixes #9484
- Removed `queryStringSuffix` for directory rendering since we should
only base it off the input path field

pr-link: #9551
change-id: cid-7603541c8a06d8c65e347b1ddc33074cc1aedc1b
  • Loading branch information
tieujason330 authored and alluxio-bot committed Jul 30, 2019
1 parent f73ded5 commit 9a6cc46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions webui/master/src/containers/pages/Browse/Browse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class Browse extends React.Component<AllProps, IBrowseState> {
<div className="row">
<div className="col-12">
{!browseData.currentDirectory.isDirectory && this.renderFileView(browseData, queryStringSuffix, initData)}
{browseData.currentDirectory.isDirectory && this.renderDirectoryListing(initData, browseData, queryStringSuffix)}
{browseData.currentDirectory.isDirectory && this.renderDirectoryListing(initData, browseData)}
</div>
</div>
</div>
Expand Down Expand Up @@ -194,7 +194,7 @@ export class Browse extends React.Component<AllProps, IBrowseState> {
);
}

private renderDirectoryListing(initData: IInit, browseData: IBrowse, queryStringSuffix: string) {
private renderDirectoryListing(initData: IInit, browseData: IBrowse) {
const {path, offset, limit} = this.state;
const {history} = this.props;
const fileInfos = browseData.fileInfos;
Expand All @@ -204,18 +204,18 @@ export class Browse extends React.Component<AllProps, IBrowseState> {
<Form className="mb-3 browse-directory-form" id="browseDirectoryForm" inline={true}
onSubmit={disableFormSubmit}>
<FormGroup className="mb-2 mr-sm-2">
<Button tag={Link} to={`/browse?path=/${queryStringSuffix}`} color="secondary"
<Button tag={Link} to={`/browse?path=/`} color="secondary"
outline={true}>Root</Button>
</FormGroup>
<FormGroup className="mb-2 mr-sm-2">
<Label for="browsePath" className="mr-sm-2">Path</Label>
<Input type="text" id="browsePath" placeholder="Enter a Path" value={path || '/'}
onChange={pathInputHandler}
onKeyUp={this.createInputEnterHandler(history, () =>
`/browse?path=${path}${queryStringSuffix}`)}/>
`/browse?path=${path}`)}/>
</FormGroup>
<FormGroup className="mb-2 mr-sm-2">
<Button tag={Link} to={`/browse?path=${encodeURIComponent(path || '/')}${queryStringSuffix}`}
<Button tag={Link} to={`/browse?path=${encodeURIComponent(path || '/')}`}
color="secondary">Go</Button>
</FormGroup>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ exports[`Browse Shallow component Matches snapshot 1`] = `
color="secondary"
outline={true}
tag={[Function]}
to="/browse?path=/&offset=0"
to="/browse?path=/"
>
Root
</Button>
Expand Down Expand Up @@ -1127,7 +1127,7 @@ exports[`Browse Shallow component Matches snapshot 1`] = `
<Button
color="secondary"
tag={[Function]}
to="/browse?path=%2F&offset=0"
to="/browse?path=%2F"
>
Go
</Button>
Expand Down

0 comments on commit 9a6cc46

Please sign in to comment.