Unverified Commit aca573fd authored by Le Roy Loïc's avatar Le Roy Loïc Committed by GitHub
Browse files

Merge pull request #57 from ProgrammeVitam/vas_api_supervision_pr

[VAS] Journal des Opérations
parents 75e244bf 09a6f084
......@@ -643,7 +643,6 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
......@@ -2958,16 +2957,6 @@
"integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==",
"dev": true
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"optional": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"blob": {
"version": "0.0.5",
"resolved": "https://nexus.dev.programmevitam.fr/repository/npm-group/blob/-/blob-0.0.5.tgz",
......@@ -5719,13 +5708,6 @@
}
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true,
"optional": true
},
"fileset": {
"version": "2.0.3",
"resolved": "https://nexus.dev.programmevitam.fr/repository/npm-group/fileset/-/fileset-2.0.3.tgz",
......@@ -12982,6 +12964,7 @@
},
"ui-frontend-common": {
"version": "file:../ui-frontend-common/ui-frontend-common-0.1.0.tgz",
"integrity": "sha512-wY+WkyoMe7RllQ8gIdculWTweuSgnMwhdTzrKMyqOxprLTObj2FBRLm95va/3JNMgAuWf5/d7VlSObjjgjnusg==",
"requires": {
"@angular/animations": "8.2.14",
"@angular/cdk": "^8.2.3",
......@@ -13536,7 +13519,6 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
......@@ -13924,7 +13906,6 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1"
}
},
......
......@@ -111,6 +111,15 @@ const routes: Routes = [
data: {appId: 'PROBATIVE_VALUE_APP'}
},
// =====================================================
// LOGBOOK OPERATION API
// =====================================================
{
path: 'logbook-operation',
loadChildren: () => import('./logbook-operation/logbook-operation.module').then(m => m.LogbookOperationModule),
canActivate: [AuthGuard, AppGuard],
data: { appId: 'LOGBOOK_OPERATION_APP' }
},
// =====================================================
// DSL
// =====================================================
{
......
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
*
* contact@programmevitam.fr
*
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
export interface EventFilter {
type?: 'INGEST' | 'ELIMINATION' | 'MASTERDATA';
status?: 'RUNNING' | 'ERROR' | 'DONE';
dateRange?: { startDate: Date, endDate: Date };
}
<div class="vitamui-sidepanel">
<div class="vitamui-sidepanel-header">
<ng-container *ngIf="!isPopup">
<button class="btn-popup" role="button" (click)="openPopup()"><i class="vitamui-icon vitamui-icon-pin"></i></button>
</ng-container>
<button class="btn-close" role="button" (click)="emitClose()"><i class="material-icons">close</i></button>
<div class="header-container">
<div class="title">
<div class="status-badge-mini" [ngClass]="event | eventTypeBadgeClass">
<i class="vitamui-icon vitamui-icon-api-supervision vitamui-row-icon status-badge"></i>
</div>
<h2>{{ event?.id }}</h2>
</div>
</div>
</div>
<div class="vitamui-sidepanel-body">
<mat-tab-group class="preview-tab-group">
<mat-tab label="Informations" i18n-label="Information tab@@eventDetailTabInformation">
<div class="read-only-field">
<label i18n="Operation category@@logbookOperationCategory">Catégorie d'opération</label>
<div class="word-break">{{ event?.typeProc }}</div>
</div>
<div class="panel-row">
<div class="read-only-field">
<label i18n="External Agencies Identifiers@@logbookOperationAgIdExt">Identifiants des agents externes</label>
<div class="word-break">{{ event?.agIdExt }}</div>
</div>
<div class="read-only-field">
<label i18n="Associated Contract@@logbookOperationContract">Contrat associé</label>
<div class="word-break">{{ event?.rightsStatementIdentifier }}</div>
</div>
</div>
<div class="panel-row">
<div class="read-only-field">
<label i18n="Application Identifier@@logbookOperationApplicationId">Identification de l'application</label>
<div class="word-break">{{ event?.agIdApp }}</div>
</div>
<div class="read-only-field">
<label i18n="Transaction number@@logbookOperationTransactionNumber">Numéro de transaction</label>
<div class="word-break">{{ event?.idRequest }}</div>
</div>
</div>
<div class="panel-row">
<div class="read-only-field">
<label i18n="Operation Identifier@@logbookOperationOPI">Identification de l'opération</label>
<div class="word-break">{{ event?.objectId }}</div>
</div>
<div class="read-only-field">
<label i18n="Agency identifier@@logbookOperationAgId">Acteur(s) interne(s)</label>
<div class="word-break">{{ event?.agId }}</div>
</div>
</div>
<div class="read-only-field">
<label i18n="Report@@logbookOperationReport">Rapport</label>
<div>-</div>
</div>
<div class="read-only-field">
<label i18n="Additionnal Infos@@logbookOperationAddInfos">Informations complémentaires sur l'opération</label>
<div class="word-break">{{ event?.data }}</div>
</div>
<div class="read-only-field">
<label i18n="Message@@logbookOperationMessage">Message</label>
<div>{{ (event | lastEvent)?.outMessage }}</div>
</div>
</mat-tab>
<mat-tab label="Historique" i18n-label="History tab@@eventDetailTabInformation">
<vitamui-common-history-events [events]="event?.events"></vitamui-common-history-events>
</mat-tab>
</mat-tab-group>
</div>
<div class="vitamui-sidepanel-loading-overlay" *ngIf="loading" @fadeInOut>
<mat-spinner color="accent" diameter="40"></mat-spinner>
</div>
</div>
.title {
max-width: 504px;
h2 {
word-break: break-all;
}
.vitamui-icon.no-margin {
margin-right: 0;
}
.status-badge-mini {
margin-right: 10px;
&:after {
margin-left: -11px;
margin-top: -11px;
width: 9px;
height: 9px;
}
}
}
.panel-row {
display: flex;
}
.word-break {
word-break: break-all;
}
.vitamui-sidepanel-loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.5);
z-index: 1;
display: flex;
align-items: center;
justify-content: center;
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
*
* contact@programmevitam.fr
*
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
import { AuthService, LogbookService } from 'ui-frontend-common';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivatedRoute } from '@angular/router';
import { EventTypeBadgeClassPipe } from '../logbook-operation-list/event-type-badge-class.pipe';
import { LastEventPipe } from '../logbook-operation-list/last-event.pipe';
import { LogbookOperationDetailComponent } from './logbook-operation-detail.component';
describe('LogbookOperationDetailComponent', () => {
let component: LogbookOperationDetailComponent;
let fixture: ComponentFixture<LogbookOperationDetailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [LogbookOperationDetailComponent, EventTypeBadgeClassPipe, LastEventPipe ],
providers: [
{ provide: LogbookService, useValue: {} },
{ provide: AuthService, useValue: {} },
{ provide: ActivatedRoute, useValue: {} },
],
schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LogbookOperationDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
*
* contact@programmevitam.fr
*
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
import { animate, style, transition, trigger } from '@angular/animations';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AuthService, Event, LogbookService } from 'ui-frontend-common';
@Component({
selector: 'app-logbook-operation-detail',
templateUrl: './logbook-operation-detail.component.html',
styleUrls: ['./logbook-operation-detail.component.scss'],
animations: [
trigger('fadeInOut', [
transition(':enter', [
style({ opacity: 0 }),
animate('200ms', style({ opacity: 1 })),
]),
transition(':leave', [
style({ opacity: 1 }),
animate('200ms', style({ opacity: 0 })),
]),
])
]
})
export class LogbookOperationDetailComponent implements OnInit, OnChanges {
@Input() eventId: string;
@Input() tenantIdentifier: number;
@Input() isPopup: boolean;
@Output() closePanel = new EventEmitter();
event: Event;
loading: boolean;
constructor(private logbookService: LogbookService, private authService: AuthService, private route: ActivatedRoute) {
}
ngOnInit() {
}
ngOnChanges(changes: SimpleChanges) {
if (changes.eventId || changes.tenantIdentifier) {
this.refreshEvents();
}
}
openPopup() {
window.open('/logbook-operation/tenant/' + this.tenantIdentifier + '/event/' + this.event.id,
'detailPopup', 'width=584, height=713, resizable=no, location=no');
this.emitClose();
}
closePopup() {
window.close();
}
emitClose() {
this.closePanel.emit();
}
private refreshEvents() {
if (!this.tenantIdentifier || !this.eventId) {
return;
}
const tenant = this.authService.getTenantByAppAndIdentifier(this.route.snapshot.data.appId, this.tenantIdentifier);
if (!tenant) {
return;
}
const accessContractLogbookIdentifier = tenant.accessContractLogbookIdentifier || '';
this.loading = true;
this.logbookService.getOperationById(this.eventId, this.tenantIdentifier, accessContractLogbookIdentifier)
.subscribe((event) => {
this.event = event;
this.loading = false;
});
}
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
*
* contact@programmevitam.fr
*
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-logbook-operation-popup',
template: `
<app-logbook-operation-detail
(closePanel)="closePopup()"
[eventId]="eventId"
[tenantIdentifier]="tenantIdentifier"
[isPopup]="true"
></app-logbook-operation-detail>
`
})
export class LogbookOperationPopupComponent implements OnInit {
eventId: string;
tenantIdentifier: number;
constructor(private route: ActivatedRoute) {
}
ngOnInit() {
this.eventId = this.route.snapshot.paramMap.get('id');
this.tenantIdentifier = +this.route.snapshot.paramMap.get('tenantIdentifier');
}
closePopup() {
window.close();
}
}
/*
* Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2020)
* and the signatories of the "VITAM - Accord du Contributeur" agreement.
*
* contact@programmevitam.fr
*
* This software is a computer program whose purpose is to implement
* implement a digital archiving front-office system for the secure and
* efficient high volumetry VITAM solution.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
import { EventTypeBadgeClassPipe } from './event-type-badge-class.pipe';
describe('EventTypeBadgeClassPipe', () => {
it('create an instance', () => {
const pipe = new EventTypeBadgeClassPipe();
expect(pipe).toBeTruthy();
});
});