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: Namespace redirects no longer error and are snappier #2106

Merged
merged 2 commits into from
Jan 30, 2020

Conversation

simster7
Copy link
Member

Fixes #2102

Demo (notice managedNamespace redirection still happens): https://cl.ly/4f3a073db983

@simster7 simster7 requested a review from alexec January 30, 2020 20:28
@@ -29,16 +31,17 @@ export class ArchivedWorkflowList extends BasePage<RouteComponentProps<any>, Sta
}

private get namespace() {
return this.props.match.params.namespace || '';
return this.state.namespace;
Copy link
Member Author

Choose a reason for hiding this comment

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

Source of truth for namespace is now react state

}

private set namespace(namespace: string) {
document.location.href = uiUrl('archived-workflows/' + namespace);
this.setState({namespace});
history.pushState(null, '', uiUrl('cron-workflows/' + namespace));
Copy link
Member Author

Choose a reason for hiding this comment

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

This edits the URL without forcing a reload. This is cosmetic only, as the source of truth for the namespace is now on react state

}

constructor(props: RouteComponentProps<any>, context: any) {
super(props, context);
this.state = {continue: ''};
this.state = {continue: '', loading: true, namespace: this.props.match.params.namespace || ''};
Copy link
Member Author

Choose a reason for hiding this comment

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

Desired namespace is loaded from URL only once

}

public render() {
if (this.state.loading) {
return <Loading />;
Copy link
Member Author

Choose a reason for hiding this comment

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

Show a nice loading screen while API calls are being made

@codecov
Copy link

codecov bot commented Jan 30, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@aece7e6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #2106   +/-   ##
========================================
  Coverage          ?   8.89%           
========================================
  Files             ?      61           
  Lines             ?   34597           
  Branches          ?       0           
========================================
  Hits              ?    3079           
  Misses            ?   31131           
  Partials          ?     387

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aece7e6...bb96f8d. Read the comment docs.

@simster7 simster7 merged commit 516d05f into argoproj:master Jan 30, 2020
@simster7 simster7 deleted the fix-redirect branch January 30, 2020 21: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.

When changing panes in the UI, an error is briefly shown
2 participants