Skip to content

Commit

Permalink
MOSIP-19629 using active routes instead of window
Browse files Browse the repository at this point in the history
Signed-off-by: MadhuMosip <[email protected]>
  • Loading branch information
MadhuMosip committed Feb 14, 2024
1 parent e806207 commit 70ca3c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ <h3>{{ "center.location-details" | translate }}</h3>
</mat-form-field>
</div>
<mat-card-actions class="action-buttons">
<button [disabled]="!primaryForm.dirty" id="createButton" mat-raised-button *ngIf="isEditable === 'editable'" (click)="submitPrimaryPanel()">
<button [disabled]="!primaryForm.dirty" id="createButton" mat-raised-button *ngIf="isEditable['editable']" (click)="submitPrimaryPanel()">
{{ "center.update" | translate }}
</button>
<button [disabled]="!primaryForm.dirty" id="createButton" mat-raised-button *ngIf="isEditable === 'langCode'" (click)="submitPrimaryPanel()">
<button [disabled]="!primaryForm.dirty" id="createButton" mat-raised-button *ngIf="isEditable['langCode']" (click)="submitPrimaryPanel()">
{{ "center.create" | translate }}
</button>
<button mat-raised-button id="cancel" (click)="cancel()" *ngIf="secondaryLang">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class EditComponent {
dynamicFieldValue = {};
showSpinner = false;
showUpdateButton = null;
isEditable:string;
isEditable:any;
constructor(
private location: Location,
private translateService: TranslateService,
Expand Down Expand Up @@ -227,7 +227,10 @@ export class EditComponent {
this.filteredLanguages = this.supportedLanguages;
this.getPrimaryPanelData(this.primaryLang);
});
this.isEditable = window.location.href.split('?')[1].split('=')[0];

this.activatedRoute.queryParams.subscribe(params => {
this.isEditable = params
});
}

setLocaleForDatePicker = (localeId) => {
Expand Down

0 comments on commit 70ca3c8

Please sign in to comment.