From ed9850939df7f256bef11bc1936a84bd7e60c2ce Mon Sep 17 00:00:00 2001 From: Devansh Vashisht Date: Thu, 30 Oct 2025 01:46:25 +0530 Subject: [PATCH] git commit -m "WEB-355 Alignments of buttons and input boxes blemished in create-edit-template.component.html" --- .../create-edit-template.component.html | 211 +++++++++--------- .../create-edit-template.component.scss | 49 ++++ .../create-edit-template.component.ts | 39 ++++ 3 files changed, 198 insertions(+), 101 deletions(-) diff --git a/src/app/templates/create-edit-template/create-edit-template.component.html b/src/app/templates/create-edit-template/create-edit-template.component.html index 287d3ca9c..a13e811ee 100644 --- a/src/app/templates/create-edit-template/create-edit-template.component.html +++ b/src/app/templates/create-edit-template/create-edit-template.component.html @@ -6,7 +6,7 @@ {{ 'labels.inputs.Entity' | translate }} - + {{ entity.name }} @@ -19,7 +19,7 @@ {{ 'labels.inputs.Type' | translate }} - + {{ type.name }} @@ -41,114 +41,123 @@ -
- -
- - -
- - {{ 'labels.inputs.Mapper Key' | translate }} - - - - - {{ 'labels.inputs.Mapper Value' | translate }} - - - - -
-
-
- - -
+ +
+ + {{ 'labels.inputs.Mapper Key' | translate }} + + -
- - - - - {{ 'labels.inputs.Client Parameters' | translate }} - - + + {{ 'labels.inputs.Mapper Value' | translate }} + + -
- -
-
+ + +
+ + - - - - {{ 'labels.inputs.Loan Parameters' | translate }} - - + +
+ + +
+
-
- -
-
+ +
+ + + + + {{ 'labels.inputs.Client Parameters' | translate }} + + - - - - {{ 'labels.inputs.Repayment Schedule Parameters' | translate }} - - +
+ +
+
-
- -
-
-
-
+ + + + {{ 'labels.inputs.Loan Parameters' | translate }} + + + +
+ +
+
+ + + + + {{ 'labels.inputs.Repayment Schedule Parameters' | translate }} + + + +
+ +
+
+ +
+ diff --git a/src/app/templates/create-edit-template/create-edit-template.component.scss b/src/app/templates/create-edit-template/create-edit-template.component.scss index e69de29bb..506a5d481 100644 --- a/src/app/templates/create-edit-template/create-edit-template.component.scss +++ b/src/app/templates/create-edit-template/create-edit-template.component.scss @@ -0,0 +1,49 @@ +// Advanced Options button wrapper - aligns with Name field above +.advanced-options-wrapper { + margin-bottom: 16px; +} + +// Mapper row styling - adds space between Advanced Options button and Mapper Key field +.mapper-row { + margin-top: 16px; + margin-bottom: 8px; + + // Ensure buttons don't touch the right border + .mapper-button { + margin-left: 8px; + } +} + +// Editor wrapper - prevents CKEditor from touching borders on left and right +.editor-wrapper { + margin-top: 16px; + + .required-label { + display: block; + margin-bottom: 8px; + font-size: 14px; + font-weight: 500; + } + + .required-asterisk { + color: #f44336; + } + + // CKEditor container spacing + ::ng-deep { + .ck-editor { + margin: 0; + + .ck-editor__main { + .ck-content { + min-height: 200px; + } + } + } + } +} + +// Ensure mat-card-content has consistent padding +mat-card-content { + padding: 16px; +} diff --git a/src/app/templates/create-edit-template/create-edit-template.component.ts b/src/app/templates/create-edit-template/create-edit-template.component.ts index 59a56c0e2..bfc1b0e80 100644 --- a/src/app/templates/create-edit-template/create-edit-template.component.ts +++ b/src/app/templates/create-edit-template/create-edit-template.component.ts @@ -259,4 +259,43 @@ export class CreateEditComponent implements OnInit { }); } } + + /** + * TrackBy function for mappers array to improve ngFor performance. + * @param {number} index Index of the item + * @returns {number} Index as unique identifier + */ + trackByMapperIndex(index: number): number { + return index; + } + + /** + * TrackBy function for parameter labels to improve ngFor performance. + * @param {number} index Index of the item + * @param {string} label Label string + * @returns {string} Label as unique identifier + */ + trackByLabel(index: number, label: string): string { + return label; + } + + /** + * TrackBy function for entities dropdown to improve ngFor performance. + * @param {number} index Index of the item + * @param {any} entity Entity object + * @returns {number} Entity ID as unique identifier + */ + trackByEntityId(index: number, entity: any): number { + return entity.id; + } + + /** + * TrackBy function for types dropdown to improve ngFor performance. + * @param {number} index Index of the item + * @param {any} type Type object + * @returns {number} Type ID as unique identifier + */ + trackByTypeId(index: number, type: any): number { + return type.id; + } }