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 @@ -230,29 +230,29 @@
}

// 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;
}
}
// .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;
// }
// }
Comment on lines +233 to +255
Copy link

Choose a reason for hiding this comment

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

The disabled form field styles are being commented out in both light and dark themes. If these styles aren't being replaced elsewhere, this could cause accessibility issues as users may not be able to visually distinguish between enabled and disabled form fields. Consider either keeping these styles or providing alternative styling for disabled fields.

}

// ── Dark theme ────────────────────────────────────────────────────────
Expand Down Expand Up @@ -384,29 +384,29 @@
}

// 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;
}
}
// .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,7 +50,7 @@ export class OrganizationDetailsComponent extends BaseComponent implements OnIni
}

ngOnInit(): void {
this.organizationForm.get('timeZoneName')?.disable();
// this.organizationForm.get('timeZoneName')?.disable();
Copy link

Choose a reason for hiding this comment

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

Uncommenting this line makes the 'timeZoneName' field directly editable by users, which could lead to inconsistencies with the 'timezone' field. The component has logic that updates 'timezone' based on 'timeZoneName' changes, but not vice versa. If users can directly edit 'timeZoneName', they might enter values that don't correspond to any valid timezone offset.

Consider either:

  1. Keeping the field disabled as it was before
  2. Adding validation to ensure 'timeZoneName' always corresponds to a valid timezone
  3. Implementing two-way synchronization between 'timezone' and 'timeZoneName'

if (this.authToken) {
this.otpService
.getOrganizationDetails(this.authToken)
Expand Down
3 changes: 3 additions & 0 deletions apps/proxy-auth/src/app/otp/otp.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import { SubscriptionCenterComponent } from './component/subscription-center/sub
import { MatDialogModule } from '@angular/material/dialog';
import { UiConfirmDialogModule } from '@proxy/ui/confirm-dialog';
import { OrganizationDetailsComponent } from './organization-details/organization-details.component';
import { OverlayContainer } from '@angular/cdk/overlay';
import { ShadowDomOverlayContainer } from '../shadow-dom-overlay-container';

export const CHAT_COMPONENTS: any[] = [
SendOtpComponent,
Expand Down Expand Up @@ -106,6 +108,7 @@ export const CHAT_COMPONENTS: any[] = [
OtpService,
OtpUtilityService,
OtpWidgetService,
{ provide: OverlayContainer, useClass: ShadowDomOverlayContainer },
{ provide: ProxyBaseUrls.Env, useValue: environment.env },
{
provide: ProxyBaseUrls.BaseURL,
Expand Down
56 changes: 56 additions & 0 deletions apps/proxy-auth/src/app/shadow-dom-overlay-container.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { DOCUMENT } from '@angular/common';
import { Inject, Injectable } from '@angular/core';
import { OverlayContainer } from '@angular/cdk/overlay';
import { Platform } from '@angular/cdk/platform';

const CONTAINER_CLASS = 'cdk-overlay-container';
/** Full-viewport overlay container style so positioning is viewport-based when in shadow root */
const OVERLAY_CONTAINER_STYLE =
'position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;pointer-events:none!important;z-index:1000!important;';
/**
* OverlayContainer that:
* - When proxy-auth with shadow root exists (script load): attaches the overlay as the
* **first** child of the shadow root with full-viewport fixed style, so it is NOT
* inside the fixed .container and positioning is correct (dropdown below the right field).
* - Otherwise: attaches to document.body (default behaviour).
*/
@Injectable()
export class ShadowDomOverlayContainer extends OverlayContainer {
constructor(@Inject(DOCUMENT) document: Document, _platform: Platform) {
super(document, _platform);
}

protected override _createContainer(): void {
if (!this._platform.isBrowser) {
return;
}

const container = this._document.createElement('div');
container.classList.add(CONTAINER_CLASS);

const parent = this._getOverlayParent();
if (parent !== this._document.body) {
container.setAttribute('style', OVERLAY_CONTAINER_STYLE);
const first = parent.firstChild;
if (first) {
parent.insertBefore(container, first);
} else {
parent.appendChild(container);
}
} else {
parent.appendChild(container);
}
this._containerElement = container;
}

private _getOverlayParent(): HTMLElement {
const host =
(this._document.querySelector('proxy-auth:not([data-master])') as HTMLElement | null) ??
(this._document.querySelector('proxy-auth') as HTMLElement | null);

if (host?.shadowRoot) {
return host.shadowRoot as unknown as HTMLElement;
}
return this._document.body;
}
}
Loading