Commit 751e8a9c authored by cazenave's avatar cazenave
Browse files

pastis front intégré back https

parent 17b3974c
......@@ -128,7 +128,7 @@ db.applications.insert({
db.applications.insert({
"identifier" : "PASTIS_APP",
"url" : "https://{{ vitamui_services.ui_pastis.server_name }}",
"url" : "{{ vitamui.pastis.base_url }}",
"icon" : "vitamui-icon vitamui-icon-ontologie",
"name" : "PASTIS",
"category" : "referential",
......@@ -142,9 +142,8 @@ db.applications.insert({
db.applications.insert({
"_id" : ObjectId("5f02f30ed792810b68782526"),
"identifier" : "SEDA_APP",
"url" : "https://{{ vitamui_services.ui_pastis.server_name }}/sedaview",
"url" : "{{ vitamui.pastis.base_url }}/sedaview",
"icon" : "vitamui-icon vitamui-icon-ontologie",
"name" : "SEDA View poste de DEV",
"category" : "referential",
......
......@@ -433,6 +433,36 @@ db.sequences.updateOne({
}
});
// ----------------------------------------- PASTIS -----------------------------------------
db.profiles.insert({
"_id" : "pastis_profil",
"identifier" : NumberInt(maxIdProfile++),
"name" : "pastis Profile",
"description" : "pastis Profile",
"tenantIdentifier": NumberInt({{ vitamui_platform_informations.proof_tenant }}),
"applicationName" : "PASTIS_APP",
"enabled" : true,
"readonly" : true,
"level" : "",
"customerId" : "system_customer",
"roles" : [
{
"name": "ROLE_GET_PA"
},
{
"name": "ROLE_CREATE_PA"
},
{
"name": "ROLE_DELETE_PA"
}
]
});
// ========================================= GROUPS =========================================
// ----------------------------------------- LEVEL "0" -----------------------------------------
......@@ -446,6 +476,7 @@ db.groups.updateOne( {
"auto_access_contract",
"system_ingest_contract",
"auto_ingest_contract",
"pastis_profil",
"system_agencies",
"auto_agencies",
"system_context",
......
......@@ -90,3 +90,6 @@ vitamui:
base_url: "https://dev.vitamui.com:4200"
referential:
base_url: "https://dev.vitamui.com:4202"
pastis:
base_url: "https://dev.vitamui.com:4251"
......@@ -518,6 +518,7 @@
"main": "projects/pastis/src/main.ts",
"polyfills": "projects/pastis/src/polyfills.ts",
"tsConfig": "projects/pastis/tsconfig.app.json",
"preserveSymlinks": true,
"aot": false,
"assets": [
"projects/pastis/src/favicon.ico",
......
......@@ -15,7 +15,7 @@
"start:portal": "ng serve portal --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt",
"start:identity": "ng serve identity --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt",
"start:referential": "ng serve referential --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key $npm_package_pki_path/$npm_package_pki_asset.key --ssl-cert $npm_package_pki_path/$npm_package_pki_asset.crt",
"start:pastis": "ng serve pastis --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key dev-ssl/server.key --ssl-cert dev-ssl/server.crt",
"start:pastis": "ng serve pastis --proxy-config proxy.conf.json --disable-host-check --ssl --ssl-key dev-ssl/server.key --ssl-cert dev-ssl/server.crt",
"build": "ng build --prod --i18n-locale fr --build-optimizer=false --optimization=false",
"postinstall": "npm run build:vitamui-library",
"build:prod": "export NODE_OPTIONS=--max_old_space_size=4096; ng build --prod --i18n-locale fr --output-path ../../../target/www",
......@@ -71,6 +71,7 @@
"@angular/platform-browser-dynamic": "8.2.14",
"@angular/router": "8.2.14",
"@types/uuid": "^7.0.0",
"@types/d3": "^3.5.43",
"bootstrap": "^4.5.0",
"bufferutil": "^4.0.1",
"classlist.js": "^1.1.20150312",
......@@ -104,7 +105,6 @@
"serialize-javascript": "^5.0.1",
"remove": "^0.1.5",
"@babel/compat-data": "^7.8.0",
"@types/d3": "^3.5.43",
"autoprefixer": "^9.7.5"
},
"devDependencies": {
......
{
"/pastis-rest-api/rest/packages/*": {
"target": "http://localhost:8051",
"target": "https://dev.vitamui.com:8051",
"secure": false,
"logLevel": "debug"
}
......
......@@ -35,26 +35,45 @@ 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 { AccountComponent, ActiveTenantGuard, AppGuard, AuthGuard } from 'ui-frontend-common';
import { NgModule, isDevMode } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SedaVisualizerComponent } from './seda-visualizer/seda-visualizer.component';
import { HomeComponent } from './home/home.component';
import { ListProfileComponent } from './profile/list-profile/list-profile.component';
import { PastisUnderConstructionComponent } from './shared/pastis-under-construction/pastis-under-construction.component';
import { ProfileVisualizerComponent } from './profile-visualizer/profile-visualizer.component';
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{path: 'sedaview', component: SedaVisualizerComponent},
{path: 'profileview', component: ProfileVisualizerComponent},
{path: '', component: HomeComponent},
{path: '**', component: PastisUnderConstructionComponent}
{
path: '',
component: HomeComponent
},
{
path: 'sedaview',
component: SedaVisualizerComponent,
canActivate: [AuthGuard, AppGuard],
data: { appId: 'SEDAVIEW_APP' }
},
{
path: 'profileview',
component: ProfileVisualizerComponent,
canActivate: [AuthGuard, AppGuard],
data: { appId: 'CUSTOMERS_APP' }
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
exports: [RouterModule],
providers: [
ActiveTenantGuard,
AuthGuard
]
})
export class AppRoutingModule {
}
export class AppRoutingModule { }
export const routingComponents = [SedaVisualizerComponent,HomeComponent,ProfileVisualizerComponent];
export const routingComponents = [HomeComponent, SedaVisualizerComponent,ProfileVisualizerComponent];
<router-outlet></router-outlet>
\ No newline at end of file
<router-outlet></router-outlet>
<vitamui-common-subrogation-banner></vitamui-common-subrogation-banner>
/*
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]
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/).
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
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,
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.
liability.
In this respect, the user's attention is drawn to the risks associated
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
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.
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.
......
/*
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]
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/).
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
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,
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.
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
......@@ -28,20 +28,22 @@ 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.
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.
*/
// Angular modules
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, APP_INITIALIZER } from '@angular/core';
import { LOCALE_ID, NgModule, APP_INITIALIZER } from '@angular/core';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import {VitamUICommonModule, WINDOW_LOCATION, BASE_URL, ENVIRONMENT} from 'ui-frontend-common';
import {BrowserModule, Title} from '@angular/platform-browser';
//Pastis modules
......@@ -50,9 +52,11 @@ import { FileTreeModule } from './file-tree/file-tree.module';
import { UserActionsModule } from './user-actions/user-actions.module';
import { SharedModule } from './shared/shared.module';
import { ProfileModule} from './profile/profile.module'
import { LoggerModule } from 'ui-frontend-common';
//Material modules
import { MatProgressSpinnerModule,
import { MatProgressSpinnerModule,
MatGridListModule,
MatSidenavModule,
MatTabsModule,
......@@ -71,8 +75,9 @@ import { UserActionAddMetadataComponent } from './user-actions/user-action-add-m
import { UserActionRemoveMetadataComponent } from './user-actions/user-action-remove-metadata/user-action-remove-metadata.component';
import { PortalModule } from '@angular/cdk/portal';
import { ToastContainerModule, ToastrModule } from 'ngx-toastr';
import { PastisConfiguration } from '../app/core/classes/pastis-configuration';
import { PastisConfiguration } from 'projects/pastis/src/app/core/classes/pastis-configuration';
import { PastisMaterialModule } from './material.module';
import {environment} from 'projects/pastis/src/environments/environment';
......@@ -99,6 +104,8 @@ import { PastisMaterialModule } from './material.module';
AppRoutingModule,
ProfileModule,
ToastContainerModule,
VitamUICommonModule,
LoggerModule.forRoot(),
ToastrModule.forRoot({
positionClass: 'toast-bottom-full-width',
preventDuplicates: false,
......@@ -116,19 +123,26 @@ import { PastisMaterialModule } from './material.module';
UserActionsModule,
CoreModule,
FileTreeModule,
SharedModule
SharedModule,
VitamUICommonModule
],
providers: [
Title,
{ provide: BASE_URL, useValue: '/portal-api' },
{ provide: ENVIRONMENT, useValue: environment },
{ provide: LOCALE_ID, useValue: 'fr'},
{ provide: WINDOW_LOCATION, useValue: window.location},
PastisConfiguration,
{
provide: APP_INITIALIZER,
useFactory: PastisConfigurationFactory,
{
provide: APP_INITIALIZER,
useFactory: PastisConfigurationFactory,
deps: [PastisConfiguration, HttpClient], multi: true },
],
bootstrap: [AppComponent],
})
export class AppModule { }
export function PastisConfigurationFactory(appConfig: PastisConfiguration) {
......
......@@ -16,11 +16,11 @@ export class PastisConfiguration {
getFileUrl: string;
updateFileUrl: string;
apiFullPath: string;
constructor(private pastisApi: PastisApiService,private http:HttpClient){};
public ensureInit(): Promise<any> {
return new Promise((r, e) => {
return new Promise((r, e) => {
this.pastisApi.get("./assets/config/config.json").subscribe((content: PastisConfiguration) => {Object.assign(this, content);r(this);}, reason => e(reason));
});
};
......
/*
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]
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/).
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
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,
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.
liability.
In this respect, the user's attention is drawn to the risks associated
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
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.
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.
......@@ -38,6 +38,7 @@ knowledge of the CeCILL-C license and that you accept its terms.
import { NgModule,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PastisApiService } from './services/api.pastis.service';
import { Logger } from 'ui-frontend-common';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { PastisSpinnerInterceptor } from '../shared/pastis-spinner/pastis-spinner-interceptor';
......@@ -46,6 +47,8 @@ import { SedaService } from './services/seda.service';
import { RegisterIconsService } from './services/register-icons.service';
import { NotificationService } from './services/notification.service';
import { PopupService } from './services/popup.service';
import { LoggerModule } from 'ui-frontend-common';
import { ProfileService } from './services/profile.service';
import {
NgxUiLoaderModule,
......@@ -90,20 +93,23 @@ const ngxUiLoaderConfig: NgxUiLoaderConfig = {
PastisMaterialModule,
SharedModule,
NgxUiLoaderModule.forRoot(ngxUiLoaderConfig),
LoggerModule
],
exports: [NgxUiLoaderModule],
providers: [
providers: [
PastisSpinnerInterceptor,
PastisApiService,
PastisApiService,
SedaService,
RegisterIconsService,
NotificationService,
PopupService,
LoggerModule,
ProfileService,
{ provide: HTTP_INTERCEPTORS, useClass: PastisSpinnerInterceptor,multi: true}
],
declarations: [],
})
export class CoreModule {
export class CoreModule {
}
/*
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]
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
This software is a computer program whose purpose is to provide
a web application to create, edit, import and export archive
profiles based on the french SEDA standard
(https://redirect.francearchives.fr/seda/).
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
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,
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.
liability.
In this respect, the user's attention is drawn to the risks associated
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
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.
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.
......@@ -38,13 +38,13 @@ knowledge of the CeCILL-C license and that you accept its terms.
import { EventEmitter, Injectable, Output } from '@angular/core';
import { MatDialog } from '@angular/material';
import { BehaviorSubject, Observable, throwError } from 'rxjs';
import { SedaData, SedaElementConstants, SedaCardinalityConstants } from '../../appfile-tree/classes/seda-data';
import { SedaData, SedaElementConstants, SedaCardinalityConstants } from 'projects/pastis/src/app/file-tree/classes/seda-data';
import { FileNode, TypeConstants,FileNodeInsertParams, FileNodeInsertAttributeParams } from '../../file-tree/classes/file-node';
import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component';
import { ProfileService } from './profile.service';
import { PastisDialogData } from '../../appshared/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 { FileTreeMetadataService } from '../../appfile-tree/file-tree-metadata/file-tree-metadata.service';
import { FileTreeMetadataService } from 'projects/pastis/src/app/file-tree/file-tree-metadata/file-tree-metadata.service';
import { profile } from 'console';
@Injectable({
......@@ -52,14 +52,14 @@ import { profile } from 'console';
})
export class FileService {
@Output()
@Output()
public addNode: EventEmitter<FileNode> = new EventEmitter<FileNode>();
@Output()
@Output()
public insertItem: EventEmitter<FileNodeInsertParams> = new EventEmitter<FileNodeInsertParams>();
@Output()
@Output()
public insertAttributes: EventEmitter<FileNodeInsertAttributeParams> = new EventEmitter<FileNodeInsertAttributeParams>();
@Output()
@Output()
public removeNode: EventEmitter<FileNode> = new EventEmitter<FileNode>();
@Output()
public renderChanges: EventEmitter<boolean> = new EventEmitter<boolean>();
......@@ -71,7 +71,7 @@ export class FileService {
collectionName = new BehaviorSubject<string>(null);
rootTabMetadataName = new BehaviorSubject<string>(null);
filteredNode = new BehaviorSubject<FileNode>(null);
tabChildrenRulesChange = new BehaviorSubject<string[][]>([]);
......@@ -108,9 +108,9 @@ export class FileService {
*
* Les nodes correspondant aux ArchivesUnit
* se réfèrent à la définition SEDA de l'ArchiveUnit mère (ils sont récursifs...)
* @param parent
* @param nodes
* @param sedaData
* @param parent
* @param nodes
* @param sedaData
*/
linkFileNodeToSedaData(parent: FileNode, nodes: FileNode[], sedaData: SedaData[]){
nodes.forEach(node => {
......@@ -173,7 +173,7 @@ export class FileService {
openPopup(popData: PastisDialogData){
const dialogConfirmRef = this.dialog.open(PastisDialogConfirmComponent, {
width: popData.width,
width: popData.width,
height: popData.height,
data: popData,
panelClass: 'pastis-popup-modal-box'
......@@ -203,7 +203,7 @@ export class FileService {
}
}
}
setCollectionName(collectionName:string){
this.collectionName.next(collectionName);
}
......@@ -211,12 +211,12 @@ export class FileService {
setTabRootMetadataName(rootTabMetadataName:string){
this.rootTabMetadataName.next(rootTabMetadataName);
}
openDialogWithTemplateRef(templateRef) {
this.dialog.open(templateRef);
}
setNewChildrenRules(rules:string[][]){
this.tabChildrenRulesChange.next(rules);
}
......@@ -242,7 +242,7 @@ export class FileService {
updateItem(node: FileNode) {
this.dataChange.next(node[0]);
console.log("Node updated to : ", this.dataChange.getValue())
}
removeItem(nodesToBeDeleted: FileNode[], root: FileNode) {
......@@ -257,7 +257,7 @@ export class FileService {
if (index !== -1) {
parentNode.children.splice(index, 1);
this.parentNodeMap.delete(nodeToBeDeleted);
}
}
console.log("Deleted node : ", nodeToBeDeleted, "and his parent : ", parentNode);
}
}
......@@ -359,11 +359,11 @@ export class FileService {
getComplexSedaChildrenAsFileNode(sedaElement:SedaData):FileNode[] {
// Insert all children of complex elements based on SEDA definition
if (sedaElement.Element === SedaElementConstants.complex &&
if (sedaElement.Element === SedaElementConstants.complex &&