Skip to content
Snippets Groups Projects
Commit 32dc751d authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

Merge branch 'feature/integration-pastis-app' of...

Merge branch 'feature/integration-pastis-app' of https://dci-gitlab.cines.fr/dad/integration-pastis into feature/intégration-librairie-css
parents 3a2fd8aa 596f2df1
No related branches found
No related tags found
5 merge requests!58compare branch,!54Comparaison de merge vers vitam-ui,!53Comparaison de merge vers vitam-ui,!52Voir difference entre les deux verion,!41MAJ: compare to vitam-ui
Showing
with 3541 additions and 179 deletions
/* /*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr] [dad@cines.fr]
This software is a computer program whose purpose is to provide This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive a web application to create, edit, import and export archive
profiles based on the french SEDA standard profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/). (https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and 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, 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 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 license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
...@@ -28,25 +28,25 @@ that may mean that it is complicated to manipulate, and that also ...@@ -28,25 +28,25 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had 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. knowledge of the CeCILL-C license and that you accept its terms.
*/ */
import { EventEmitter, Injectable, Output } from '@angular/core'; import {Injectable} from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import {MatDialog} from '@angular/material/dialog';
import { BehaviorSubject, Observable } from 'rxjs'; import {BehaviorSubject, Observable} from 'rxjs';
import { SedaData, SedaElementConstants, SedaCardinalityConstants } from '../../profile/edit-profile/classes/seda-data'; import {SedaCardinalityConstants, SedaData, SedaElementConstants} from '../../profile/edit-profile/classes/seda-data';
import { FileNode, TypeConstants,FileNodeInsertParams, FileNodeInsertAttributeParams } from '../../profile/edit-profile/classes/file-node'; import {FileNode, TypeConstants} from '../../profile/edit-profile/classes/file-node';
import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; import {PastisDialogConfirmComponent} from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component';
import { ProfileService } from './profile.service'; import {ProfileService} from './profile.service';
import { PastisDialogData } from 'projects/pastis/src/app/shared/pastis-dialog/classes/pastis-dialog-data'; import {PastisDialogData} from 'projects/pastis/src/app/shared/pastis-dialog/classes/pastis-dialog-data';
import { SedaService } from './seda.service'; import {SedaService} from './seda.service';
import { FileTreeMetadataService } from '../../profile/edit-profile/file-tree-metadata/file-tree-metadata.service'; import {FileTreeMetadataService} from '../../profile/edit-profile/file-tree-metadata/file-tree-metadata.service';
import { PuaService } from './pua.service'; import {PuaService} from './pua.service';
import { ComponentType } from '@angular/cdk/portal'; import {ComponentType} from '@angular/cdk/portal';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -54,17 +54,6 @@ import { ComponentType } from '@angular/cdk/portal'; ...@@ -54,17 +54,6 @@ import { ComponentType } from '@angular/cdk/portal';
export class FileService { export class FileService {
@Output()
public addNode: EventEmitter<FileNode> = new EventEmitter<FileNode>();
@Output()
public insertItem: EventEmitter<FileNodeInsertParams> = new EventEmitter<FileNodeInsertParams>();
@Output()
public insertAttributes: EventEmitter<FileNodeInsertAttributeParams> = new EventEmitter<FileNodeInsertAttributeParams>();
@Output()
public removeNode: EventEmitter<FileNode> = new EventEmitter<FileNode>();
@Output()
public renderChanges: EventEmitter<boolean> = new EventEmitter<boolean>();
dataChange = new BehaviorSubject<FileNode[]>([]); dataChange = new BehaviorSubject<FileNode[]>([]);
profile = new BehaviorSubject<any>([]); profile = new BehaviorSubject<any>([]);
notice = new BehaviorSubject<any>([]); notice = new BehaviorSubject<any>([]);
...@@ -79,7 +68,7 @@ export class FileService { ...@@ -79,7 +68,7 @@ export class FileService {
tabChildrenRulesChange = new BehaviorSubject<string[][]>([]); tabChildrenRulesChange = new BehaviorSubject<string[][]>([]);
parentNodeMap = new Map<FileNode, FileNode>(); parentNodeMap = new Map<FileNode, FileNode>();
constructor(private profileService: ProfileService, private fileMetadataService: FileTreeMetadataService, constructor(private profileService: ProfileService, private fileMetadataService: FileTreeMetadataService,
...@@ -90,6 +79,10 @@ export class FileService { ...@@ -90,6 +79,10 @@ export class FileService {
return this.dataChange; return this.dataChange;
} }
reinitialisaDataChange() {
this.dataChange = new BehaviorSubject<FileNode[]>([]);
}
addSedaMetadataToFileTree(id:number){ addSedaMetadataToFileTree(id:number){
this.profileService.getProfile(id).subscribe((response) => { this.profileService.getProfile(id).subscribe((response) => {
this.profile.next(response); this.profile.next(response);
...@@ -116,7 +109,7 @@ export class FileService { ...@@ -116,7 +109,7 @@ export class FileService {
return this.dataChange; return this.dataChange;
} }
sedaDataArchiveUnit : SedaData; sedaDataArchiveUnit : SedaData;
...@@ -125,9 +118,9 @@ export class FileService { ...@@ -125,9 +118,9 @@ export class FileService {
* *
* Les nodes correspondant aux ArchivesUnit * Les nodes correspondant aux ArchivesUnit
* se réfèrent à la définition SEDA de l'ArchiveUnit mère (ils sont récursifs...) * se réfèrent à la définition SEDA de l'ArchiveUnit mère (ils sont récursifs...)
* @param parent * @param parent
* @param _nodes * @param _nodes
* @param sedaData * @param sedaData
*/ */
linkFileNodeToSedaData(parent: FileNode, _nodes: FileNode[], sedaData: SedaData[]){ linkFileNodeToSedaData(parent: FileNode, _nodes: FileNode[], sedaData: SedaData[]){
Array.prototype.forEach.call((_nodes: any,node: any) => { Array.prototype.forEach.call((_nodes: any,node: any) => {
...@@ -202,7 +195,7 @@ export class FileService { ...@@ -202,7 +195,7 @@ export class FileService {
openPopup(popData: PastisDialogData){ openPopup(popData: PastisDialogData){
const dialogConfirmRef = this.dialog.open(PastisDialogConfirmComponent, { const dialogConfirmRef = this.dialog.open(PastisDialogConfirmComponent, {
width: popData.width, width: popData.width,
height: popData.height, height: popData.height,
data: popData, data: popData,
panelClass: 'pastis-popup-modal-box' panelClass: 'pastis-popup-modal-box'
...@@ -232,7 +225,7 @@ export class FileService { ...@@ -232,7 +225,7 @@ export class FileService {
} }
} }
} }
setCollectionName(collectionName:string){ setCollectionName(collectionName:string){
this.collectionName.next(collectionName); this.collectionName.next(collectionName);
} }
...@@ -240,12 +233,12 @@ export class FileService { ...@@ -240,12 +233,12 @@ export class FileService {
setTabRootMetadataName(rootTabMetadataName:string){ setTabRootMetadataName(rootTabMetadataName:string){
this.rootTabMetadataName.next(rootTabMetadataName); this.rootTabMetadataName.next(rootTabMetadataName);
} }
openDialogWithTemplateRef(templateRef: ComponentType<unknown>) { openDialogWithTemplateRef(templateRef: ComponentType<unknown>) {
this.dialog.open(templateRef); this.dialog.open(templateRef);
} }
setNewChildrenRules(rules:string[][]){ setNewChildrenRules(rules:string[][]){
this.tabChildrenRulesChange.next(rules); this.tabChildrenRulesChange.next(rules);
} }
...@@ -271,7 +264,7 @@ export class FileService { ...@@ -271,7 +264,7 @@ export class FileService {
updateItem(node: FileNode) { updateItem(node: FileNode) {
this.dataChange.next(node[0]); this.dataChange.next(node[0]);
console.log("Node updated to : ", this.dataChange.getValue()) console.log("Node updated to : ", this.dataChange.getValue())
} }
removeItem(nodesToBeDeleted: FileNode[], root: FileNode) { removeItem(nodesToBeDeleted: FileNode[], root: FileNode) {
...@@ -286,7 +279,7 @@ export class FileService { ...@@ -286,7 +279,7 @@ export class FileService {
if (index !== -1) { if (index !== -1) {
parentNode.children.splice(index, 1); parentNode.children.splice(index, 1);
this.parentNodeMap.delete(nodeToBeDeleted); this.parentNodeMap.delete(nodeToBeDeleted);
} }
console.log("Deleted node : ", nodeToBeDeleted, "and his parent : ", parentNode); console.log("Deleted node : ", nodeToBeDeleted, "and his parent : ", parentNode);
} }
} }
...@@ -388,11 +381,11 @@ export class FileService { ...@@ -388,11 +381,11 @@ export class FileService {
getComplexSedaChildrenAsFileNode(sedaElement:SedaData):FileNode[] { getComplexSedaChildrenAsFileNode(sedaElement:SedaData):FileNode[] {
// Insert all children of complex elements based on SEDA definition // Insert all children of complex elements based on SEDA definition
if (sedaElement.Element === SedaElementConstants.complex && if (sedaElement.Element === SedaElementConstants.complex &&
sedaElement.Children.length > 0) { sedaElement.Children.length > 0) {
let fileNodeComplexChildren : FileNode[] = []; let fileNodeComplexChildren : FileNode[] = [];
sedaElement.Children.forEach((child: { Cardinality: string; Name: string; Type: string; }) => { sedaElement.Children.forEach((child: { Cardinality: string; Name: string; Type: string; }) => {
if (child.Cardinality === SedaCardinalityConstants.one || if (child.Cardinality === SedaCardinalityConstants.one ||
child.Cardinality === SedaCardinalityConstants.oreOrMore) { child.Cardinality === SedaCardinalityConstants.oreOrMore) {
let aFileNode : FileNode = {} as FileNode; let aFileNode : FileNode = {} as FileNode;
aFileNode.name = child.Name; aFileNode.name = child.Name;
...@@ -400,13 +393,13 @@ export class FileService { ...@@ -400,13 +393,13 @@ export class FileService {
aFileNode.children = []; aFileNode.children = [];
aFileNode.type = TypeConstants[child.Type as keyof typeof TypeConstants]; aFileNode.type = TypeConstants[child.Type as keyof typeof TypeConstants];
fileNodeComplexChildren.push(aFileNode); fileNodeComplexChildren.push(aFileNode);
} }
}) })
return fileNodeComplexChildren return fileNodeComplexChildren
} }
} }
updateMedataTable(node:FileNode){ updateMedataTable(node:FileNode){
//let isNodeComplex = this.sedaService.checkSedaElementType(node.name,this.sedaService.selectedSedaNodeParent.getValue()) //let isNodeComplex = this.sedaService.checkSedaElementType(node.name,this.sedaService.selectedSedaNodeParent.getValue())
let rulesFromService = this.tabChildrenRulesChange.getValue() let rulesFromService = this.tabChildrenRulesChange.getValue()
...@@ -415,7 +408,7 @@ export class FileService { ...@@ -415,7 +408,7 @@ export class FileService {
this.sedaService.selectedSedaNode.next(node.sedaData); this.sedaService.selectedSedaNode.next(node.sedaData);
let dataTable = this.fileMetadataService.fillDataTable(node.sedaData, node, tabChildrenToInclude, tabChildrenToExclude); let dataTable = this.fileMetadataService.fillDataTable(node.sedaData, node, tabChildrenToInclude, tabChildrenToExclude);
let hasAtLeastOneComplexChild = node.children.some(el=> el.type === TypeConstants.element); let hasAtLeastOneComplexChild = node.children.some(el=> el.type === TypeConstants.element);
if(node.sedaData.Element === SedaElementConstants.complex){ if(node.sedaData.Element === SedaElementConstants.complex){
this.fileMetadataService.shouldLoadMetadataTable.next(hasAtLeastOneComplexChild); this.fileMetadataService.shouldLoadMetadataTable.next(hasAtLeastOneComplexChild);
console.log("The the current tab root node is : ", node) console.log("The the current tab root node is : ", node)
......
...@@ -16,7 +16,11 @@ ...@@ -16,7 +16,11 @@
<mat-sidenav-content > <mat-sidenav-content >
<div class="pastis-entete-bandeau"></div> <div class="pastis-entete-bandeau"></div>
<div> <div>
<pastis-file-tree-metadata style="text-align: center;" *ngIf="!noticeDisplay"></pastis-file-tree-metadata> <pastis-file-tree-metadata style="text-align: center;" *ngIf="!noticeDisplay" (insertItem)="insertionItem($event)"
(addNode)="addNode($event)"
(insertAttributes)="insertAttribute($event)"
(removeNode)="removeNode($event)">
</pastis-file-tree-metadata>
<pastis-notice *ngIf="noticeDisplay"></pastis-notice> <pastis-notice *ngIf="noticeDisplay"></pastis-notice>
......
/* /*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr] [dad@cines.fr]
This software is a computer program whose purpose is to provide This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive a web application to create, edit, import and export archive
profiles based on the french SEDA standard profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/). (https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and 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, 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 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 license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
...@@ -28,19 +28,21 @@ that may mean that it is complicated to manipulate, and that also ...@@ -28,19 +28,21 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had 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. knowledge of the CeCILL-C license and that you accept its terms.
*/ */
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import {CdkTextareaAutosize} from '@angular/cdk/text-field';
import { ActivatedRoute } from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import { ToggleSidenavService } from '../core/services/toggle-sidenav.service'; import {ToggleSidenavService} from '../core/services/toggle-sidenav.service';
import { ToastContainerDirective, ToastrService } from 'ngx-toastr'; import {ToastContainerDirective, ToastrService} from 'ngx-toastr';
import { Subscription } from 'rxjs'; import {Subscription} from 'rxjs';
import {EditProfileComponent} from '../profile/edit-profile/edit-profile.component';
import {FileNode, FileNodeInsertAttributeParams, FileNodeInsertParams} from "../profile/edit-profile/classes/file-node";
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
...@@ -54,6 +56,8 @@ export class MainComponent implements OnInit, OnDestroy { ...@@ -54,6 +56,8 @@ export class MainComponent implements OnInit, OnDestroy {
@ViewChild('autosize', { static: false }) autosize: CdkTextareaAutosize; @ViewChild('autosize', { static: false }) autosize: CdkTextareaAutosize;
@ViewChild(ToastContainerDirective, { static: true }) @ViewChild(ToastContainerDirective, { static: true })
toastContainer: ToastContainerDirective; toastContainer: ToastContainerDirective;
@ViewChild(EditProfileComponent)
editProfileComponent: EditProfileComponent;
opened: boolean; opened: boolean;
events: string[] = []; events: string[] = [];
...@@ -88,6 +92,25 @@ export class MainComponent implements OnInit, OnDestroy { ...@@ -88,6 +92,25 @@ export class MainComponent implements OnInit, OnDestroy {
this.opened = false; this.opened = false;
} }
insertionItem($event: FileNodeInsertParams) {
this.editProfileComponent.fileTreeComponent.insertItem($event.node, $event.elementsToAdd);
console.log("Params : ", $event);
}
addNode($event: FileNode) {
this.editProfileComponent.fileTreeComponent.addNewItem($event);
}
insertAttribute($event: FileNodeInsertAttributeParams) {
console.log("Params in attributes : ", $event);
this.editProfileComponent.fileTreeComponent.insertAttributes($event.node, $event.elementsToAdd);
}
removeNode($event: FileNode) {
this.editProfileComponent.fileTreeComponent.remove($event);
}
ngOnDestroy(): void { ngOnDestroy(): void {
this.noticeDisplaySub.unsubscribe(); this.noticeDisplaySub.unsubscribe();
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<span class="pastis-edit-profile-header-name">Nom du profil d'archivage</span> <span class="pastis-edit-profile-header-name">Nom du profil d'archivage</span>
</div> </div>
<div class="pastis-edit-profile-header-id">Identifiant : 1223435596993056</div> <div class="pastis-edit-profile-header-id">Identifiant : {{profileId}}</div>
</div> </div>
<mat-tab-group <mat-tab-group
[selectedIndex]="activeTabIndex" [selectedIndex]="activeTabIndex"
......
/* /*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr] [dad@cines.fr]
This software is a computer program whose purpose is to provide This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive a web application to create, edit, import and export archive
profiles based on the french SEDA standard profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/). (https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and 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, 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 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 license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
...@@ -28,9 +28,9 @@ that may mean that it is complicated to manipulate, and that also ...@@ -28,9 +28,9 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had 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. knowledge of the CeCILL-C license and that you accept its terms.
...@@ -44,7 +44,7 @@ import { FileNode } from './classes/file-node'; ...@@ -44,7 +44,7 @@ import { FileNode } from './classes/file-node';
import { MatTabChangeEvent } from '@angular/material/tabs'; import { MatTabChangeEvent } from '@angular/material/tabs';
import { MatTreeNestedDataSource } from '@angular/material/tree'; import { MatTreeNestedDataSource } from '@angular/material/tree';
import { NestedTreeControl } from '@angular/cdk/tree'; import { NestedTreeControl } from '@angular/cdk/tree';
import { BehaviorSubject } from 'rxjs'; import { BehaviorSubject} from 'rxjs';
import { FileTreeComponent } from './file-tree/file-tree.component'; import { FileTreeComponent } from './file-tree/file-tree.component';
import { SedaData } from './classes/seda-data'; import { SedaData } from './classes/seda-data';
import { NgxUiLoaderService } from 'ngx-ui-loader'; import { NgxUiLoaderService } from 'ngx-ui-loader';
...@@ -126,6 +126,7 @@ export class EditProfileComponent implements OnInit, OnDestroy { ...@@ -126,6 +126,7 @@ export class EditProfileComponent implements OnInit, OnDestroy {
private sideNavService: ToggleSidenavService, private profileService: ProfileService, private sideNavService: ToggleSidenavService, private profileService: ProfileService,
private loaderService: NgxUiLoaderService) { private loaderService: NgxUiLoaderService) {
let uploadedProfileResponse = this.router.getCurrentNavigation().extras.state; let uploadedProfileResponse = this.router.getCurrentNavigation().extras.state;
// Get profile type if profile is user uploads a file // Get profile type if profile is user uploads a file
...@@ -134,12 +135,14 @@ export class EditProfileComponent implements OnInit, OnDestroy { ...@@ -134,12 +135,14 @@ export class EditProfileComponent implements OnInit, OnDestroy {
this.profileType = this.profile[0].name === "ArchiveTransfer" ? "PA" : "PUA"; this.profileType = this.profile[0].name === "ArchiveTransfer" ? "PA" : "PUA";
this.profileService.setProfileMode(this.profileType); this.profileService.setProfileMode(this.profileType);
this.initActiveTabAndProfileMode(); this.initActiveTabAndProfileMode();
console.log(this.puaMode)
} else { } else {
// Get profile type if profile is selected from the list of profiles // Get profile type if profile is selected from the list of profiles
this.profileService.getAllProfiles().subscribe(profiles => { this.profileService.getAllProfiles().subscribe(profiles => {
this.profileType = profiles.find(p => p.id.toString() === this.profileId.toString()).type; this.profileType = profiles.find(p => p.id.toString() === this.profileId.toString()).type;
this.profileService.setProfileMode(this.profileType); this.profileService.setProfileMode(this.profileType);
this.initActiveTabAndProfileMode(); this.initActiveTabAndProfileMode();
console.warn(this.puaMode)
}) })
} }
...@@ -178,7 +181,7 @@ export class EditProfileComponent implements OnInit, OnDestroy { ...@@ -178,7 +181,7 @@ export class EditProfileComponent implements OnInit, OnDestroy {
[this.objectTabChildrenToInclude, this.objectTabChildrenToExclude]) [this.objectTabChildrenToInclude, this.objectTabChildrenToExclude])
} }
ngOnInit() { ngOnInit() {
this.fileService.reinitialisaDataChange();
this.setTabsAndMetadataRules(this.activeTabIndex); this.setTabsAndMetadataRules(this.activeTabIndex);
//Set initial rules //Set initial rules
this.fileService.setCollectionName(this.collectionName); this.fileService.setCollectionName(this.collectionName);
...@@ -244,7 +247,7 @@ export class EditProfileComponent implements OnInit, OnDestroy { ...@@ -244,7 +247,7 @@ export class EditProfileComponent implements OnInit, OnDestroy {
// If you want to see notice don't need to load profile // If you want to see notice don't need to load profile
if(this.puaMode && event.index == 0){ if(this.puaMode && event.index == 0){
this.noticeSelected = true; this.noticeSelected = true;
this.sideNavService.statusNotice(this.noticeSelected); this.sideNavService.statusNotice(this.noticeSelected);
}else{ }else{
this.setTabsAndMetadataRules(event.index); this.setTabsAndMetadataRules(event.index);
this.loadProfileData(); this.loadProfileData();
......
/* /*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr] [dad@cines.fr]
This software is a computer program whose purpose is to provide This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive a web application to create, edit, import and export archive
profiles based on the french SEDA standard profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/). (https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and 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, 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 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 license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
...@@ -28,15 +28,15 @@ that may mean that it is complicated to manipulate, and that also ...@@ -28,15 +28,15 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had 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. knowledge of the CeCILL-C license and that you accept its terms.
*/ */
import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { Component, ViewChild, ViewEncapsulation } from '@angular/core'; import { Component, EventEmitter, Output, ViewChild, ViewEncapsulation} from '@angular/core';
import { FormBuilder, FormControl, Validators } from '@angular/forms'; import { FormBuilder, FormControl, Validators } from '@angular/forms';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { FileService } from '../../../core/services/file.service'; import { FileService } from '../../../core/services/file.service';
...@@ -51,6 +51,7 @@ import { AttributeData } from './attributes/models/edit-attribute-models'; ...@@ -51,6 +51,7 @@ import { AttributeData } from './attributes/models/edit-attribute-models';
import { NotificationService } from 'projects/pastis/src/app/core/services/notification.service'; import { NotificationService } from 'projects/pastis/src/app/core/services/notification.service';
import { NgxUiLoaderService } from 'ngx-ui-loader'; import { NgxUiLoaderService } from 'ngx-ui-loader';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import {Subscription} from "rxjs";
...@@ -102,6 +103,20 @@ export class FileTreeMetadataComponent { ...@@ -102,6 +103,20 @@ export class FileTreeMetadataComponent {
config: {}; config: {};
@Output()
public insertItem: EventEmitter<FileNodeInsertParams> = new EventEmitter<FileNodeInsertParams>();
@Output()
public addNode: EventEmitter<FileNode> = new EventEmitter<FileNode>();
@Output()
public insertAttributes: EventEmitter<FileNodeInsertAttributeParams> = new EventEmitter<FileNodeInsertAttributeParams>();
@Output()
public removeNode: EventEmitter<FileNode> = new EventEmitter<FileNode>();
private _fileServiceSubscription : Subscription;
metadatadaValueFormControl = new FormControl('', [Validators.required, Validators.pattern(this.regexPattern)]); metadatadaValueFormControl = new FormControl('', [Validators.required, Validators.pattern(this.regexPattern)]);
valueForm = this.fb.group({ valueForm = this.fb.group({
...@@ -122,7 +137,7 @@ export class FileTreeMetadataComponent { ...@@ -122,7 +137,7 @@ export class FileTreeMetadataComponent {
ngOnInit() { ngOnInit() {
//Subscription to fileNode service //Subscription to fileNode service
this.ngxLoader.startLoader('table-metadata'); this.ngxLoader.startLoader('table-metadata');
this.fileService.getCurrentFileTree().subscribe(fileTree => { this._fileServiceSubscription=this.fileService.getCurrentFileTree().subscribe(fileTree => {
if (fileTree) { if (fileTree) {
this.clickedNode = fileTree[0]; this.clickedNode = fileTree[0];
this.fileService.allData.next(fileTree); this.fileService.allData.next(fileTree);
...@@ -259,11 +274,11 @@ export class FileTreeMetadataComponent { ...@@ -259,11 +274,11 @@ export class FileTreeMetadataComponent {
node: this.clickedNode, node: this.clickedNode,
elementsToAdd: ['ArchiveUnit'] elementsToAdd: ['ArchiveUnit']
} }
this.fileService.insertItem.emit(params); this.insertItem.emit(params);
this.notificationService.showSuccess('La métadonnée ArchiveUnit a été ajoutée'); this.notificationService.showSuccess('La métadonnée ArchiveUnit a été ajoutée');
} else { } else {
this.fileService.addNode.emit(this.clickedNode) this.addNode.emit(this.clickedNode)
} }
} }
...@@ -304,7 +319,7 @@ export class FileTreeMetadataComponent { ...@@ -304,7 +319,7 @@ export class FileTreeMetadataComponent {
let fileNode: FileNode = {} as FileNode; let fileNode: FileNode = {} as FileNode;
fileNode.name = attr.nomDuChamp; fileNode.name = attr.nomDuChamp;
attributeFileNodeListToRemove.push(fileNode); attributeFileNodeListToRemove.push(fileNode);
}) });
if (attributeFileNodeListToAdd) { if (attributeFileNodeListToAdd) {
let insertOrEditParams: FileNodeInsertAttributeParams = { node: popData.fileNode, elementsToAdd: attributeFileNodeListToAdd } let insertOrEditParams: FileNodeInsertAttributeParams = { node: popData.fileNode, elementsToAdd: attributeFileNodeListToAdd }
let attrsToAdd = attributeFileNodeListToAdd.map(e => e.name); let attrsToAdd = attributeFileNodeListToAdd.map(e => e.name);
...@@ -312,7 +327,7 @@ export class FileTreeMetadataComponent { ...@@ -312,7 +327,7 @@ export class FileTreeMetadataComponent {
//Add attribute (if it does not exist), or update them if they do //Add attribute (if it does not exist), or update them if they do
if (attrsToAdd && !attributeExists) { if (attrsToAdd && !attributeExists) {
this.fileService.insertAttributes.emit(insertOrEditParams); this.insertAttributes.emit(insertOrEditParams);
} else { } else {
this.fileService.updateNodeChildren(popData.fileNode, attributeFileNodeListToAdd) this.fileService.updateNodeChildren(popData.fileNode, attributeFileNodeListToAdd)
} }
...@@ -326,7 +341,7 @@ export class FileTreeMetadataComponent { ...@@ -326,7 +341,7 @@ export class FileTreeMetadataComponent {
onDeleteNode(nodeId: number) { onDeleteNode(nodeId: number) {
const nodeToDelete = this.fileService.getFileNodeById(this.fileService.nodeChange.getValue(), nodeId); const nodeToDelete = this.fileService.getFileNodeById(this.fileService.nodeChange.getValue(), nodeId);
this.fileService.removeNode.emit(nodeToDelete) this.removeNode.emit(nodeToDelete)
} }
onButtonClicked(elementId: number) { onButtonClicked(elementId: number) {
...@@ -369,7 +384,7 @@ export class FileTreeMetadataComponent { ...@@ -369,7 +384,7 @@ export class FileTreeMetadataComponent {
} }
/** /**
* Returns a boolean if a given node has one or more attributes * Returns a boolean if a given node has one or more attributes
* regarding its seda specification * regarding its seda specification
* @param nodeName The node's name to be tested * @param nodeName The node's name to be tested
*/ */
...@@ -417,4 +432,10 @@ export class FileTreeMetadataComponent { ...@@ -417,4 +432,10 @@ export class FileTreeMetadataComponent {
this.router.navigate(['/'],{skipLocationChange: false}); this.router.navigate(['/'],{skipLocationChange: false});
} }
ngOnDestroy(){
if(this._fileServiceSubscription!= null){
this._fileServiceSubscription.unsubscribe();
}
}
} }
/* /*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr] [dad@cines.fr]
This software is a computer program whose purpose is to provide This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive a web application to create, edit, import and export archive
profiles based on the french SEDA standard profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/) (https://redirect.francearchives.fr/seda/)
This software is governed by the CeCILL-C license under French law and 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, 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 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 license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
...@@ -28,27 +28,27 @@ that may mean that it is complicated to manipulate, and that also ...@@ -28,27 +28,27 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had 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. knowledge of the CeCILL-C license and that you accept its terms.
*/ */
import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import {CdkTextareaAutosize} from '@angular/cdk/text-field';
import { NestedTreeControl } from '@angular/cdk/tree'; import {NestedTreeControl} from '@angular/cdk/tree';
import { Component, Input, ViewChild, } from '@angular/core'; import {Component, Input, ViewChild,} from '@angular/core';
import { MatTreeNestedDataSource } from '@angular/material/tree'; import {MatTreeNestedDataSource} from '@angular/material/tree';
import { BehaviorSubject, throwError } from 'rxjs'; import {BehaviorSubject, throwError} from 'rxjs';
import { SedaData, SedaElementConstants, SedaCardinalityConstants } from '../classes/seda-data'; import {SedaCardinalityConstants, SedaData, SedaElementConstants} from '../classes/seda-data';
import { SedaService } from '../../../core/services/seda.service'; import {SedaService} from '../../../core/services/seda.service';
import { NotificationService } from '../../../core/services/notification.service'; import {NotificationService} from '../../../core/services/notification.service';
import { FileService } from '../../../core/services/file.service'; import {FileService} from '../../../core/services/file.service';
import { CardinalityConstants, FileNode, TypeConstants, DataTypeConstants, FileNodeInsertParams, FileNodeInsertAttributeParams } from '../classes/file-node'; import {CardinalityConstants, DataTypeConstants, FileNode, TypeConstants} from '../classes/file-node';
import { FileTreeMetadataService } from '../file-tree-metadata/file-tree-metadata.service'; import {FileTreeMetadataService} from '../file-tree-metadata/file-tree-metadata.service';
import { UserActionAddMetadataComponent } from '../../../user-actions/add-metadata/add-metadata.component'; import {UserActionAddMetadataComponent} from '../../../user-actions/add-metadata/add-metadata.component';
import { PastisDialogData } from '../../../shared/pastis-dialog/classes/pastis-dialog-data'; import {PastisDialogData} from '../../../shared/pastis-dialog/classes/pastis-dialog-data';
import { UserActionRemoveMetadataComponent } from '../../../user-actions/remove-metadata/remove-metadata.component'; import {UserActionRemoveMetadataComponent} from '../../../user-actions/remove-metadata/remove-metadata.component';
@Component({ @Component({
selector: 'pastis-file-tree', selector: 'pastis-file-tree',
...@@ -109,20 +109,6 @@ export class FileTreeComponent { ...@@ -109,20 +109,6 @@ export class FileTreeComponent {
this.sedaService.selectedSedaNodeParent.next(this.sedaData); this.sedaService.selectedSedaNodeParent.next(this.sedaData);
console.log("Init seda node on file tree : %o", this.sedaService.selectedSedaNode.getValue(), " on tab : ", this.rootElementName); console.log("Init seda node on file tree : %o", this.sedaService.selectedSedaNode.getValue(), " on tab : ", this.rootElementName);
}) })
this.fileService.addNode.subscribe((node: FileNode) => {
this.addNewItem(node)
})
this.fileService.insertItem.subscribe((params: FileNodeInsertParams) => {
console.log("Params : ", params)
this.insertItem(params.node, params.elementsToAdd)
})
this.fileService.insertAttributes.subscribe((params: FileNodeInsertAttributeParams) => {
console.log("Params in attributes : ", params)
this.insertAttributes(params.node, params.elementsToAdd)
})
this.fileService.removeNode.subscribe((node: FileNode) => {
this.remove(node)
})
this.fileService.tabChildrenRulesChange.subscribe(rules => { this.fileService.tabChildrenRulesChange.subscribe(rules => {
this.rulesChange = rules; this.rulesChange = rules;
}) })
...@@ -226,7 +212,7 @@ export class FileTreeComponent { ...@@ -226,7 +212,7 @@ export class FileTreeComponent {
sedaChild.Children.filter((c: { Element: any; }) => c.Element === SedaElementConstants.attribute).forEach((child: { Name: string; Element: any; Cardinality: any; }) => { sedaChild.Children.filter((c: { Element: any; }) => c.Element === SedaElementConstants.attribute).forEach((child: { Name: string; Element: any; Cardinality: any; }) => {
let isAttributeAlreadyIncluded = newNode.children.some(nodeChild => nodeChild.name.includes(child.Name)); let isAttributeAlreadyIncluded = newNode.children.some(nodeChild => nodeChild.name.includes(child.Name));
// If the added node contains an obligatory attribute, // If the added node contains an obligatory attribute,
// on its seda definition and the attribute is not already part of the node, // on its seda definition and the attribute is not already part of the node,
// we then, build an attribute node based on the seda atribute defintion // we then, build an attribute node based on the seda atribute defintion
if (child.Element === SedaElementConstants.attribute && if (child.Element === SedaElementConstants.attribute &&
child.Cardinality === SedaCardinalityConstants.one && child.Cardinality === SedaCardinalityConstants.one &&
...@@ -254,7 +240,7 @@ export class FileTreeComponent { ...@@ -254,7 +240,7 @@ export class FileTreeComponent {
this.sendNodeMetadata(parent); this.sendNodeMetadata(parent);
console.log("New fileNode data is : %o", this.nestedDataSource.data) console.log("New fileNode data is : %o", this.nestedDataSource.data)
// 6. No more nodes to add // 6. No more nodes to add
} else { } else {
console.log('No More Nodes can be inserted : No node was selected or node name is invalid'); console.log('No More Nodes can be inserted : No node was selected or node name is invalid');
} }
...@@ -323,7 +309,7 @@ export class FileTreeComponent { ...@@ -323,7 +309,7 @@ export class FileTreeComponent {
// Refresh Tree by opening an given node (option) // Refresh Tree by opening an given node (option)
// If the a node name is not prodived, the function will open the root tab element // If the a node name is not prodived, the function will open the root tab element
renderChanges(node: FileNode, nodeIdToExpand?: number) { renderChanges(node: FileNode, nodeIdToExpand?: number) {
let data: FileNode; let data: FileNode;
if (nodeIdToExpand) { if (nodeIdToExpand) {
...@@ -388,7 +374,7 @@ export class FileTreeComponent { ...@@ -388,7 +374,7 @@ export class FileTreeComponent {
let nodeLevel = (FileTreeComponent.archiveUnits.children.indexOf(node) + 1); let nodeLevel = (FileTreeComponent.archiveUnits.children.indexOf(node) + 1);
let parent = this.fileService.getFileNodeById(FileTreeComponent.archiveUnits,node.parentId) let parent = this.fileService.getFileNodeById(FileTreeComponent.archiveUnits,node.parentId)
let parentLevel = parent.level - 2 let parentLevel = parent.level - 2
let archiveUnilNumber = nodeLevel > 0 ? nodeLevel : parentLevel let archiveUnilNumber = nodeLevel > 0 ? nodeLevel : parentLevel
let archiveUnitDecimal = parentLevel === 0 ? "" : "." +parentLevel; let archiveUnitDecimal = parentLevel === 0 ? "" : "." +parentLevel;
return 'UA ' + archiveUnilNumber + archiveUnitDecimal ; return 'UA ' + archiveUnilNumber + archiveUnitDecimal ;
...@@ -494,16 +480,16 @@ export class FileTreeComponent { ...@@ -494,16 +480,16 @@ export class FileTreeComponent {
} }
// Checks if a node belongs to the clicked tab collection. // Checks if a node belongs to the clicked tab collection.
// For a given node, searches the required node in the seda.json file and // For a given node, searches the required node in the seda.json file and
// returns true if the node's value of "Collection" is equal to the clicked tab // returns true if the node's value of "Collection" is equal to the clicked tab
isPartOfCollection(node: FileNode): boolean { isPartOfCollection(node: FileNode): boolean {
return this.collectionName === node.sedaData.Collection.valueOf(); return this.collectionName === node.sedaData.Collection.valueOf();
} }
shouldBeOnTab(node: FileNode): boolean { shouldBeOnTab(node: FileNode): boolean {
let rootNodeName = this.fileService.rootTabMetadataName.getValue(); let rootNodeName = this.fileService.rootTabMetadataName.getValue();
let filteredNode = Object.assign({} as FileNode, this.nestedDataSource.data[0]); let filteredNode = Object.assign({} as FileNode, this.nestedDataSource.data[0]);
let includedDataObjectPackageChildren = ['DataObjectGroup', 'BinaryDataObject', 'PhysicalDataObject'] let includedDataObjectPackageChildren = ['DataObjectGroup', 'BinaryDataObject', 'PhysicalDataObject']
if (rootNodeName === 'DataObjectPackage' && !includedDataObjectPackageChildren.includes(node.name)) { if (rootNodeName === 'DataObjectPackage' && !includedDataObjectPackageChildren.includes(node.name)) {
filteredNode.children = filteredNode.children.filter(child => child.name !== 'DescriptiveMetadata' && filteredNode.children = filteredNode.children.filter(child => child.name !== 'DescriptiveMetadata' &&
......
/* /*
Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020)
[dad@cines.fr] [dad@cines.fr]
This software is a computer program whose purpose is to provide This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive a web application to create, edit, import and export archive
profiles based on the french SEDA standard profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/). (https://redirect.francearchives.fr/seda/).
This software is governed by the CeCILL-C license under French law and 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, 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 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 license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info". "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, 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 modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited economic rights, and the successive licensors have only limited
liability. liability.
In this respect, the user's attention is drawn to the risks associated In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the with loading, using, modifying and/or developing or reproducing the
...@@ -28,19 +28,19 @@ that may mean that it is complicated to manipulate, and that also ...@@ -28,19 +28,19 @@ that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or 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 data to be ensured and, more generally, to use and operate it in the
same conditions as regards security. same conditions as regards security.
The fact that you are presently reading this means that you have had 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. knowledge of the CeCILL-C license and that you accept its terms.
*/ */
import { Component, OnInit, Inject, } from '@angular/core'; import {Component, Inject, OnInit,} from '@angular/core';
import { PastisDialogData } from '../classes/pastis-dialog-data'; import {PastisDialogData} from '../classes/pastis-dialog-data';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import { SedaService } from '../../../core/services/seda.service'; import {SedaService} from '../../../core/services/seda.service';
import { ComponentPortal } from '@angular/cdk/portal'; import {ComponentPortal} from '@angular/cdk/portal';
import { PopupService } from 'projects/pastis/src/app/core/services/popup.service'; import {PopupService} from 'projects/pastis/src/app/core/services/popup.service';
@Component({ @Component({
selector: 'pastis-pastis-dialog-confirm', selector: 'pastis-pastis-dialog-confirm',
...@@ -68,8 +68,8 @@ export class PastisDialogConfirmComponent implements OnInit { ...@@ -68,8 +68,8 @@ export class PastisDialogConfirmComponent implements OnInit {
this.portal = new ComponentPortal(this.dialogReceivedData.component); this.portal = new ComponentPortal(this.dialogReceivedData.component);
this.popUpService.setPopUpDataOnOpen(this.dialogReceivedData); this.popUpService.setPopUpDataOnOpen(this.dialogReceivedData);
} }
if (!this.dialogReceivedData.okLabel) this.dialogReceivedData.okLabel = 'Oui' if (!this.dialogReceivedData.okLabel) this.dialogReceivedData.okLabel = 'Oui'
if (!this.dialogReceivedData.cancelLabel) this.dialogReceivedData.cancelLabel = 'Non' if (!this.dialogReceivedData.cancelLabel) this.dialogReceivedData.cancelLabel = 'Non'
this.popUpService.popUpDataBeforeClose.subscribe(data=>{ this.popUpService.popUpDataBeforeClose.subscribe(data=>{
this.dataBeforeClose = data; this.dataBeforeClose = data;
...@@ -99,7 +99,7 @@ export class PastisDialogConfirmComponent implements OnInit { ...@@ -99,7 +99,7 @@ export class PastisDialogConfirmComponent implements OnInit {
ngOnDestroy() { ngOnDestroy() {
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<artifactId>ui-pastis</artifactId> <artifactId>ui-pastis</artifactId>
<name>PASTIS-API</name> <name>UI Pastis</name>
<parent> <parent>
<groupId>fr.gouv.vitamui</groupId> <groupId>fr.gouv.vitamui</groupId>
...@@ -55,24 +55,29 @@ ...@@ -55,24 +55,29 @@
<version>1.4.5</version> <version>1.4.5</version>
</dependency> </dependency>
<!-- Documentation -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.2</version>
</dependency>
<!-- Start of SpringBoot starter web (Tomcat by default) and starter test--> <!-- Start of SpringBoot starter web (Tomcat by default) and starter test-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>2.2.6.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.2.6.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
<version>2.2.6.RELEASE</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>com.vaadin.external.google</groupId> <groupId>com.vaadin.external.google</groupId>
...@@ -201,8 +206,6 @@ ...@@ -201,8 +206,6 @@
</testResource> </testResource>
</testResources> </testResources>
<finalName>PastisApi</finalName>
</build> </build>
</profile> </profile>
...@@ -236,11 +239,10 @@ ...@@ -236,11 +239,10 @@
<executable>true</executable> <executable>true</executable>
<attach>false</attach> <!-- Need to use the original jar for integration-tests --> <attach>false</attach> <!-- Need to use the original jar for integration-tests -->
<mainClass>fr.gouv.vitamui.pastis.PastisRestApplication</mainClass> <mainClass>fr.gouv.vitamui.pastis.PastisRestApplication</mainClass>
<jvmArguments>-Xmx512m</jvmArguments> <jvmArguments>-Xmx128m</jvmArguments>
<jvmArguments>-Xms512m</jvmArguments>
<arguments> <arguments>
<!-- use src/main/config/application-dev.yml when using mvn spring-boot:run --> <argument>--spring.config.additional-location=file:src/main/config/ui-pastis-application-dev.yml</argument>
<!-- See : https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files -->
<argument>--spring.config.additional-location=file:${basedir}/src/main/config/application.yml</argument>
</arguments> </arguments>
</configuration> </configuration>
</plugin> </plugin>
...@@ -264,13 +266,6 @@ ...@@ -264,13 +266,6 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<!-- Tests -->
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
</testResources>
</build> </build>
</profile> </profile>
<!-- End of Dev profile --> <!-- End of Dev profile -->
......
server: server:
host: dev.vitamui.com host: dev.vitamui.com
port: 9051 port: 8051
scheme: https scheme: https
ssl: ssl:
key-store: src/main/config/ui-pastis.jks key-store: src/main/config/ui-pastis.jks
......
...@@ -4,8 +4,6 @@ spring.servlet.multipart.max-request-size=11MB ...@@ -4,8 +4,6 @@ spring.servlet.multipart.max-request-size=11MB
spring.servlet.multipart.enabled=true spring.servlet.multipart.enabled=true
server.port=8051
#Spring docs swagger #Spring docs swagger
springdoc.api-docs.path=/api-docs springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/open-api.html springdoc.swagger-ui.path=/open-api.html
...@@ -16,8 +14,8 @@ rng.base.file=rng/Profil_seda_pastis_mvp.rng ...@@ -16,8 +14,8 @@ rng.base.file=rng/Profil_seda_pastis_mvp.rng
json.base.file=rng/ProfileJson.json json.base.file=rng/ProfileJson.json
pua.definitions.file=pua_validation/ProfileJson.json pua.definitions.file=pua_validation/ProfileJson.json
war.dev.filename=rest-pastis #PORT
war.prod.filename=rest server.port=8051
#CORS #CORS
cors.allowed-origins = https://dev.vitamui.com:4251, https://localhost, http://localhost cors.allowed-origins = https://dev.vitamui.com:4251, https://localhost
<?xml version='1.0' encoding='utf-8' standalone='no'?>
<rng:grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:seda="fr:gouv:culture:archivesdefrance:seda:v2.1" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.1"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="fr:gouv:culture:archivesdefrance:seda:v2.1" seda:warnings="">
<rng:start>
<rng:element name="ArchiveTransfer">
<rng:optional>
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:element name="Date">
<rng:data type="dateTime"/>
</rng:element>
<rng:element name="MessageIdentifier">
<rng:data type="token"/>
</rng:element>
<rng:element name="CodeListVersions">
<rng:data type="token"/>
</rng:element>
<rng:element name="DataObjectPackage">
<rng:optional>
<rng:attribute name="xml:id">
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:element name="DataObjectGroup">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:zeroOrMore>
<rng:element name="BinaryDataObject">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:optional>
<rng:element name="DataObjectVersion">
<rng:data type="token"/>
<xsd:annotation>
<xsd:documentation>BinaryMaster par défaut</xsd:documentation>
</xsd:annotation>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Uri">
<rng:data type="anyURI"/>
</rng:element>
</rng:optional>
<rng:element name="MessageDigest">
<rng:data type="base64Binary"/>
<rng:attribute name="algorithm">
<rng:data type="token"/>
</rng:attribute>
</rng:element>
</rng:element>
</rng:zeroOrMore>
</rng:element>
<rng:element name="DescriptiveMetadata">
<rng:zeroOrMore>
<rng:element name="ArchiveUnit">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:element name="Content">
<rng:optional>
<rng:element name="DescriptionLevel">
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Title">
<rng:data type="string"/>
</rng:element>
</rng:optional>
</rng:element>
</rng:element>
</rng:zeroOrMore>
</rng:element>
<rng:element name="ManagementMetadata">
<rng:optional>
<rng:element name="OriginatingAgencyIdentifier">
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="SubmissionAgencyIdentifier">
<rng:data type="token"/>
</rng:element>
</rng:optional>
</rng:element>
</rng:element>
<rng:element name="ArchivalAgency">
<rng:element name="Identifier">
<rng:data type="token"/>
</rng:element>
</rng:element>
<rng:element name="TransferringAgency">
<rng:element name="Identifier">
<rng:data type="token"/>
</rng:element>
</rng:element>
</rng:element>
</rng:start>
</rng:grammar>
<?xml version='1.0' encoding='utf-8' standalone='no'?>
<rng:grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns:rng="http://relaxng.org/ns/structure/1.0"
xmlns:seda="fr:gouv:culture:archivesdefrance:seda:v2.1" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.1"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="fr:gouv:culture:archivesdefrance:seda:v2.1" seda:warnings="">
<rng:start>
<rng:element name="ArchiveTransfer">
<rng:optional>
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:element name="Date">
<rng:data type="dateTime"/>
</rng:element>
<rng:element name="MessageIdentifier">
<rng:data type="token"/>
</rng:element>
<rng:element name="CodeListVersions">
<rng:data type="token"/>
</rng:element>
<rng:element name="DataObjectPackage">
<rng:optional>
<rng:attribute name="xml:id">
<rng:data type="ID"/>
</rng:attribute>
</rng:optional>
<rng:element name="DataObjectGroup">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:zeroOrMore>
<rng:element name="BinaryDataObject">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:optional>
<rng:element name="DataObjectVersion">
<rng:data type="token"/>
<xsd:annotation>
<xsd:documentation>BinaryMaster par défaut</xsd:documentation>
</xsd:annotation>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Uri">
<rng:data type="anyURI"/>
</rng:element>
</rng:optional>
<rng:element name="MessageDigest">
<rng:data type="base64Binary"/>
<rng:attribute name="algorithm">
<rng:data type="token"/>
</rng:attribute>
</rng:element>
</rng:element>
</rng:zeroOrMore>
</rng:element>
<rng:element name="DescriptiveMetadata">
<rng:zeroOrMore>
<rng:element name="ArchiveUnit">
<rng:attribute name="id">
<rng:data type="ID"/>
</rng:attribute>
<rng:element name="Content">
<rng:optional>
<rng:element name="DescriptionLevel">
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="Title">
<rng:data type="string"/>
</rng:element>
</rng:optional>
</rng:element>
</rng:element>
</rng:zeroOrMore>
</rng:element>
<rng:element name="ManagementMetadata">
<rng:optional>
<rng:element name="OriginatingAgencyIdentifier">
<rng:data type="token"/>
</rng:element>
</rng:optional>
<rng:optional>
<rng:element name="SubmissionAgencyIdentifier">
<rng:data type="token"/>
</rng:element>
</rng:optional>
</rng:element>
</rng:element>
<rng:element name="ArchivalAgency">
<rng:element name="Identifier">
<rng:data type="token"/>
</rng:element>
</rng:element>
<rng:element name="TransferringAgency">
<rng:element name="Identifier">
<rng:data type="token"/>
</rng:element>
</rng:element>
</rng:element>
</rng:start>
</rng:grammar>
source diff could not be displayed: it is too large. Options to address this: view the blob.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment