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

Add deep link page number to task history page. #1801

Merged
merged 5 commits into from Aug 13, 2018
Merged

Conversation

@tamaccount
Copy link
Contributor

@tamaccount tamaccount commented May 18, 2018

No description provided.

@tamaccount tamaccount requested a review from andyhuang91 May 18, 2018
@andyhuang91
Copy link

@andyhuang91 andyhuang91 commented May 31, 2018

It looks like this doesn't automatically update the query param when the user clicks through the pagination buttons. We should add that so that these links become discoverable.

@@ -21,7 +21,7 @@ class UITable extends Component {
sortBy: defaultSortBy,
sortDirection: defaultSortDirection,
sortTime: null,
chunkNum: 1,
chunkNum: initialPageNumber || 1,

This comment has been minimized.

@andyhuang91

andyhuang91 Jun 6, 2018

This could also be done with default props.

{deleted || (
<TaskHistoryTable
requestId={requestId}
onPageChange={num => router.replace(`${location.pathname}?taskHistoryPage=${num}`)}

This comment has been minimized.

@andyhuang91

andyhuang91 Jun 6, 2018

This works. You could also pass in a location object with a query prop for react-router. That might be a little safer in terms of ensuring that you don't override any other existing query parameters or the location hash.

@@ -34,6 +34,18 @@ class TaskHistoryTable extends Component {
};
}

componentDidMount() {
const { requestId, initialPageNumber } = this.props;
if (initialPageNumber) {

This comment has been minimized.

@andyhuang91

andyhuang91 Jun 6, 2018

How is the data loaded if there is no initialPageNumber? The code for both cases should probably be in a single place.

…askHistoryTable's componentDidMount now that RequestDetailPage now passes the component a default initialPageNumber. Pass router.replace a location object in onPageChage prop for TaskHistoryTable.
Copy link

@andyhuang91 andyhuang91 left a comment

Looks like there's a merge conflict now. Aside from that, LGTM

@@ -34,6 +34,16 @@ class TaskHistoryTable extends Component {
};
}

componentDidMount() {
const { requestId, initialPageNumber } = this.props;
this.setState({ loading: true });

This comment has been minimized.

@andyhuang91

andyhuang91 Jul 3, 2018

This could be set as part of the initial state in the constructor

@ssalinas ssalinas added this to the 0.21.0 milestone Jul 9, 2018
@tamaccount tamaccount merged commit 9003962 into master Aug 13, 2018
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@ssalinas
Copy link
Member

@ssalinas ssalinas commented Aug 13, 2018

🚢

@ssalinas ssalinas deleted the deep-link-task-history branch Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.