Skip to content

Commit

Permalink
[VAS] Story 8084: mutualisation model
Browse files Browse the repository at this point in the history
  • Loading branch information
laedanrex committed Aug 9, 2023
1 parent 9194642 commit 7743cd2
Show file tree
Hide file tree
Showing 112 changed files with 634 additions and 648 deletions.
2 changes: 1 addition & 1 deletion ui/ui-frontend-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui-frontend-common",
"version": "2.1.57",
"version": "2.1.58",
"main": "src/index.ts",
"pki": {
"path": "../../dev-deployment/environments/certs/server/hosts/localhost",
Expand Down
41 changes: 41 additions & 0 deletions ui/ui-frontend-common/src/app/modules/models/criteria/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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 * from './criteria.enums';
export * from './criteria.interface';
export * from './criterion.interface';
export * from './search-criteria.interface';
export * from './search-response.interface';
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* 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 enum SearchCriteriaStatusEnum {
NOT_INCLUDED = 'NOT_INCLUDED',
INCLUDED = 'INCLUDED',
Expand Down Expand Up @@ -105,6 +106,7 @@ export interface SearchCriteriaEltDto {
values: CriteriaValue[];
dataType: string;
}

export interface SearchCriteriaDto {
criteriaList: SearchCriteriaEltDto[];
pageNumber: number;
Expand All @@ -126,10 +128,12 @@ export interface ResultFacetList {
name: string;
buckets: ResultBucket[];
}

export interface ResultBucket {
value: string;
count: number;
}

export interface ResultFacet {
node: string;
count: number;
Expand All @@ -144,6 +148,7 @@ export interface SearchCriteriaCategory {
name: string;
index: number;
}

export interface CriteriaValue {
id: string;
value?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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 { Unit } from '../units';

export interface SearchResponse<T = Unit> {
$hits: any;
$results: T[];
$facetResults?: any[];
}
4 changes: 1 addition & 3 deletions ui/ui-frontend-common/src/app/modules/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ export * from './application/index';
export * from './breadcrumb/breadcrumb.interface';
export * from './collect/index';
export * from './content-disposition.enum';
export * from './criteria/criteria.enums';
export * from './criteria/criteria.interface';
export * from './criteria/criterion.interface';
export * from './criteria/index';
export * from './customer/index';
export * from './externalparamprofile/index';
export * from './group/index';
Expand Down
2 changes: 1 addition & 1 deletion ui/ui-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"serialize-javascript": "^5.0.1",
"timers": "^0.1.1",
"tslib": "^2.0.3",
"ui-frontend-common": "file:../ui-frontend-common/ui-frontend-common-2.1.57.tgz",
"ui-frontend-common": "file:../ui-frontend-common/ui-frontend-common-2.1.58.tgz",
"underscore": "^1.13.1",
"utf-8-validate": "^5.0.2",
"uuid": "^7.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ import { animate, AUTO_STYLE, state, style, transition, trigger } from '@angular
import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs';
import { CriteriaDataType, CriteriaOperator, Unit } from 'ui-frontend-common';
import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, Unit } from 'ui-frontend-common';
import { ArchiveService } from '../../archive.service';
import { SearchCriteriaEltDto, SearchCriteriaTypeEnum } from '../../models/search.criteria';

const PAGE_SIZE = 10;
const CURRENT_PAGE = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs';
import { ConfirmDialogService, Logger, StartupService } from 'ui-frontend-common';
import { ConfirmDialogService, Logger, SearchCriteriaEltDto, StartupService } from 'ui-frontend-common';
import * as uuid from 'uuid';
import { ArchiveService } from '../../../archive.service';
import { ExportDIPCriteriaList, ExportDIPRequestDetail } from '../../../models/dip-request-detail.interface';
import { SearchCriteriaEltDto } from '../../../models/search.criteria';

@Component({
selector: 'app-dip-request-create',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service';
import { SearchCriteriaDto, SearchCriteriaTypeEnum } from 'projects/archive-search/src/app/archive/models/search.criteria';
import {
UpdateUnitManagementRuleService
} from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service';
import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { Observable, of } from 'rxjs';
import { BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'ui-frontend-common';
import {
BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, LoggerModule, SearchCriteriaDto, SearchCriteriaTypeEnum, WINDOW_LOCATION
} from 'ui-frontend-common';
import { VitamUICommonTestModule } from 'ui-frontend-common/testing';
import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { AddManagementRulesComponent } from './add-management-rules.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ import { TranslateService } from '@ngx-translate/core';
import { cloneDeep } from 'lodash';
import { merge, Subscription } from 'rxjs';
import { debounceTime, filter, map } from 'rxjs/operators';
import { CriteriaDataType, CriteriaOperator, diff, Rule, RuleService } from 'ui-frontend-common';
import { CriteriaDataType, CriteriaOperator, diff, Rule, RuleService, SearchCriteriaDto, SearchCriteriaEltDto } from 'ui-frontend-common';
import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service';
import { ArchiveService } from '../../../../../archive.service';
import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service';
import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum';
import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { SearchCriteriaDto, SearchCriteriaEltDto } from '../../../../../models/search.criteria';
import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service';

const MANAGEMENT_RULE_IDENTIFIER = 'MANAGEMENT_RULE_IDENTIFIER';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ import { RouterTestingModule } from '@angular/router/testing';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { Observable, of } from 'rxjs';
import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'ui-frontend-common';
import { BASE_URL, InjectorModule, LoggerModule, SearchCriteriaDto, WINDOW_LOCATION } from 'ui-frontend-common';
import { VitamUICommonTestModule } from 'ui-frontend-common/testing';
import { UpdateUnitManagementRuleService } from '../../../../common-services/update-unit-management-rule.service';
import { RuleTypeEnum } from '../../../../models/rule-type-enum';
import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../models/ruleAction.interface';
import { SearchCriteriaDto } from '../../../../models/search.criteria';
import { ArchiveUnitRulesComponent } from './archive-unit-rules.component';

const translations: any = { TEST: 'Mock translate test' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ import { MatDialog } from '@angular/material/dialog';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { merge, Subscription } from 'rxjs';
import { debounceTime, filter, map } from 'rxjs/operators';
import { diff, Rule, RuleService } from 'ui-frontend-common';
import { diff, Rule, RuleService, SearchCriteriaDto } from 'ui-frontend-common';
import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum';
import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { SearchCriteriaDto } from '../../../../../models/search.criteria';
import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service';

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service';
import { SearchCriteriaDto, SearchCriteriaTypeEnum } from 'projects/archive-search/src/app/archive/models/search.criteria';
import {
UpdateUnitManagementRuleService
} from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service';
import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { Observable, of } from 'rxjs';
import { BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'ui-frontend-common';
import {
BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, LoggerModule, SearchCriteriaDto, SearchCriteriaTypeEnum, WINDOW_LOCATION
} from 'ui-frontend-common';
import { VitamUICommonTestModule } from 'ui-frontend-common/testing';
import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { DeleteUnitRulesComponent } from './delete-unit-rules.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ import { cloneDeep } from 'lodash';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { merge, Subscription } from 'rxjs';
import { debounceTime, filter, map } from 'rxjs/operators';
import { CriteriaDataType, CriteriaOperator, diff, Rule, RuleService } from 'ui-frontend-common';
import { CriteriaDataType, CriteriaOperator, diff, Rule, RuleService, SearchCriteriaDto, SearchCriteriaEltDto } from 'ui-frontend-common';
import { ArchiveService } from '../../../../../archive.service';
import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service';
import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum';
import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { SearchCriteriaDto, SearchCriteriaEltDto } from '../../../../../models/search.criteria';
import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service';

const MANAGEMENT_RULE_IDENTIFIER = 'MANAGEMENT_RULE_IDENTIFIER';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ import { RouterTestingModule } from '@angular/router/testing';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { Observable, of } from 'rxjs';
import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'ui-frontend-common';
import { BASE_URL, InjectorModule, LoggerModule, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'ui-frontend-common';
import { VitamUICommonTestModule } from 'ui-frontend-common/testing';
import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service';
import { RuleTypeEnum } from '../../../../../models/rule-type-enum';
import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { PagedResult, SearchCriteriaDto } from '../../../../../models/search.criteria';
import { UnlockCategoryInheritanceComponent } from './unlock-category-inheritance.component';

const translations: any = { TEST: 'Mock translate test' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ import { cloneDeep } from 'lodash';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { Subscription } from 'rxjs';
import { filter } from 'rxjs/operators';
import { CriteriaDataType, CriteriaOperator } from 'ui-frontend-common';
import { CriteriaDataType, CriteriaOperator, SearchCriteriaDto, SearchCriteriaEltDto } from 'ui-frontend-common';
import { ArchiveService } from '../../../../../archive.service';
import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service';
import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum';
import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { SearchCriteriaDto, SearchCriteriaEltDto } from '../../../../../models/search.criteria';

const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE';
const MANAGEMENT_RULE_INHERITED_CRITERIA = 'MANAGEMENT_RULE_INHERITED_CRITERIA';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service';
import { SearchCriteriaDto, SearchCriteriaTypeEnum } from 'projects/archive-search/src/app/archive/models/search.criteria';
import {
UpdateUnitManagementRuleService
} from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service';
import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service';
import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service';
import { Observable, of } from 'rxjs';
import { BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'ui-frontend-common';
import {
BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, LoggerModule, SearchCriteriaDto, SearchCriteriaTypeEnum, WINDOW_LOCATION
} from 'ui-frontend-common';
import { VitamUICommonTestModule } from 'ui-frontend-common/testing';
import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface';
import { UnlockRulesInheritanceComponent } from './unlock-rules-inheritance.component';
Expand Down
Loading

0 comments on commit 7743cd2

Please sign in to comment.