fix lock and add entity locks admin page
parent
48a310e561
commit
ba33b29e41
@ -0,0 +1,20 @@
|
||||
package eu.eudat.configurations.lock;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(LockProperties.class)
|
||||
public class LockConfiguration {
|
||||
private final LockProperties properties;
|
||||
|
||||
@Autowired
|
||||
public LockConfiguration(LockProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public LockProperties getProperties() {
|
||||
return properties;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package eu.eudat.configurations.lock;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(prefix = "lock")
|
||||
public class LockProperties {
|
||||
|
||||
private Integer lockInterval;
|
||||
|
||||
public Integer getLockInterval() {
|
||||
return lockInterval;
|
||||
}
|
||||
|
||||
public void setLockInterval(Integer lockInterval) {
|
||||
this.lockInterval = lockInterval;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package eu.eudat.model;
|
||||
|
||||
public class LockStatus {
|
||||
|
||||
Boolean status;
|
||||
|
||||
Lock lock;
|
||||
|
||||
public Boolean getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Boolean status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Lock getLock() {
|
||||
return lock;
|
||||
}
|
||||
|
||||
public void setLock(Lock lock) {
|
||||
this.lock = lock;
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
lock:
|
||||
lockInterval: 120000
|
@ -1,4 +1,6 @@
|
||||
export enum LockTargetType {
|
||||
Dmp = 0,
|
||||
Description = 1
|
||||
Description = 1,
|
||||
DmpBlueprint = 2,
|
||||
DescriptionTemplate= 3
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
<div class="d-flex align-items-center gap-1-rem">
|
||||
|
||||
<button mat-flat-button [matMenuTriggerFor]="filterMenu" #filterMenuTrigger="matMenuTrigger" (click)="updateFilters()" class="filter-button">
|
||||
<mat-icon aria-hidden="false" [matBadgeHidden]="!appliedFilterCount" [matBadge]="appliedFilterCount" matBadgeColor="warn" matBadgeSize="small">filter_alt</mat-icon>
|
||||
{{'COMMONS.LISTING-COMPONENT.SEARCH-FILTER-BTN' | translate}}
|
||||
</button>
|
||||
|
||||
|
||||
<mat-menu #filterMenu>
|
||||
<div class="p-3" (click)="$event?.stopPropagation?.()">
|
||||
<div class="search-listing-filters-container">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<h4>{{'LOCK-LISTING.FILTER.TITLE' | translate}}</h4>
|
||||
<button color="accent" mat-button (click)="clearFilters()">
|
||||
{{'COMMONS.LISTING-COMPONENT.CLEAR-ALL-FILTERS' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div>
|
||||
<mat-form-field class="col-12">
|
||||
<mat-label>{{'LOCK-LISTING.FILTER.USERS' | translate}}</mat-label>
|
||||
<app-multiple-auto-complete [(ngModel)]="internalFilters.userIds" [hidePlaceholder]="true" [separatorKeysCodes]="separatorKeysCodes" [configuration]="userService.multipleAutocompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div>
|
||||
<mat-form-field class="col-12">
|
||||
<mat-label>{{'LOCK-LISTING.FILTER.TARGET-TYPE' | translate}}
|
||||
<mat-select multiple [(ngModel)]="internalFilters.targetTypes">
|
||||
<mat-option *ngFor="let targetType of lockTargetTypeEnumValues" [value]="targetType">{{enumUtils.toLockTargetTypeString(targetType)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-label>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between mt-4 gap-1-rem">
|
||||
<button mat-stroked-button color="primary" (click)="filterMenuTrigger?.closeMenu()">
|
||||
{{'LOCK-LISTING.FILTER.CANCEL' | translate}}
|
||||
</button>
|
||||
<button mat-raised-button color="primary" (click)="filterMenuTrigger.closeMenu(); applyFilters();">
|
||||
{{'LOCK-LISTING.FILTER.APPLY-FILTERS' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-menu>
|
||||
|
||||
<app-expandable-search-field [(value)]=internalFilters.like (valueChange)="onSearchTermChange($event)" />
|
||||
</div>
|
@ -0,0 +1,21 @@
|
||||
::ng-deep.mat-mdc-menu-panel {
|
||||
max-width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
:host::ng-deep.mat-mdc-menu-content:not(:empty) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
.filter-button{
|
||||
padding-top: .6rem;
|
||||
padding-bottom: .6rem;
|
||||
// .mat-icon{
|
||||
// font-size: 1.5em;
|
||||
// width: 1.2em;
|
||||
// height: 1.2em;
|
||||
// }
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,108 @@
|
||||
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { LockTargetType } from '@app/core/common/enum/lock-target-type';
|
||||
import { LockFilter } from '@app/core/query/lock.lookup';
|
||||
import { UserService } from '@app/core/services/user/user.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
|
||||
@Component({
|
||||
selector: 'app-lock-listing-filters',
|
||||
templateUrl: './lock-listing-filters.component.html',
|
||||
styleUrls: ['./lock-listing-filters.component.scss']
|
||||
})
|
||||
export class LockListingFiltersComponent extends BaseComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input() readonly filter: LockFilter;
|
||||
@Output() filterChange = new EventEmitter<LockFilter>();
|
||||
|
||||
lockTargetTypeEnumValues = this.enumUtils.getEnumValues<LockTargetType>(LockTargetType);
|
||||
|
||||
readonly separatorKeysCodes: number[] = [ENTER, COMMA];
|
||||
|
||||
// * State
|
||||
internalFilters: LockListingFilters = this._getEmptyFilters();
|
||||
|
||||
protected appliedFilterCount: number = 0;
|
||||
constructor(
|
||||
public enumUtils: EnumUtils,
|
||||
public userService: UserService,
|
||||
) { super(); }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
const filterChange = changes[nameof<LockListingFiltersComponent>(x => x.filter)]?.currentValue as LockFilter;
|
||||
if (filterChange) {
|
||||
this.updateFilters()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onSearchTermChange(searchTerm: string): void {
|
||||
this.applyFilters()
|
||||
}
|
||||
|
||||
|
||||
protected updateFilters(): void {
|
||||
this.internalFilters = this._parseToInternalFilters(this.filter);
|
||||
this.appliedFilterCount = this._computeAppliedFilters(this.internalFilters);
|
||||
}
|
||||
|
||||
protected applyFilters(): void {
|
||||
const { targetTypes, like, userIds } = this.internalFilters ?? {}
|
||||
this.filterChange.emit({
|
||||
...this.filter,
|
||||
targetTypes,
|
||||
like,
|
||||
userIds
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
private _parseToInternalFilters(inputFilter: LockFilter): LockListingFilters {
|
||||
if (!inputFilter) {
|
||||
return this._getEmptyFilters();
|
||||
}
|
||||
|
||||
let { targetTypes, like, userIds } = inputFilter;
|
||||
|
||||
return {
|
||||
targetTypes: targetTypes,
|
||||
like: like,
|
||||
userIds: userIds
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private _getEmptyFilters(): LockListingFilters {
|
||||
return {
|
||||
targetTypes: null,
|
||||
like: null,
|
||||
userIds: null
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private _computeAppliedFilters(filters: LockListingFilters): number {
|
||||
let count = 0;
|
||||
// if (filters?.isActive) {
|
||||
// count++
|
||||
// }
|
||||
return count;
|
||||
}
|
||||
|
||||
clearFilters() {
|
||||
this.internalFilters = this._getEmptyFilters();
|
||||
}
|
||||
}
|
||||
|
||||
interface LockListingFilters {
|
||||
targetTypes: LockTargetType[];
|
||||
like: string;
|
||||
userIds: Guid[];
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
<div class="row lock-listing">
|
||||
<div class="col-md-8 offset-md-2">
|
||||
|
||||
<div class="row mb-4 mt-3">
|
||||
<div class="col">
|
||||
<h4>{{'LOCK-LISTING.TITLE' | translate}}</h4>
|
||||
<app-navigation-breadcrumb />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<app-hybrid-listing [rows]="gridRows" [columns]="gridColumns" [visibleColumns]="visibleColumns"
|
||||
[count]="totalElements" [offset]="currentPageNumber" [limit]="lookup.page.size"
|
||||
[defaultSort]="lookup.order?.items" [externalSorting]="true"
|
||||
(pageLoad)="alterPage($event)" (columnSort)="onColumnSort($event)"
|
||||
(columnsChanged)="onColumnsChanged($event)" [listItemTemplate]="listItemTemplate">
|
||||
|
||||
<app-lock-listing-filters hybrid-listing-filters [(filter)]="lookup"
|
||||
(filterChange)="filterChanged($event)" />
|
||||
|
||||
<app-user-settings-picker [key]="userSettingsKey" [userPreference]="lookup"
|
||||
(onSettingSelected)="changeSetting($event)" [autoSelectUserSettings]="autoSelectUserSettings"
|
||||
user-preference-settings />
|
||||
</app-hybrid-listing>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #listItemTemplate let-item="item" let-isColumnSelected="isColumnSelected">
|
||||
|
||||
|
||||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('targetType')">
|
||||
<span class="col-12">
|
||||
{{'LOCK-LISTING.FIELDS.TARGET-TYPE' | translate}}:
|
||||
<small>
|
||||
{{enumUtils.toLockTargetTypeString(item.targetType) | nullifyValue}}
|
||||
</small>
|
||||
</span>
|
||||
<br>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="isColumnSelected('lockedAt')">
|
||||
<span class="col-12">
|
||||
{{'LOCK-LISTING.FIELDS.LOCKED-AT' | translate}}:
|
||||
<small>
|
||||
{{item?.lockedAt | dateTimeFormatter : 'short' | nullifyValue}}
|
||||
</small>
|
||||
</span>
|
||||
<br>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="isColumnSelected('touchedAt')">
|
||||
<span class="col-12">
|
||||
{{'LOCK-LISTING.FIELDS.TOUCHED-AT' | translate}}:
|
||||
<small>
|
||||
{{item?.touchedAt | dateTimeFormatter : 'short' | nullifyValue}}
|
||||
</small>
|
||||
</span>
|
||||
</ng-container>
|
||||
<!-- <ng-container *ngIf="isColumnSelected('contactTypeHint')">
|
||||
<span class="col-12">
|
||||
{{'LOCK-LISTING.FIELDS.CONTACT-TYPE' | translate}}:
|
||||
<small>
|
||||
{{enumUtils.toNotificationContactTypeString(item.contactTypeHint) | nullifyValue}}
|
||||
</small>
|
||||
</span>
|
||||
<br>
|
||||
</ng-container> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button mat-menu-item (click)="deleteType(row.id)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
{{'LOCK-LISTING.ACTIONS.DELETE' | translate}}
|
||||
</button>
|
||||
</mat-menu>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
@ -0,0 +1,36 @@
|
||||
::ng-deep datatable-header-cell {
|
||||
width: fit-content !important;
|
||||
padding: 0.9rem 0.7rem !important;
|
||||
}
|
||||
|
||||
::ng-deep .datatable-header-cell-template-wrap {
|
||||
width: fit-content !important;
|
||||
}
|
||||
|
||||
.lock-listing {
|
||||
margin-top: 1.3rem;
|
||||
margin-left: 1rem;
|
||||
margin-right: 2rem;
|
||||
|
||||
.mat-header-row{
|
||||
background: #f3f5f8;
|
||||
}
|
||||
.mat-card {
|
||||
margin: 16px 0;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.mat-row {
|
||||
cursor: pointer;
|
||||
min-height: 4.5em;
|
||||
}
|
||||
|
||||
mat-row:hover {
|
||||
background-color: #eef5f6;
|
||||
}
|
||||
.mat-fab-bottom-right {
|
||||
float: right;
|
||||
z-index: 5;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,176 @@
|
||||
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { ColumnDefinition, ColumnsChangedEvent, HybridListingComponent, PageLoadEvent } from '@common/modules/hybrid-listing/hybrid-listing.component';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { Lock } from '@app/core/model/lock/lock.model';
|
||||
import { LockLookup } from '@app/core/query/lock.lookup';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { LockTargetTypePipe } from '@common/formatting/pipes/lock-target-type.pipe';
|
||||
import { User } from '@app/core/model/user/user';
|
||||
|
||||
@Component({
|
||||
templateUrl: './lock-listing.component.html',
|
||||
styleUrls: ['./lock-listing.component.scss']
|
||||
})
|
||||
export class LockListingComponent extends BaseListingComponent<Lock, LockLookup> implements OnInit {
|
||||
publish = false;
|
||||
userSettingsKey = { key: 'LockListingUserSettings' };
|
||||
propertiesAvailableForOrder: ColumnDefinition[];
|
||||
|
||||
@ViewChild('actions', { static: true }) actions?: TemplateRef<any>;
|
||||
@ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent;
|
||||
|
||||
private readonly lookupFields: string[] = [
|
||||
nameof<Lock>(x => x.id),
|
||||
nameof<Lock>(x => x.target),
|
||||
nameof<Lock>(x => x.targetType),
|
||||
nameof<Lock>(x => x.lockedBy),
|
||||
[nameof<Lock>(x => x.lockedBy), nameof<User>(x => x.name)].join('.'),
|
||||
nameof<Lock>(x => x.lockedAt),
|
||||
nameof<Lock>(x => x.touchedAt),
|
||||
nameof<Lock>(x => x.hash),
|
||||
];
|
||||
|
||||
rowIdentity = x => x.id;
|
||||
|
||||
constructor(
|
||||
protected router: Router,
|
||||
protected route: ActivatedRoute,
|
||||
protected uiNotificationService: UiNotificationService,
|
||||
protected httpErrorHandlingService: HttpErrorHandlingService,
|
||||
protected queryParamsService: QueryParamsService,
|
||||
private lockService: LockService,
|
||||
public authService: AuthService,
|
||||
private pipeService: PipeService,
|
||||
public enumUtils: EnumUtils,
|
||||
private language: TranslateService,
|
||||
private dialog: MatDialog
|
||||
) {
|
||||
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
|
||||
// Lookup setup
|
||||
// Default lookup values are defined in the user settings class.
|
||||
this.lookup = this.initializeLookup();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
}
|
||||
|
||||
protected initializeLookup(): LockLookup {
|
||||
const lookup = new LockLookup();
|
||||
lookup.metadata = { countAll: true };
|
||||
lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE };
|
||||
lookup.order = { items: [this.toDescSortField(nameof<Lock>(x => x.touchedAt))] };
|
||||
this.updateOrderUiFields(lookup.order);
|
||||
|
||||
lookup.project = {
|
||||
fields: this.lookupFields
|
||||
};
|
||||
|
||||
return lookup;
|
||||
}
|
||||
|
||||
protected setupColumns() {
|
||||
this.gridColumns.push(...[{
|
||||
prop: nameof<Lock>(x => x.target),
|
||||
sortable: true,
|
||||
languageName: 'LOCK-LISTING.FIELDS.TARGET',
|
||||
},
|
||||
{
|
||||
prop: nameof<Lock>(x => x.targetType),
|
||||
sortable: true,
|
||||
languageName: 'LOCK-LISTING.FIELDS.TARGET-TYPE',
|
||||
pipe: this.pipeService.getPipe<LockTargetTypePipe>(LockTargetTypePipe)
|
||||
},
|
||||
{
|
||||
prop: nameof<Lock>(x => x.lockedBy.name),
|
||||
sortable: true,
|
||||
languageName: 'LOCK-LISTING.FIELDS.LOCKED-BY',
|
||||
},
|
||||
{
|
||||
prop: nameof<Lock>(x => x.lockedAt),
|
||||
sortable: true,
|
||||
languageName: 'LOCK-LISTING.FIELDS.LOCKED-AT',
|
||||
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
|
||||
},
|
||||
{
|
||||
prop: nameof<Lock>(x => x.touchedAt),
|
||||
sortable: true,
|
||||
languageName: 'LOCK-LISTING.FIELDS.TOUCHED-AT',
|
||||
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
|
||||
},
|
||||
{
|
||||
alwaysShown: true,
|
||||
cellTemplate: this.actions,
|
||||
maxWidth: 120
|
||||
}
|
||||
]);
|
||||
this.propertiesAvailableForOrder = this.gridColumns.filter(x => x.sortable);
|
||||
}
|
||||
|
||||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
}
|
||||
|
||||
private onColumnsChangedInternal(columns: string[]) {
|
||||
// Here are defined the projection fields that always requested from the api.
|
||||
const fields = new Set(this.lookupFields);
|
||||
this.gridColumns.map(x => x.prop)
|
||||
.filter(x => !columns?.includes(x as string))
|
||||
.forEach(item => {
|
||||
fields.delete(item as string)
|
||||
});
|
||||
this.lookup.project = { fields: [...fields] };
|
||||
this.onPageLoad({ offset: 0 } as PageLoadEvent);
|
||||
}
|
||||
|
||||
protected loadListing(): Observable<QueryResult<Lock>> {
|
||||
return this.lockService.query(this.lookup);
|
||||
}
|
||||
|
||||
public deleteType(id: Guid) {
|
||||
if (id) {
|
||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
data: {
|
||||
isDeleteConfirmation: true,
|
||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-ITEM'),
|
||||
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
||||
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL')
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
this.lockService.delete(id).pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => this.onCallbackSuccess(),
|
||||
error => this.onCallbackError(error)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onCallbackSuccess(): void {
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||
import { NgModule } from "@angular/core";
|
||||
import { AutoCompleteModule } from "@app/library/auto-complete/auto-complete.module";
|
||||
import { CommonFormattingModule } from '@common/formatting/common-formatting.module';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||
import { HybridListingModule } from "@common/modules/hybrid-listing/hybrid-listing.module";
|
||||
import { TextFilterModule } from "@common/modules/text-filter/text-filter.module";
|
||||
import { UserSettingsModule } from "@common/modules/user-settings/user-settings.module";
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { NgxDropzoneModule } from "ngx-dropzone";
|
||||
import { RichTextEditorModule } from '@app/library/rich-text-editor/rich-text-editor.module';
|
||||
import { LockRoutingModule } from './lock.routing';
|
||||
import { LockListingFiltersComponent } from './filters/lock-listing-filters.component';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { LockListingComponent } from './lock-listing.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
ConfirmationDialogModule,
|
||||
LockRoutingModule,
|
||||
NgxDropzoneModule,
|
||||
DragDropModule,
|
||||
AutoCompleteModule,
|
||||
HybridListingModule,
|
||||
TextFilterModule,
|
||||
UserSettingsModule,
|
||||
CommonFormattingModule,
|
||||
RichTextEditorModule,
|
||||
MatIconModule,
|
||||
EditorModule
|
||||
],
|
||||
declarations: [
|
||||
LockListingComponent,
|
||||
LockListingFiltersComponent
|
||||
]
|
||||
})
|
||||
export class LockModule { }
|
@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AuthGuard } from '@app/core/auth-guard.service';
|
||||
import { LockListingComponent } from './lock-listing.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: LockListingComponent,
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
{ path: '**', loadChildren: () => import('@common/modules/page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
providers: []
|
||||
})
|
||||
export class LockRoutingModule { }
|
@ -0,0 +1,11 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'LockTargetTypeFormat' })
|
||||
export class LockTargetTypePipe implements PipeTransform {
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toLockTargetTypeString(value);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue