Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# #790

Merged
merged 1 commit into from
Oct 7, 2022
Merged

# #790

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 @@ -32,17 +32,17 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<li
*ngIf="submitted && (formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
*ngIf="submitted && pageAccessMode != 'edit' && (formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
<a href="javascript:;" onClick="return false;" (click)="setFocus('start-day')">Enter start
date</a>
</li>
<li
*ngIf="submitted && StartDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
*ngIf="submitted && pageAccessMode != 'edit' && StartDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
<a href="javascript:;" onClick="return false;" (click)="setFocus('start-day')">Enter valid
start date</a>
</li>
<li
*ngIf="submitted && PastDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
*ngIf="submitted && pageAccessMode != 'edit' && PastDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
<a href="javascript:;" onClick="return false;" (click)="setFocus('start-day')">The start
date cannot be in the past</a>
</li>
Expand Down Expand Up @@ -115,7 +115,7 @@ <h2 class="govuk-label-wrapper">
<!-- start date -->
<form [formGroup]="formGroup" (submit)="onSubmit(formGroup)">
<div class="govuk-form-group"
[class.govuk-form-group--error]="submitted && (StartDateValidation || PastDateValidation || formGroup.controls.startday.invalid || formGroup.controls.startmonth.invalid || formGroup.controls.startyear.invalid)">
[class.govuk-form-group--error]="submitted && pageAccessMode != 'edit' && (StartDateValidation || PastDateValidation || formGroup.controls.startday.invalid || formGroup.controls.startmonth.invalid || formGroup.controls.startyear.invalid)">
<fieldset class="govuk-fieldset" role="group" aria-describedby="start-hint">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading govuk-!-font-size-24">
Expand All @@ -128,17 +128,17 @@ <h1 class="govuk-fieldset__heading govuk-!-font-size-24">
</div>
<div class="govuk-date-input" id="start">
<span id="name-error" class="govuk-error-message"
*ngIf="submitted && (formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
*ngIf="submitted && pageAccessMode != 'edit' && (formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
<span class="govuk-visually-hidden">{{ 'ERROR_PREFIX' | translate
}}</span> Enter start date
</span>
<span id="name-error" class="govuk-error-message"
*ngIf="submitted && StartDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
*ngIf="submitted && pageAccessMode != 'edit' && StartDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
<span class="govuk-visually-hidden">{{ 'ERROR_PREFIX' | translate
}}</span> Enter valid start date
</span>
<span id="name-error" class="govuk-error-message"
*ngIf="submitted && PastDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
*ngIf="submitted && pageAccessMode != 'edit' && PastDateValidation && !(formGroup.controls.startday.hasError('required') || formGroup.controls.startmonth.hasError('required') || formGroup.controls.startyear.hasError('required'))">
<span class="govuk-visually-hidden">{{ 'ERROR_PREFIX' | translate
}}</span> The start date cannot be in the past
</span>
Expand All @@ -149,7 +149,7 @@ <h1 class="govuk-fieldset__heading govuk-!-font-size-24">
</label>
<input class="govuk-input govuk-date-input__input govuk-input--width-2"
id="start-day" name="start-day" type="text"
[class.govuk-input--error]="submitted && (formGroup.controls.startday.invalid || StartDateValidation || PastDateValidation)"
[class.govuk-input--error]="submitted && pageAccessMode != 'edit' && (formGroup.controls.startday.invalid || StartDateValidation || PastDateValidation)"
inputmode="numeric" formControlName="startday" maxlength="2"
(input)="ValueChanged(formGroup.controls.startday.value,'start-day','startdate')">
</div>
Expand All @@ -161,7 +161,7 @@ <h1 class="govuk-fieldset__heading govuk-!-font-size-24">
</label>
<input class="govuk-input govuk-date-input__input govuk-input--width-2"
id="start-month" name="start-month" type="text"
[class.govuk-input--error]="submitted && (formGroup.controls.startmonth.invalid || StartDateValidation || PastDateValidation)"
[class.govuk-input--error]="submitted && pageAccessMode != 'edit' && (formGroup.controls.startmonth.invalid || StartDateValidation || PastDateValidation)"
(keydown.backspace)="tiggerBackspace(formGroup.controls.startmonth.value,'start-month','startdate')"
inputmode="numeric" formControlName="startmonth" maxlength="2"
(input)="ValueChanged(formGroup.controls.startmonth.value,'start-month','startdate')">
Expand All @@ -174,7 +174,7 @@ <h1 class="govuk-fieldset__heading govuk-!-font-size-24">
</label>
<input class="govuk-input govuk-date-input__input govuk-input--width-4"
id="start-year" name="start-year" type="text"
[class.govuk-input--error]="submitted && (formGroup.controls.startyear.invalid || StartDateValidation || PastDateValidation)"
[class.govuk-input--error]="submitted && pageAccessMode != 'edit' && (formGroup.controls.startyear.invalid || StartDateValidation || PastDateValidation)"
inputmode="numeric" formControlName="startyear" maxlength="4"
(keydown.backspace)="tiggerBackspace(formGroup.controls.startyear.value,'start-year','startdate')">
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DatePipe } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { UserListResponse } from 'src/app/models/user';
import { WrapperOrganisationService } from 'src/app/services/wrapper/wrapper-org-service';
Expand All @@ -11,7 +11,7 @@ import { environment } from 'src/environments/environment';
templateUrl: './delegated-user-list.component.html',
styleUrls: ['./delegated-user-list.component.scss'],
})
export class DelegatedUserListComponent implements OnInit {
export class DelegatedUserListComponent implements OnInit ,OnDestroy {
public searchText: string = '';
public searchSumbited: boolean = false;
public tabConfig = {
Expand Down Expand Up @@ -58,8 +58,9 @@ export class DelegatedUserListComponent implements OnInit {
};
}


ngOnInit() {
this.tabChanged(sessionStorage.getItem('activetab') || '')
this.tabChanged(sessionStorage.getItem('activetab') || 'currentusers')
setTimeout(() => {
this.getOrganisationExpiredUsers()
}, 10);
Expand Down Expand Up @@ -142,14 +143,17 @@ export class DelegatedUserListComponent implements OnInit {


public tabChanged(activetab: string): void {
sessionStorage.setItem('activetab',activetab)

if (activetab === 'currentusers') {
this.tabConfig.currentusers = true
this.tabConfig.expiredusers = false
} else {
this.tabConfig.expiredusers = true
this.tabConfig.currentusers = false

}
}

ngOnDestroy(): void {
sessionStorage.removeItem('activetab')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ "ADMINISTRATOR_DASHBOARD" | translate }}</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" routerLink="/delegated-access">
<a class="govuk-breadcrumbs__link" (click)="goToDelegatedAccessPage()" routerLink="/delegated-access">
Delegated access</a>
</li>
<li class="govuk-breadcrumbs__list-item" *ngIf="UserStatus.status != '003'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ export class DelegatedUserStatusComponent implements OnInit {
this.router.navigateByUrl('home');
}
public Back():void{
sessionStorage.setItem('activetab','expiredusers')
window.history.back();
}
public goToDelegatedAccessPage(){
sessionStorage.setItem('activetab','expiredusers')
this.router.navigateByUrl('delegated-access');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
<li>eSourcing Service as a buyer</li>
<li>Contract Award Service (CAS) - add service</li>
<li>Contract Award Service (CAS) - add to dashboard</li>
<li>eSourcing Service - add service</li>
</ul>
</td>
</tr>
Expand Down