Skip to content
Snippets Groups Projects
Commit 9926e32c authored by Dennis Tang's avatar Dennis Tang
Browse files

Fix page return error on project creation

In cases where you're not on the blank project creation form, if you
encounter a page error, you wouldn't be returned to the correct form and
would have to click back to it.
parent cc7fe57b
No related branches found
No related tags found
1 merge request!47804Finalize new create project UI experiment
......@@ -12,6 +12,7 @@ import ciCdProjectIllustration from '../illustrations/ci-cd-project.svg';
const BLANK_PANEL = 'blank_project';
const CI_CD_PANEL = 'cicd_for_external_repo';
const LAST_ACTIVE_TAB_KEY = 'new_project_last_active_tab';
const PANELS = [
{
name: BLANK_PANEL,
......@@ -105,7 +106,7 @@ export default {
this.handleLocationHashChange();
if (this.hasErrors) {
this.activeTab = BLANK_PANEL;
this.activeTab = localStorage.getItem(LAST_ACTIVE_TAB_KEY) || BLANK_PANEL;
}
window.addEventListener('hashchange', () => {
......@@ -127,6 +128,9 @@ export default {
handleLocationHashChange() {
this.activeTab = window.location.hash.substring(1) || null;
if (this.activeTab) {
localStorage.setItem(LAST_ACTIVE_TAB_KEY, this.activeTab);
}
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment