Skip to content

Commit

Permalink
optimaiz
Browse files Browse the repository at this point in the history
  • Loading branch information
akaravi committed Nov 25, 2023
1 parent 5e19891 commit ebc30ee
Show file tree
Hide file tree
Showing 13 changed files with 488 additions and 442 deletions.
237 changes: 119 additions & 118 deletions src/app/cms-modules/data-provider/plan-category/add/add.component.html
Original file line number Diff line number Diff line change
@@ -1,128 +1,129 @@
<form (ngSubmit)="onFormSubmit()" #vform="ngForm">
<div class="ntk-cms-html-card-header">
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-header-->
{{ formInfo.formTitle }}
<!--end:::::::::::::::::::::::::::::::::::::::::cms-header-->
</div>
<div class="ntk-cms-html-card-body">
<app-progress-spinner [options]="loading"> </app-progress-spinner>
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-body-->
<div class="ntk-cms-html-card-header">
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-header-->
{{ formInfo.formTitle }}
<!--end:::::::::::::::::::::::::::::::::::::::::cms-header-->
</div>
<div class="ntk-cms-html-card-body">
<app-progress-spinner [options]="loading"> </app-progress-spinner>
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-body-->

<!-- LinkMainImageIdSrc Column -->
<ng-container matColumnDef="LinkMainImageIdSrc">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{'TITLE.PICTURE' | translate}} </mat-header-cell>
<mat-cell *matCellDef="let row">
<img *ngIf="row?.linkMainImageIdSrc?.length>0" style="vertical-align:middle;" class="ntk-hover-zoom"
aria-hidden src="{{row.linkMainImageIdSrc | cmsthumbnail}}" height="40" width="40" />
</mat-cell>
</ng-container>
<!-- RecordStatus Field -->
<mat-form-field class="ntk-full-width">
<mat-select placeholder="{{fieldsInfo['recordStatus']?.fieldTitle}}" [(ngModel)]="dataModel.recordStatus"
name="dataModel.recordStatus" #RecordStatus="ngModel"
ngClass="cms-RecordStatusEnum-selector-{{ dataModel.recordStatus }}" required>
<mat-option *ngFor="
<!-- LinkMainImageIdSrc Column -->
<ng-container matColumnDef="LinkMainImageIdSrc">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{'TITLE.PICTURE' | translate}} </mat-header-cell>
<mat-cell *matCellDef="let row">
<img *ngIf="row?.linkMainImageIdSrc?.length>0" style="vertical-align:middle;" class="ntk-hover-zoom" aria-hidden
src="{{row.linkMainImageIdSrc | cmsthumbnail}}" height="40" width="40" />
</mat-cell>
</ng-container>
<!-- RecordStatus Field -->
<mat-form-field class="ntk-full-width">
<mat-select placeholder="{{fieldsInfo['recordStatus']?.fieldTitle}}" [(ngModel)]="dataModel.recordStatus"
name="dataModel.recordStatus" #RecordStatus="ngModel"
ngClass="cms-RecordStatusEnum-selector-{{ dataModel.recordStatus }}" required>
<mat-option *ngFor="
let item of dataModelEnumRecordStatusResult.listItems;
index as i
" [value]="item.value">{{ item.description }}</mat-option>
</mat-select>
<mat-hint align="end">{{'TITLE.SELECT_STATUS' | translate}}</mat-hint>
<mat-error *ngIf="RecordStatus.errors?.required">
RecordStatus is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- Title Field -->
<mat-form-field class="ntk-full-width">
<mat-label>{{fieldsInfo['title']?.fieldTitle}}</mat-label>
<input matInput [(ngModel)]="dataModel.title" name="dataModel.title" #Title type="text"
placeholder="{{fieldsInfo['title']?.fieldTitle}}" minlength="3" maxlength="100" required />
<mat-icon matSuffix *ngIf="dataModel.title" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.title = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
<mat-hint align="end">{{ Title.value.length }} / 100</mat-hint>
<mat-error *ngIf="Title.errors?.required">
Title is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- Description Field -->
<mat-form-field class="ntk-full-width">
<mat-label>{{fieldsInfo['description']?.fieldTitle}}</mat-label>
<textarea matInput [(ngModel)]="dataModel.description" name="dataModel.description" #Description type="text"
placeholder="{{fieldsInfo['description']?.fieldTitle}}" minlength="1" maxlength="500" rows=5></textarea>
<mat-icon matSuffix *ngIf="dataModel.description" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.description = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
<mat-hint align="end">{{ Description.value.length }} / 500</mat-hint>
<mat-error *ngIf="Description.errors?.required">
Description is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- FontIcon Field -->
<mat-form-field class="ntk-full-width">
<mat-label>{{fieldsInfo['fontIcon']?.fieldTitle}}</mat-label>
<textarea matInput [(ngModel)]="dataModel.fontIcon" name="dataModel.fontIcon" #FontIcon type="text"
placeholder="{{fieldsInfo['fontIcon']?.fieldTitle}}" minlength="1" maxlength="500" rows=5></textarea>
<mat-icon matSuffix *ngIf="dataModel.fontIcon" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.fontIcon = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
<mat-hint align="end">{{ FontIcon.value.length }} / 500</mat-hint>
<mat-error *ngIf="FontIcon.errors?.required">
FontIcon is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- LinkParentId Column -->
<ng-container matColumnDef="LinkParentId">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{fieldsInfo['linkParentId']?.fieldTitle}}
</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.linkParentId}} </mat-cell>
</ng-container>
</mat-select>
<mat-hint align="end">{{'TITLE.SELECT_STATUS' | translate}}</mat-hint>
<mat-error *ngIf="RecordStatus.errors?.required">
RecordStatus is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- Title Field -->
<mat-form-field class="ntk-full-width">
<mat-label>{{fieldsInfo['title']?.fieldTitle}}</mat-label>
<input matInput [(ngModel)]="dataModel.title" name="dataModel.title" #Title type="text"
placeholder="{{fieldsInfo['title']?.fieldTitle}}" minlength="3" maxlength="100" required />
<mat-icon matSuffix *ngIf="dataModel.title" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.title = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
<mat-hint align="end">{{ Title.value.length }} / 100</mat-hint>
<mat-error *ngIf="Title.errors?.required">
Title is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- Description Field -->
<mat-form-field class="ntk-full-width">
<mat-label>{{fieldsInfo['description']?.fieldTitle}}</mat-label>
<textarea matInput [(ngModel)]="dataModel.description" name="dataModel.description" #Description type="text"
placeholder="{{fieldsInfo['description']?.fieldTitle}}" minlength="1" maxlength="500" rows=5></textarea>
<mat-icon matSuffix *ngIf="dataModel.description" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.description = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
<mat-hint align="end">{{ Description.value.length }} / 500</mat-hint>
<mat-error *ngIf="Description.errors?.required">
Description is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>

<!-- fontIcon Field -->
<mat-form-field class="ntk-full-width" *ngIf="fieldsInfo['fontIcon']?.accessAddField">
<mat-label> {{fieldsInfo['fontIcon']?.fieldTitle}}</mat-label>
<input matInput [(ngModel)]="dataModel.fontIcon" name="dataModel.fontIcon" #fontIcon
[iconPicker]="dataModel.fontIcon" [ipIconPack]="['fa']" [ipPosition]="'top'"
(iconPickerSelect)="onIconPickerSelect($event)" type="text" [disabled]="!fieldsInfo['fontIcon']?.accessAddField"
placeholder="{{fieldsInfo['fontIcon']?.fieldTitle}}" />
<span class="input-group-addon"><i [ngClass]="dataModel.fontIcon"></i></span>
<mat-icon>{{dataModel.fontIcon}}</mat-icon>
<mat-icon matSuffix *ngIf="dataModel.fontIcon" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.fontIcon = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
</mat-form-field>


<!-- LinkMainImageId Field -->
<div class="mb-3">
<a href="{{dataModel.linkMainImageIdSrc | cmsthumbnail}}" target="_blank">
<img *ngIf="dataModel?.linkMainImageIdSrc?.length>0" style="vertical-align:middle;"
class="ntk-hover-zoom" aria-hidden src="{{dataModel.linkMainImageIdSrc | cmsthumbnail}}" height="50"
width="50" />
</a>
</div>
<div class="mb-9">
<mat-form-field class="ntk-full-width">
<mat-label (click)="fileManagerOpenForm = true"> {{'TITLE.Icon_File' | translate}}
</mat-label>
<input matInput [(ngModel)]="dataModel.linkMainImageId" name="dataModel.linkMainImageId"
#LinkMainImageId type="text" placeholder="{{'TITLE.Original_File_ID' | translate}}"
autocomplete="off" (click)="fileManagerOpenForm = true" />
<mat-icon matSuffix *ngIf="dataModel.linkMainImageId " matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.linkMainImageId = null">close</mat-icon>
<mat-icon matSuffix (click)="fileManagerOpenForm = true">mode_edit</mat-icon>
</mat-form-field>
<cms-file-manager (itemSelected)="onActionFileSelected($event)" [language]="appLanguage" [isPopup]="true"
[(openForm)]="fileManagerOpenForm" [tree]="fileManagerTree" [openFilemanagerButtonLabelKey]="'select'"
[openDirectUploadView]="true" [selectFileType]="selectFileTypeMainImage"
[openFilemanagerButtonView]="false">
</cms-file-manager>
</div>
<!--end:::::::::::::::::::::::::::::::::::::::::cms-body-->
<!-- LinkParentId Column -->
<ng-container matColumnDef="LinkParentId">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{fieldsInfo['linkParentId']?.fieldTitle}}
</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.linkParentId}} </mat-cell>
</ng-container>

