OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
improve the code
bsatarnejaddf996ccf542e
diff --git a/frontend/src/app/modules/common/back-routing/back-routing.service.ts b/frontend/src/app/modules/common/back-routing/back-routing.service.tsindex 12e860fbaab..329a720c1d2 100644--- a/frontend/src/app/modules/common/back-routing/back-routing.service.ts+++ b/frontend/src/app/modules/common/back-routing/back-routing.service.ts@@ -48,6 +48,39 @@ export class BackRoutingService {constructor(readonly injector:Injector) {}+ private goToOtherState(route:string, params:{}):Promise<any> {++ return this.$state.go(route, params);+ }++ private goBackToDetailsState(preferListOverSplit:boolean, baseRoute:string):void {++ if (preferListOverSplit) {+ this.goToOtherState(baseRoute, this.backRoute.params);+ } else {+ this.goToOtherState(baseRoute + this.keepTab.currentDetailsSubState, this.backRoute.params);+ }+ }++ private goBackNotToDetailsState():void {++ if (this.backRoute.parent) {+ this.goToOtherState(this.backRoute.name, this.backRoute.params).then(() => { this.$state.reload(); });+ }+ else {+ this.goToOtherState(this.backRoute.name, this.backRoute.params);+ }+ }++ private goBackToPreviousState(preferListOverSplit:boolean, baseRoute:string):void {++ if (this.keepTab.isDetailsState(this.backRoute.parent)) {+ this.goBackToDetailsState(preferListOverSplit, baseRoute);+ } else {+ this.goBackNotToDetailsState();+ }+ }+public goBack(preferListOverSplit:boolean = false) {// Default: back to list// When coming from a deep link or a create form@@ -56,22 +89,9 @@ export class BackRoutingService {if (!this.backRoute && baseRoute.includes('show')) { this.$state.reload(); }else {if (!this.backRoute || this.backRoute.name.includes('new')) {- this.$state.go(baseRoute, this.$state.params);+ this.$state.go(baseRoute, this.$state.params);} else {- if (this.keepTab.isDetailsState(this.backRoute.parent)) {- if (preferListOverSplit) {- this.$state.go(baseRoute, this.backRoute.params);- } else {- this.$state.go(baseRoute + this.keepTab.currentDetailsSubState, this.backRoute.params);- }- } else {- if (this.backRoute.parent) {- this.$state.go(this.backRoute.name, this.backRoute.params).then(() => { this.$state.reload(); });- }- else {- this.$state.go(this.backRoute.name, this.backRoute.params);- }- }+ this.goBackToPreviousState(preferListOverSplit, baseRoute);}}}