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