<!-- LinkMainImageId Field -->
<div class="mb-3">
<a href="{{dataModel.linkMainImageIdSrc | cmsthumbnail}}" target="_blank">
<img *ngIf="dataModel?.linkMainImageIdSrc?.length>0" style="vertical-align:middle;" class="ntk-hover-zoom"
aria-hidden src="{{dataModel.linkMainImageIdSrc | cmsthumbnail}}" height="50" width="50" />
</a>
</div>
<div class="mb-9">
<mat-form-field class="ntk-full-width">
<mat-label (click)="fileManagerOpenForm = true"> {{'TITLE.Icon_File' | translate}}
</mat-label>
<input matInput [(ngModel)]="dataModel.linkMainImageId" name="dataModel.linkMainImageId" #LinkMainImageId
type="text" placeholder="{{'TITLE.Original_File_ID' | translate}}" autocomplete="off"
(click)="fileManagerOpenForm = true" />
<mat-icon matSuffix *ngIf="dataModel.linkMainImageId " matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.linkMainImageId = null">close</mat-icon>
<mat-icon matSuffix (click)="fileManagerOpenForm = true">mode_edit</mat-icon>
</mat-form-field>
<cms-file-manager (itemSelected)="onActionFileSelected($event)" [language]="appLanguage" [isPopup]="true"
[(openForm)]="fileManagerOpenForm" [tree]="fileManagerTree" [openFilemanagerButtonLabelKey]="'select'"
[openDirectUploadView]="true" [selectFileType]="selectFileTypeMainImage" [openFilemanagerButtonView]="false">
</cms-file-manager>
</div>
<div class="ntk-cms-html-card-message">
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-message-->
<div class="form-actions">
<small class="form-text text-muted">{{ formInfo.formAlert }} </small>
<small class="form-text text-muted danger">{{ formInfo.formError }}
</small>
</div>
<!--end:::::::::::::::::::::::::::::::::::::::::cms-message-->
<!--end:::::::::::::::::::::::::::::::::::::::::cms-body-->
</div>
<div class="ntk-cms-html-card-message">
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-message-->
<div class="form-actions">
<small class="form-text text-muted">{{ formInfo.formAlert }} </small>
<small class="form-text text-muted danger">{{ formInfo.formError }}
</small>
</div>
<div class="ntk-cms-html-card-footer">
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-footer-->
<div class="form-actions" *ngIf="formInfo.formSubmitAllow && !loading?.display">
<button type="button" (click)="onFormCancel()" class="btn btn-light">
<i class="ft-x"></i> {{'ACTION.CANCEL' | translate}}
</button>
<button type="submit" mat-raised-button (click)="onFormSubmit()" [disabled]="!vform.form.valid">
<i class="fa fa-check-square-o"></i> {{'ACTION.SAVE' | translate}}
</button>
</div>
<!--end:::::::::::::::::::::::::::::::::::::::::cms-footer-->
<!--end:::::::::::::::::::::::::::::::::::::::::cms-message-->
</div>
<div class="ntk-cms-html-card-footer">
<!--begin:::::::::::::::::::::::::::::::::::::::::cms-footer-->
<div class="form-actions" *ngIf="formInfo.formSubmitAllow && !loading?.display">
<button type="button" (click)="onFormCancel()" class="btn btn-light">
<i class="ft-x"></i> {{'ACTION.CANCEL' | translate}}
</button>
<button type="submit" mat-raised-button (click)="onFormSubmit()" [disabled]="!vform.form.valid">
<i class="fa fa-check-square-o"></i> {{'ACTION.SAVE' | translate}}
</button>
</div>
<!--end:::::::::::::::::::::::::::::::::::::::::cms-footer-->
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export class DataProviderPlanCategoryAddComponent implements OnInit {
}
);
}
onIconPickerSelect(model: any): void {
this.dataModel.fontIcon = model;
}
onFormSubmit(): void {
if (!this.formGroup.valid) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@
Description is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- FontIcon Field -->
<mat-form-field class="ntk-full-width">
<mat-label>{{fieldsInfo['fontIcon']?.fieldTitle}}</mat-label>
<textarea matInput [(ngModel)]="dataModel.fontIcon" name="dataModel.fontIcon" #FontIcon type="text"
placeholder="{{fieldsInfo['fontIcon']?.fieldTitle}}" minlength="1" maxlength="500" rows=5></textarea>
<mat-icon matSuffix *ngIf="dataModel.fontIcon" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.fontIcon = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
<mat-hint align="end">{{ FontIcon.value.length }} / 500</mat-hint>
<mat-error *ngIf="FontIcon.errors?.required">
FontIcon is <strong>{{'MESSAGE.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<!-- fontIcon Field -->
<mat-form-field class="ntk-full-width" *ngIf="fieldsInfo['fontIcon']?.accessWatchField">
<mat-label> {{fieldsInfo['fontIcon']?.fieldTitle}}</mat-label>
<input matInput [(ngModel)]="dataModel.fontIcon" name="dataModel.fontIcon" #fontIcon
[iconPicker]="dataModel.fontIcon" [ipIconPack]="['fa']" [ipPosition]="'top'"
(iconPickerSelect)="onIconPickerSelect($event)" type="text"
[disabled]="!fieldsInfo['fontIcon']?.accessEditField" placeholder="{{fieldsInfo['fontIcon']?.fieldTitle}}" />
<span class="input-group-addon"><i [ngClass]="dataModel.fontIcon"></i></span>
<mat-icon>{{dataModel.fontIcon}}</mat-icon>
<mat-icon matSuffix *ngIf="dataModel.fontIcon" matSuffix mat-icon-button aria-label="Clear"
(click)="dataModel.fontIcon = ''">close</mat-icon>
<mat-icon matSuffix>mode_edit</mat-icon>
</mat-form-field>
<!-- LinkParentId Column -->
<ng-container matColumnDef="LinkParentId">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{fieldsInfo['linkParentId']?.fieldTitle}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ export class DataProviderPlanCategoryEditComponent implements OnInit {
}
);
}
onIconPickerSelect(model: any): void {
this.dataModel.fontIcon = model;
}
onFormSubmit(): void {
if (!this.formGroup.valid) {
return;
Expand Down
Loading

0 comments on commit ebc30ee

Please sign in to comment.