Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,11 @@ <h2 class="page-title">Organization Details</h2>
</mat-error>
</mat-form-field>

<mat-form-field appearance="outline" class="full-width">
<mat-form-field appearance="outline" class="full-width timezone-field">
<mat-label>Timezone</mat-label>
<mat-select
formControlName="timeZoneName"
placeholder="Select timezone"
disableOptionCentering
[panelClass]="theme === 'dark' ? 'org-dark-select-panel' : 'org-light-select-panel'"
>
<mat-option *ngFor="let tz of timezones" [value]="getTimezoneValue(tz)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
height: 100vh;
width: 100%;
z-index: 10;
max-width: 2000px;
background: transparent;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice you've removed the max-width: 2000px property from the container class. Was this intentional? Removing this constraint might cause layout issues on very large screens where content could stretch too wide.

}

Expand Down Expand Up @@ -229,6 +228,31 @@
background: #1976d2;
color: #ffffff;
}

// Disabled mat-form-field (e.g. Timezone when not editing)
.mat-form-field-disabled.timezone-field,
.mat-form-field .mdc-text-field--disabled {
opacity: 0.7;

.mat-select-value,
.mat-select-value-text,
.mat-input-element,
mat-label,
.mat-form-field-label {
color: rgba(0, 0, 0, 0.38) !important;
}
.mat-select-arrow,
.mat-select-arrow svg {
color: rgba(0, 0, 0, 0.38) !important;
fill: rgba(0, 0, 0, 0.38) !important;
}
.mdc-notched-outline__leading,
.mdc-notched-outline__notch,
.mdc-notched-outline__trailing,
.mat-form-field-outline {
border-color: rgba(0, 0, 0, 0.12) !important;
}
}
}

// ── Dark theme ────────────────────────────────────────────────────────
Expand Down Expand Up @@ -358,6 +382,31 @@
.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing {
border-color: rgba(255, 255, 255, 0.3) !important;
}

// Disabled mat-form-field (e.g. Timezone when not editing)
.mat-form-field-disabled.timezone-field,
.mat-form-field .mdc-text-field--disabled {
opacity: 0.7;

.mat-select-value,
.mat-select-value-text,
.mat-select-value-text span,
.mat-input-element,
mat-label,
.mat-form-field-label {
color: rgba(255, 255, 255, 0.38) !important;
}
.mat-select-arrow,
.mat-select-arrow svg {
color: rgba(255, 255, 255, 0.38) !important;
fill: rgba(255, 255, 255, 0.38) !important;
}
.mdc-notched-outline__leading,
.mdc-notched-outline__notch,
.mdc-notched-outline__trailing {
border-color: rgba(255, 255, 255, 0.12) !important;
}
}
}

// ── Snackbars ─────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class OrganizationDetailsComponent extends BaseComponent implements OnIni
}

ngOnInit(): void {
this.organizationForm.get('timeZoneName')?.disable();
if (this.authToken) {
this.otpService
.getOrganizationDetails(this.authToken)
Expand Down Expand Up @@ -134,7 +135,7 @@ export class OrganizationDetailsComponent extends BaseComponent implements OnIni
return;
}

const organizationDetails = this.organizationForm.value;
const organizationDetails = this.organizationForm.getRawValue();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change from organizationForm.value to organizationForm.getRawValue() to include the disabled timeZoneName field. Consider adding a comment explaining why getRawValue() is needed here to help future developers understand the reasoning.

const current = {
companyName: organizationDetails.companyName ?? '',
email: organizationDetails.email ?? '',
Expand Down Expand Up @@ -173,21 +174,21 @@ export class OrganizationDetailsComponent extends BaseComponent implements OnIni
next: (res) => {
this.initialFormValue = { ...current };
this.isEditing = false; // ← close edit mode on success
this.snackBar.open(res?.data?.message ?? 'Information successfully updated', '✕', {
duration: 3000,
horizontalPosition: 'center',
verticalPosition: 'top',
panelClass: ['success-snackbar'],
});
// this.snackBar.open(res?.data?.message ?? 'Information successfully updated', '✕', {
// duration: 3000,
// horizontalPosition: 'center',
// verticalPosition: 'top',
// panelClass: ['success-snackbar'],
// });
Comment on lines +177 to +182
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All snackbar notifications have been commented out. Without these notifications, users won't receive any feedback when their organization details are updated successfully or when an error occurs. Consider keeping these notifications or replacing them with an alternative feedback mechanism.

},
error: () => {
// Stay in edit mode so user can retry
this.snackBar.open('Something went wrong', '✕', {
duration: 3000,
horizontalPosition: 'center',
verticalPosition: 'top',
panelClass: ['error-snackbar'],
});
// this.snackBar.open('Something went wrong', '✕', {
// duration: 3000,
// horizontalPosition: 'center',
// verticalPosition: 'top',
// panelClass: ['error-snackbar'],
// });
},
});
}
Expand Down
Loading