forked from hazza/dspace-angular
Cache redesign part 1, and add support for alternative links
This commit is contained in:
@@ -5,12 +5,13 @@ import { ProcessParameter } from '../processes/process-parameter.model';
|
||||
import { ScriptDataService } from '../../core/data/processes/script-data.service';
|
||||
import { ControlContainer, NgForm } from '@angular/forms';
|
||||
import { ScriptParameter } from '../scripts/script-parameter.model';
|
||||
import { RequestEntry } from '../../core/data/request.reducer';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { getProcessListRoute } from '../process-page-routing.paths';
|
||||
|
||||
/**
|
||||
* Component to create a new script
|
||||
@@ -80,9 +81,9 @@ export class ProcessFormComponent implements OnInit {
|
||||
}
|
||||
);
|
||||
this.scriptService.invoke(this.selectedScript.id, stringParameters, this.files)
|
||||
.pipe(take(1))
|
||||
.subscribe((requestEntry: RequestEntry) => {
|
||||
if (requestEntry.response.isSuccessful) {
|
||||
.pipe(getFirstCompletedRemoteData())
|
||||
.subscribe((rd: RemoteData<Process>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
const title = this.translationService.get('process.new.notification.success.title');
|
||||
const content = this.translationService.get('process.new.notification.success.content');
|
||||
this.notificationsService.success(title, content);
|
||||
@@ -142,7 +143,7 @@ export class ProcessFormComponent implements OnInit {
|
||||
this.requestService.removeByHrefSubstring('/processes');
|
||||
/* should subscribe on the previous method to know the action is finished and then navigate,
|
||||
will fix this when the removeByHrefSubstring changes are merged */
|
||||
this.router.navigateByUrl('/processes');
|
||||
this.router.navigateByUrl(getProcessListRoute());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user