Commit 51bc5946 authored by Homada.Boumedane's avatar Homada.Boumedane
Browse files

refactor(portal): cypress e2e

refactor existing test
parent abfb98ab
import {Person} from "@models";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Person} from "@models";
import {
AssociationRemoteAction,
AssociationRemoteNameSpace,
......
......@@ -13,7 +13,6 @@ import {
DlcmRoutes,
} from "@app/shared/models/dlcm-route.model";
import {HomeState} from "@home/stores/home.state";
import {HomeOrganizationalUnitArchiveState} from "@home/stores/organizational-unit/archive/home-organizational-unit-archive.state";
import {HomeOrganizationalUnitState} from "@home/stores/organizational-unit/home-organizational-unit.state";
import {TRANSLATE} from "solidify-frontend";
......
import {AccessOrganizationalUnit} from "@models";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {AccessOrganizationalUnit} from "@models";
import {
QueryParameters,
ResourceAction,
......
import {Contributor} from "@app/generated-api/model/contributor.partial.model";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {
ResourceAction,
ResourceNameSpace,
TypeDefaultAction,
} from "solidify-frontend";
import {Contributor} from "@app/generated-api/model/contributor.partial.model";
const state = LocalStateEnum.preservationSpace_contributor;
......
import {ActivatedRoute} from "@angular/router";
import {NotificationModeEnum} from "@app/features/preservation-space/notification/enums/notification-mode.enum";
import {
NotificationDlcm,
NotificationType,
} from "@models";
import {NotificationDlcm} from "@models";
import {PreservationSpaceRoutesEnum} from "@shared/enums/routes.enum";
import {isNotNullNorUndefined} from "solidify-frontend";
......
import {ActivatedRoute} from "@angular/router";
import {Store} from "@ngxs/store";
import {AipTabEnum} from "@preservation/aip/enums/aip-tab.enum";
import {AppRoutesEnum, PreservationPlanningRoutesEnum} from "@shared/enums/routes.enum";
import {isNullOrUndefined, StringUtil} from "solidify-frontend";
import {ArchivalStorageResourceApiEnum} from "@shared/enums/api.enum";
import {Store} from "@ngxs/store";
import {
AppRoutesEnum,
PreservationPlanningRoutesEnum,
} from "@shared/enums/routes.enum";
import {
isNullOrUndefined,
StringUtil,
} from "solidify-frontend";
export class AipHelper {
static getTabRouteSelected(route: ActivatedRoute): PreservationPlanningRoutesEnum | undefined {
......
import {Dip} from "@models";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Dip} from "@models";
import {
BaseAction,
BaseSubAction,
......
import {Sip} from "@models";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Sip} from "@models";
import {
BaseAction,
BaseSubAction,
......
......@@ -9,7 +9,6 @@ import {
} from "@angular/material/dialog";
import {SharedAbstractContainer} from "@shared/components/containers/shared-abstract/shared-abstract.container";
import {SharedPreviewDialogData} from "@shared/components/dialogs/shared-preview/shared-preview-dialog-data.model";
import {FileVisualizerPresentational} from "@shared/filevisualizer/components/file-visualizer.component";
@Component({
selector: "dlcm-preview-dialog",
......
......@@ -2,7 +2,8 @@
class="main-buttons"
>
<ng-container *ngFor="let button of listButtonMerged">
<button mat-button
<button id="toolbar-btn-{{button.icon}}"
mat-button
#buttonRef
*ngIf="!button.displayCondition || (button.displayCondition(currentModel) | solidifyAsync)"
[disabled]="button.disableCondition && (button.disableCondition(currentModel) | solidifyAsync)"
......
......@@ -7,8 +7,6 @@ import {
import {DepositDataFile} from "@deposit/models/deposit-data-file.model";
import {SharedAbstractButtonToolbarPresentational} from "@shared/components/presentationals/shared-abstract-button-toolbar/shared-abstract-button-toolbar.presentational";
import {SharedAbstractFormPresentational} from "@shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {SharedAbstractButtonToolbarPresentational} from "@shared/components/presentationals/shared-abstract-button-toolbar/shared-abstract-button-toolbar.presentational";
import {SharedAbstractFormPresentational} from "@shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {
BehaviorSubject,
Observable,
......@@ -51,28 +49,9 @@ export class ButtonToolbarDetailPresentational<TResourceModel extends BaseResour
@Input()
historyAvailable: boolean = false;
@Input()
refreshAvailable: boolean = false;
@Input()
readonly formPresentational: SharedAbstractFormPresentational<TResourceModel>;
private _mode: "edit" | "create" | "detail";
@Input()
readonly keySaveButtonToTranslate: string = TRANSLATE("app.navigation.button.save");
@Input()
editAvailable: boolean = true;
@Input()
deleteAvailable: boolean = true;
@Input()
currentModel: TResourceModel;
@Input()
displayHistory: boolean = false;
@Input()
readonly formPresentational: SharedAbstractFormPresentational<TResourceModel>;
......@@ -99,9 +78,6 @@ export class ButtonToolbarDetailPresentational<TResourceModel extends BaseResour
@Output("showHistoryChange")
readonly showHistoryObs: Observable<DepositDataFile | undefined> = ObservableUtil.asObservable(this._showHistoryBS);
@Input()
readonly formPresentational: SharedAbstractFormPresentational<TResourceModel>;
private readonly _editBS: BehaviorSubject<void> = new BehaviorSubject<void>(undefined);
@Output("editChange")
readonly editObs: Observable<void> = ObservableUtil.asObservable(this._editBS);
......
......@@ -2,7 +2,8 @@
class="main-buttons"
>
<ng-container *ngFor="let button of listButtonMerged">
<button mat-button
<button id="btn-toolbar-{{button.icon}}"
mat-button
#buttonRef
*ngIf="!button.displayCondition || (button.displayCondition(undefined) | solidifyAsync)"
[disabled]="button.disableCondition && (button.disableCondition(undefined) | solidifyAsync)"
......
......@@ -15,7 +15,6 @@ import {
BaseResourceType,
isEmptyString,
isNullOrUndefined,
isNumber,
ObservableUtil,
} from "solidify-frontend";
......@@ -36,6 +35,8 @@ export abstract class SharedAbstractContentPresentational<TResource extends Base
@Output("closeByShiftTabChange")
readonly closeByShiftTabObs: Observable<void> = ObservableUtil.asObservable(this._closeByShiftTabBS);
indexSelected: number;
constructor() {
super();
}
......@@ -64,10 +65,6 @@ export abstract class SharedAbstractContentPresentational<TResource extends Base
this._closeBS.next();
}
closeByTab(): void {
this._closeByTabBS.next();
}
isActive(value: TResource): boolean {
if (isNullOrUndefined(this.host.formControl.value) || isEmptyString(this.host.formControl.value)) {
return false;
......@@ -75,12 +72,6 @@ export abstract class SharedAbstractContentPresentational<TResource extends Base
return this.host.formControl.value.includes(value[this.host.valueKey]);
}
indexSelected: number;
getFocusedElement(): TResource {
return isNumber(this.indexSelected) ? this.host.list[this.indexSelected] : undefined;
}
selectNextResource(): void {
const val = this.host.list;
let activeValIndex = -1;
......
import {FocusKeyManager} from "@angular/cdk/a11y";
import {
ChangeDetectionStrategy,
Component,
ElementRef,
Input,
OnInit,
Output,
QueryList,
ViewChild,
ViewChildren,
} from "@angular/core";
import {FormBuilder} from "@angular/forms";
import {Store} from "@ngxs/store";
......@@ -20,7 +15,6 @@ import {
} from "rxjs";
import {
BaseResourceType,
isTruthyObject,
ObservableUtil,
ResourceStateModel,
} from "solidify-frontend";
......
import {Injectable} from "@angular/core";
import {environment} from "@environments/environment";
import {FileInput} from "@shared/filevisualizer/models/file-info.model";
import {FileVisualizerConstant} from "@shared/filevisualizer/models/file-visualizer.constant";
import {AbstractFileVisualizer} from "@shared/filevisualizer/services/abstract-file-visualizer.service";
import {isTruthyObject} from "solidify-frontend";
import {environment} from "@environments/environment";
@Injectable()
export class ImageFileVisualizerService implements AbstractFileVisualizer {
......
......@@ -3,7 +3,7 @@ import {
AipChecksumCheck,
AipFileFormat,
ChangeInfo,
MetadataType
MetadataType,
} from "@models";
import {DataFileStatusEnum} from "@shared/enums/business/data-file-status.enum";
import {DataCategoryEnum} from "@shared/enums/data-category.enum";
......
......@@ -10,7 +10,6 @@ import {
UrlMatcher,
} from "@angular/router";
import {ApplicationRolePermissionEnum} from "@app/shared/enums/application-role-permission.enum";
import {Observable} from "rxjs";
import {BaseResourceState} from "solidify-frontend";
export declare type DlcmRoutes = DlcmRoute[];
......
......@@ -14,10 +14,8 @@ import {
timer,
} from "rxjs";
import {
distinctUntilChanged,
mapTo,
skipUntil,
tap,
} from "rxjs/operators";
import {LoggingService} from "solidify-frontend";
......
......@@ -22,12 +22,8 @@ import {
MatDialogConfig,
MatDialogRef,
} from "@angular/material/dialog";
import {NativeElement} from "@shared/models/native-element.model";
import {TabulationService} from "@shared/services/tabulation.service";
import {
isTruthyObject,
SubscriptionManager,
} from "solidify-frontend";
import {SubscriptionManager} from "solidify-frontend";
@Injectable()
export class MatDialogOverrideService extends MatDialog implements OnDestroy {
......
......@@ -4,12 +4,25 @@ import {AppOrgUnitPersonRoleAction} from "@app/stores/organizational-unit-person
import {DepositAction} from "@deposit/stores/deposit.action";
import {DepositState} from "@deposit/stores/deposit.state";
import {Deposit} from "@models";
import {Actions, Store,} from "@ngxs/store";
import {
Actions,
Store,
} from "@ngxs/store";
import {RoleEnum} from "@shared/enums/role.enum";
import {UserApplicationRoleEnum} from "@shared/enums/user-application-role.enum";
import {Observable, of,} from "rxjs";
import {flatMap, map,} from "rxjs/operators";
import {isFalse, isNullOrUndefined, ResourceState,} from "solidify-frontend";
import {
Observable,
of,
} from "rxjs";
import {
flatMap,
map,
} from "rxjs/operators";
import {
isFalse,
isNullOrUndefined,
ResourceState,
} from "solidify-frontend";
@Injectable({
providedIn: "root",
......
Supports Markdown
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