feat: redesign all dialogs, file upload, address/nominee/identifier tabs

- File upload: compact dashed zone (54px height), inline icon+filename+change
- Dialogs: no scroll, rounded close button (red on hover), 700px width
- Identifier dialog: 2-column grid, section divider, outline fields
- Nominee: new NomineeDialogComponent popup (replaces page navigation)
- Address tab: card panels, status badges, 3-column grid
- Nominee tab: accordion with badges, 3-column grid
- Shared form dialog: outline fields, fixed close button

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aditya
2026-03-21 00:09:59 +05:30
co-authored by Claude Opus 4.6
parent b7f612c2f6
commit 97f30ac3c1
17 changed files with 1589 additions and 281 deletions
@@ -6,74 +6,111 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<div class="tab-container mat-typography">
<div class="layout-row align-start">
<div class="m-b-10">
<h3>{{ 'labels.heading.Address' | translate }}</h3>
</div>
<div class="action-button m-b-10 gap-25px">
<button mat-raised-button color="primary" (click)="addAddress()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
<div class="addr-container mat-typography">
<!-- Header -->
<div class="addr-header">
<div class="addr-header__left">
<i class="fa fa-map-marker addr-header__icon"></i>
<h3 class="addr-header__title">{{ 'labels.heading.Address' | translate }}</h3>
<span class="addr-header__badge">{{ clientAddressData?.length || 0 }}</span>
</div>
<button mat-flat-button color="primary" class="addr-header__btn" (click)="addAddress()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</div>
<mat-accordion>
<!-- Address Cards -->
@if (!clientAddressData || clientAddressData.length === 0) {
<div class="addr-empty">
<i class="fa fa-map-o addr-empty__icon"></i>
<p class="addr-empty__text">No addresses added yet</p>
</div>
}
<mat-accordion multi>
@for (address of clientAddressData; track address.addressId; let i = $index) {
<mat-expansion-panel class="address">
<mat-expansion-panel-header>
<mat-panel-title>
{{ address.addressType }}
<mat-expansion-panel class="addr-panel">
<mat-expansion-panel-header class="addr-panel__header">
<mat-panel-title class="addr-panel__title">
<i class="fa fa-home addr-panel__type-icon"></i>
<span class="addr-panel__type">{{ address.addressType }}</span>
<span class="addr-panel__status" [class.addr-panel__status--active]="address.isActive" [class.addr-panel__status--inactive]="!address.isActive">
{{ address.isActive ? 'Active' : 'Inactive' }}
</span>
</mat-panel-title>
<mat-panel-description>
{{ address.relationship }}
<mat-panel-description class="addr-panel__desc">
{{ address.city || address.townVillage || '' }}{{ address.city || address.townVillage ? ', ' : '' }}{{ getSelectedValue('stateProvinceIdOptions', address.stateProvinceId)?.name || '' }}
</mat-panel-description>
</mat-expansion-panel-header>
<mat-divider [inset]="true"></mat-divider>
<div class="address-actions layout-row align-end align-items-center">
<button mat-button color="primary" (click)="editAddress(address, i)">
<fa-icon icon="edit"></fa-icon>
<!-- Actions Bar -->
<div class="addr-actions">
<button mat-stroked-button color="primary" class="addr-actions__edit" (click)="editAddress(address, i)">
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{ 'labels.buttons.Edit' | translate }}
</button>
<mat-slide-toggle [checked]="address.isActive" (change)="toggleAddress(address)"></mat-slide-toggle>
<div class="addr-actions__toggle">
<span class="addr-actions__toggle-label">{{ 'labels.inputs.Active Status' | translate }}</span>
<mat-slide-toggle [checked]="address.isActive" (change)="toggleAddress(address)"></mat-slide-toggle>
</div>
</div>
<p>
@if (isFieldEnabled('street')) {
<span>{{ 'labels.inputs.Street' | translate }} : {{ address.street }}<br /></span>
<!-- Address Details Grid -->
<div class="addr-grid">
@if (isFieldEnabled('street') && address.street) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Street' | translate }}</div>
<div class="addr-field__value">{{ address.street }}</div>
</div>
}
@if (isFieldEnabled('addressLine1')) {
<span>{{ 'labels.inputs.Address Line' | translate }} 1 : {{ address.addressLine1 }}<br /></span>
@if (isFieldEnabled('addressLine1') && address.addressLine1) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Address Line' | translate }} 1</div>
<div class="addr-field__value">{{ address.addressLine1 }}</div>
</div>
}
@if (isFieldEnabled('addressLine2')) {
<span>{{ 'labels.inputs.Address Line' | translate }} 2 : {{ address.addressLine2 }}<br /></span>
@if (isFieldEnabled('addressLine2') && address.addressLine2) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Address Line' | translate }} 2</div>
<div class="addr-field__value">{{ address.addressLine2 }}</div>
</div>
}
@if (isFieldEnabled('addressLine3')) {
<span>{{ 'labels.inputs.Address Line' | translate }} 3 : {{ address.addressLine3 }}<br /></span>
@if (isFieldEnabled('addressLine3') && address.addressLine3) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Address Line' | translate }} 3</div>
<div class="addr-field__value">{{ address.addressLine3 }}</div>
</div>
}
@if (isFieldEnabled('townVillage')) {
<span>{{ 'labels.inputs.Town / Village' | translate }} : {{ address.townVillage }}<br /></span>
@if (isFieldEnabled('townVillage') && address.townVillage) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Town / Village' | translate }}</div>
<div class="addr-field__value">{{ address.townVillage }}</div>
</div>
}
@if (isFieldEnabled('city')) {
<span>{{ 'labels.inputs.City' | translate }} : {{ address.city }}<br /></span>
@if (isFieldEnabled('city') && address.city) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.City' | translate }}</div>
<div class="addr-field__value">{{ address.city }}</div>
</div>
}
@if (isFieldEnabled('stateProvinceId')) {
<span
>{{ 'labels.inputs.State / Province' | translate }} :
{{ getSelectedValue('stateProvinceIdOptions', address.stateProvinceId)?.name }}<br
/></span>
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.State / Province' | translate }}</div>
<div class="addr-field__value">{{ getSelectedValue('stateProvinceIdOptions', address.stateProvinceId)?.name || '-' }}</div>
</div>
}
@if (isFieldEnabled('countryId')) {
<span
>{{ 'labels.inputs.Country' | translate }} :
{{ getSelectedValue('countryIdOptions', address.countryId)?.name }}<br
/></span>
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Country' | translate }}</div>
<div class="addr-field__value">{{ getSelectedValue('countryIdOptions', address.countryId)?.name || '-' }}</div>
</div>
}
@if (isFieldEnabled('postalCode')) {
<span>{{ 'labels.inputs.Postal Code' | translate }} : {{ address.postalCode }}<br /></span>
@if (isFieldEnabled('postalCode') && address.postalCode) {
<div class="addr-field">
<div class="addr-field__label">{{ 'labels.inputs.Postal Code' | translate }}</div>
<div class="addr-field__value addr-field__value--mono">{{ address.postalCode }}</div>
</div>
}
@if (isFieldEnabled('isActive')) {
<span>{{ 'labels.inputs.Active Status' | translate }} : {{ address.isActive }}<br /></span>
}
</p>
</div>
</mat-expansion-panel>
}
</mat-accordion>
@@ -6,30 +6,236 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
.tab-container {
padding: 1%;
margin: 1%;
$primary: #1a73e8;
$primary-light: #e8f0fe;
$gray-50: #f8f9fa;
$gray-100: #f1f3f4;
$gray-200: #e8eaed;
$gray-500: #9aa0a6;
$gray-700: #5f6368;
$gray-900: #202124;
$white: #fff;
$green: #34a853;
$green-light: #e6f4ea;
$red: #ea4335;
$red-light: #fce8e6;
.action-button {
margin-left: auto;
.addr-container {
padding: 20px 24px;
}
// Header
.addr-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
&__left {
display: flex;
align-items: center;
gap: 10px;
}
.address {
.address-actions {
margin-top: 1%;
&__icon {
font-size: 18px;
color: $primary;
}
button {
margin-right: 1%;
}
&__title {
margin: 0;
font-size: 16px;
font-weight: 600;
color: $gray-900;
}
&__badge {
background: $primary-light;
color: $primary;
font-size: 11px;
font-weight: 700;
padding: 2px 8px;
border-radius: 10px;
}
&__btn {
border-radius: 8px !important;
font-size: 13px !important;
font-weight: 600 !important;
height: 36px !important;
}
}
// Empty state
.addr-empty {
text-align: center;
padding: 48px 20px;
background: $gray-50;
border-radius: 10px;
border: 1px dashed $gray-200;
&__icon {
font-size: 36px;
color: $gray-500;
margin-bottom: 10px;
}
&__text {
color: $gray-500;
font-size: 14px;
margin: 0;
}
}
// Expansion panels
.addr-panel {
margin-bottom: 12px !important;
border-radius: 10px !important;
border: 1px solid $gray-200 !important;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
&::ng-deep .mat-expansion-panel-body {
padding: 0 20px 20px !important;
}
&__header {
height: auto !important;
min-height: 56px !important;
padding: 8px 20px !important;
}
&__title {
display: flex !important;
align-items: center;
gap: 10px;
flex: 1;
}
&__type-icon {
font-size: 16px;
color: $primary;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
background: $primary-light;
border-radius: 6px;
}
&__type {
font-size: 14px;
font-weight: 600;
color: $gray-900;
text-transform: uppercase;
letter-spacing: 0.3px;
}
&__status {
font-size: 11px;
font-weight: 600;
padding: 2px 10px;
border-radius: 10px;
&--active {
background: $green-light;
color: $green;
}
h3 {
margin: 1% auto;
&--inactive {
background: $red-light;
color: $red;
}
}
p {
line-height: 30px;
margin-left: 2%;
&__desc {
font-size: 12px;
color: $gray-500 !important;
flex: 0 !important;
white-space: nowrap;
}
}
// Actions bar inside panel
.addr-actions {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 0;
margin-bottom: 12px;
border-bottom: 1px solid $gray-100;
&__edit {
border-radius: 6px !important;
font-size: 12px !important;
font-weight: 600 !important;
height: 32px !important;
}
&__toggle {
display: flex;
align-items: center;
gap: 8px;
}
&__toggle-label {
font-size: 12px;
color: $gray-500;
font-weight: 500;
}
}
// Address details grid
.addr-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0;
border: 1px solid $gray-100;
border-radius: 8px;
overflow: hidden;
@media (max-width: 768px) {
grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 480px) {
grid-template-columns: 1fr;
}
}
.addr-field {
padding: 10px 14px;
border-bottom: 1px solid $gray-100;
border-right: 1px solid $gray-100;
transition: background 0.15s ease;
&:hover {
background: $gray-50;
}
&:nth-child(3n) {
border-right: none;
}
&__label {
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: $gray-500;
margin-bottom: 3px;
}
&__value {
font-size: 13.5px;
font-weight: 500;
color: $gray-900;
word-break: break-word;
&--mono {
font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
font-size: 13px;
letter-spacing: 0.5px;
}
}
}
@@ -94,7 +94,8 @@ export class AddressTabComponent {
this.translateService.instant('labels.catalogs.Client') +
' ' +
this.translateService.instant('labels.heading.Address'),
formfields: this.getAddressFormFields('add')
formfields: this.getAddressFormFields('add'),
layout: { columns: 2, columnWidth: 350 }
};
const addAddressDialogRef = this.dialog.open(FormDialogComponent, { data });
addAddressDialogRef.afterClosed().subscribe((response: any) => {
@@ -126,7 +127,7 @@ export class AddressTabComponent {
' ' +
this.translateService.instant('labels.heading.Address'),
formfields: this.getAddressFormFields('edit', address),
layout: { addButtonText: 'Edit' }
layout: { columns: 2, columnWidth: 350, addButtonText: 'Edit' }
};
const editAddressDialogRef = this.dialog.open(FormDialogComponent, { data });
editAddressDialogRef.afterClosed().subscribe((response: any) => {