mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
99053: Fixed previous page not always returning the correct value
- Fixed previousPage not correctly redirecting to urls with queryParams - Fixed previousPage returning to wrong page because of ReviewersListComponent
This commit is contained in:
@@ -19,6 +19,7 @@ import { NotificationsService } from '../../../shared/notifications/notification
|
|||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service';
|
import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service';
|
||||||
import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service';
|
import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service';
|
||||||
|
import { ReviewersListComponent } from './reviewers-list/reviewers-list.component';
|
||||||
|
|
||||||
export const ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER = 'submit_select_reviewer';
|
export const ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER = 'submit_select_reviewer';
|
||||||
export const ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER = 'selectrevieweraction';
|
export const ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER = 'selectrevieweraction';
|
||||||
@@ -130,4 +131,12 @@ export class AdvancedWorkflowActionSelectReviewerComponent extends AdvancedWorkf
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hardcoded the previous page url because the {@link ReviewersListComponent} changes the previous route when
|
||||||
|
* switching between the different pages
|
||||||
|
*/
|
||||||
|
previousPage(): void {
|
||||||
|
void this.router.navigate(['/mydspace'], { queryParams: { configuration: 'workflow' } });
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ import { map, switchMap, take } from 'rxjs/operators';
|
|||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { WorkflowItem } from '../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../core/submission/models/workflowitem.model';
|
||||||
import { Item } from '../core/shared/item.model';
|
import { Item } from '../core/shared/item.model';
|
||||||
import { ActivatedRoute, Data, Router } from '@angular/router';
|
import { ActivatedRoute, Data, Router, Params } from '@angular/router';
|
||||||
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service';
|
||||||
import { RouteService } from '../core/services/route.service';
|
import { RouteService } from '../core/services/route.service';
|
||||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
import { NotificationsService } from '../shared/notifications/notifications.service';
|
||||||
@@ -72,7 +72,13 @@ export abstract class WorkflowItemActionPageComponent implements OnInit {
|
|||||||
if (isEmpty(url)) {
|
if (isEmpty(url)) {
|
||||||
url = '/mydspace';
|
url = '/mydspace';
|
||||||
}
|
}
|
||||||
this.router.navigateByUrl(url);
|
const params: Params = {};
|
||||||
|
if (url.split('?').length > 1) {
|
||||||
|
for (const param of url.split('?')[1].split('&')) {
|
||||||
|
params[param.split('=')[0]] = param.split('=')[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void this.router.navigate([url.split('?')[0]], { queryParams: params });
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user