mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
scripts & processes improvements
This commit is contained in:
@@ -18,6 +18,18 @@
|
||||
</ds-process-detail-field>
|
||||
</div>
|
||||
|
||||
<ds-process-detail-field *ngIf="process && process.startTime" id="process-start-time" [title]="'process.detail.start-time' | translate">
|
||||
<div>{{ process.startTime }}</div>
|
||||
</ds-process-detail-field>
|
||||
|
||||
<ds-process-detail-field *ngIf="process && process.endTime" id="process-end-time" [title]="'process.detail.end-time' | translate">
|
||||
<div>{{ process.endTime }}</div>
|
||||
</ds-process-detail-field>
|
||||
|
||||
<ds-process-detail-field *ngIf="process && process.processStatus" id="process-status" [title]="'process.detail.status' | translate">
|
||||
<div>{{ process.processStatus }}</div>
|
||||
</ds-process-detail-field>
|
||||
|
||||
<!--<ds-process-detail-field id="process-output" [title]="'process.detail.output'">-->
|
||||
<!--<pre class="font-weight-bold text-secondary bg-light p-3">{{'process.detail.output.alert' | translate}}</pre>-->
|
||||
<!--</ds-process-detail-field>-->
|
||||
|
@@ -12,6 +12,8 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
describe('NewProcessComponent', () => {
|
||||
let component: NewProcessComponent;
|
||||
@@ -57,6 +59,8 @@ describe('NewProcessComponent', () => {
|
||||
providers: [
|
||||
{ provide: ScriptDataService, useValue: scriptService },
|
||||
{ provide: NotificationsService, useClass: NotificationsServiceStub },
|
||||
{ provide: RequestService, useValue: {} },
|
||||
{ provide: Router, useValue: {} },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
|
@@ -9,7 +9,8 @@ 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 { pipe } from 'rxjs';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
/**
|
||||
* Component to create a new script
|
||||
@@ -45,7 +46,12 @@ export class NewProcessComponent implements OnInit {
|
||||
*/
|
||||
public missingParameters = [];
|
||||
|
||||
constructor(private scriptService: ScriptDataService, private notificationsService: NotificationsService, private translationService: TranslateService) {
|
||||
constructor(
|
||||
private scriptService: ScriptDataService,
|
||||
private notificationsService: NotificationsService,
|
||||
private translationService: TranslateService,
|
||||
private requestService: RequestService,
|
||||
private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -75,6 +81,7 @@ export class NewProcessComponent implements OnInit {
|
||||
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)
|
||||
this.sendBack();
|
||||
} else {
|
||||
const title = this.translationService.get('process.new.notification.error.title');
|
||||
const content = this.translationService.get('process.new.notification.error.content');
|
||||
@@ -123,6 +130,13 @@ export class NewProcessComponent implements OnInit {
|
||||
}
|
||||
return this.missingParameters.length > 0;
|
||||
}
|
||||
|
||||
private sendBack() {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
export function controlContainerFactory(controlContainer?: ControlContainer) {
|
||||
|
@@ -1,5 +1,8 @@
|
||||
<div class="container">
|
||||
<h2>{{'process.overview.title' | translate}}</h2>
|
||||
<div class="d-flex">
|
||||
<h2 class="flex-grow-1">{{'process.overview.title' | translate}}</h2>
|
||||
<button class="btn btn-lg btn-success " routerLink="/processes/new"><i class="fas fa-plus pr-2"></i>{{'process.overview.new' | translate}}</button>
|
||||
</div>
|
||||
<ds-pagination *ngIf="(processesRD$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="pageConfig"
|
||||
[pageInfoState]="(processesRD$ | async)?.payload"
|
||||
@@ -7,7 +10,8 @@
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
(pageChange)="onPageChange($event)">
|
||||
<table class="table table-striped table-hover table-responsive">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{{'process.overview.table.id' | translate}}</th>
|
||||
@@ -29,5 +33,6 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
</div>
|
||||
|
@@ -1965,6 +1965,12 @@
|
||||
|
||||
"process.detail.title" : "Process: {{ id }} - {{ name }}",
|
||||
|
||||
"process.detail.start-time" : "Start time",
|
||||
|
||||
"process.detail.end-time" : "Finish time",
|
||||
|
||||
"process.detail.status" : "Status",
|
||||
|
||||
|
||||
|
||||
"process.overview.table.finish" : "Finish time",
|
||||
@@ -1983,6 +1989,8 @@
|
||||
|
||||
"process.overview.breadcrumbs": "Processes Overview",
|
||||
|
||||
"process.overview.new": "New",
|
||||
|
||||
|
||||
"profile.breadcrumbs": "Update Profile",
|
||||
|
||||
|
Reference in New Issue
Block a user