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

2071 auto validation UI #831

Merged
merged 11 commits into from
Oct 31, 2022
55 changes: 55 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ import { DelegatedUserActivationComponent } from './pages/manage-delegated/landi
import { DelegatedOrganisationComponent } from './pages/manage-delegated/user/delegated-organisation/delegated-organisation.component';
import { TermsConditionsComponent } from './components/terms-conditions/terms-conditions.component';
import { ForgotPasswordErrorComponent } from './pages/forgot-password-error/forgot-password-error.component';
import { BuyerBothRequestsComponent } from './pages/manage-buyer-and-both-requests/buyer-both-requests/buyer-both-requests.component';
import { ConfirmDeclineComponent } from './pages/manage-buyer-and-both-requests/confirm-decline/confirm-decline.component';
import { BuyerBothRequestsSuccessComponent } from './pages/manage-buyer-and-both-requests/buyer-both-requests-success/buyer-both-requests-success.component';
import { ConfirmAcceptComponent } from './pages/manage-buyer-and-both-requests/confirm-accept/confirm-accept.component';
import { ViewPendingVerificationComponent } from './pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component';
import { ViewVerifiedOrgComponent } from './pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component';
import { RemoveRightToBuyComponent } from './pages/manage-buyer-and-both-requests/remove-right-to-buy/remove-right-to-buy.component';
import { SuccessRightToBuyComponent } from './pages/manage-buyer-and-both-requests/success-right-to-buy/success-right-to-buy.component';

const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
Expand Down Expand Up @@ -1009,6 +1017,53 @@ const routes: Routes = [
pathMatch: 'full',
component: DelegatedErrorComponent,
},
{
path: 'manage-buyer-both',
data: { title: 'Manage Buyer status Requests' },
pathMatch: 'full',
component: BuyerBothRequestsComponent,
},
{
path: 'confirm-decline',
data: { title: 'Decline right to buy status' },
pathMatch: 'full',
component: ConfirmDeclineComponent,
},
{
path: 'confirm-accept',
data: { title: 'Approve right to buy status' },
pathMatch: 'full',
component: ConfirmAcceptComponent,
},
{
path: 'pending-verification',
data: { title: 'Manage Buyer status requests - View request' },
pathMatch: 'full',
component: ViewPendingVerificationComponent,
},
{
path: 'verified-organisations',
data: { title: 'Manage Buyer status requests - View Buyer status for the organisation' },
pathMatch: 'full',
component: ViewVerifiedOrgComponent,
},
{
path: 'remove-right-to-buy',
data: { title: 'Remove right to buy status' },
pathMatch: 'full',
component: RemoveRightToBuyComponent,
},
{
path: 'remove-right-to-buy-success',
data: { title: 'Remove right to buy status – success' },
pathMatch: 'full',
component: SuccessRightToBuyComponent,
},
{
path: 'buyer-and-both-success',
pathMatch: 'full',
component: BuyerBothRequestsSuccessComponent,
},
{
path: 'terms-of-use',
data: { title: 'Terms of Use' },
Expand Down
18 changes: 17 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ import { DelegatedUserActivationComponent } from './pages/manage-delegated/landi
import { DelegatedOrganisationComponent } from './pages/manage-delegated/user/delegated-organisation/delegated-organisation.component';
import { TermsConditionsComponent } from './components/terms-conditions/terms-conditions.component';
import { ForgotPasswordErrorComponent } from './pages/forgot-password-error/forgot-password-error.component';
import { BuyerBothRequestsComponent } from './pages/manage-buyer-and-both-requests/buyer-both-requests/buyer-both-requests.component';
import { ConfirmDeclineComponent } from './pages/manage-buyer-and-both-requests/confirm-decline/confirm-decline.component';
import { BuyerBothRequestsSuccessComponent } from './pages/manage-buyer-and-both-requests/buyer-both-requests-success/buyer-both-requests-success.component';
import { ConfirmAcceptComponent } from './pages/manage-buyer-and-both-requests/confirm-accept/confirm-accept.component';
import { ViewPendingVerificationComponent } from './pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component';
import { ViewVerifiedOrgComponent } from './pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component';
import { RemoveRightToBuyComponent } from './pages/manage-buyer-and-both-requests/remove-right-to-buy/remove-right-to-buy.component';
import { SuccessRightToBuyComponent } from './pages/manage-buyer-and-both-requests/success-right-to-buy/success-right-to-buy.component';

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
Expand Down Expand Up @@ -315,7 +323,15 @@ export function createTranslateLoader(http: HttpClient) {
DelegatedUserActivationComponent,
DelegatedOrganisationComponent,
TermsConditionsComponent,
ForgotPasswordErrorComponent
ForgotPasswordErrorComponent,
BuyerBothRequestsComponent,
ConfirmDeclineComponent,
BuyerBothRequestsSuccessComponent,
ConfirmAcceptComponent,
ViewPendingVerificationComponent,
ViewVerifiedOrgComponent,
RemoveRightToBuyComponent,
SuccessRightToBuyComponent
],
imports: [
// BrowserModule,
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/govuk-table/govuk-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
? 'navigation-text'
: ''
]">
{{ dataKey == 'endDate' ? (dataRow[dataKey] | date: 'dd/MM/yyyy') : dataRow[dataKey] }}
{{ dataKey == 'endDate' ? (dataRow[dataKey] | date: 'dd/MM/yyyy') : dataKey == 'dateofRegistration' ? (dataRow[dataKey] | date: 'dd/MM/yyyy') : dataRow[dataKey] }}
</td>
<td class="govuk-table__cell" *ngIf="isHyperLinkVisible == true">
<a class="navigation-text" href="javascript:;">
Expand All @@ -29,7 +29,7 @@
<td *ngIf="hyperArrayVisible == true" class="govuk-table__cell">
<div class="govuk-table_action-links">
<span *ngFor="let hypertex of hyperLinkArray">
<a class="navigation-text" href="javascript:;" [ngClass]="{'navigation-text-red' : hypertex == 'Remove'}">
<a class="navigation-text" href="javascript:;" [ngClass]="{'navigation-text-red': hypertex == 'Remove' || hypertex == 'Decline' }">
{{ hypertex }}</a>
</span>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,13 @@ export class HomeComponent extends BaseComponent implements OnInit {
description: 'Support for users of other organisations',
route: '/org-support/search',
});
this.otherModules.push({
name: 'Manage Buyer status requests',
description: 'Verify and approve or decline Buyer status requests',
route: '/manage-buyer-both',
});
}
}

}

getModuleElementId(moduleName: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="user-profile-container">
<div class="govuk-breadcrumbs">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" routerLink="/home">
{{ "ADMINISTRATOR_DASHBOARD" | translate }}</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" routerLink="/manage-buyer-both">
Manage Buyer status requests</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<span class="govuk-breadcrumbs__link">Success</span>
</li>
</ol>
</div>
<h1 class="govuk-heading-xl page-title header-bread-align" *ngIf="routeDetails.status === 'decline'">You have declined the right to buy status for organisation Organisation name</h1>
<h1 class="govuk-heading-xl page-title header-bread-align" *ngIf="routeDetails.status === 'accept'">You have accepted the right to buy status for the organisation Organisation name</h1>
<div>
<a (click)="returnToRequests()" class="navigation-text">Return to Manage Buyer status requests</a>
<br><br>
<a (click)="returnToDashBoard()" class="navigation-text">Return to the
dashboard</a>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.header-bread-align {
margin-bottom: 30px !important;
margin-top: 30px !important;
}
.header-bread-align {
margin-bottom: 30px !important;
margin-top: 30px !important;
}
.navigation-text{
margin-bottom: 100px;
font-size: 19px;
color: #005ea5;
}
a {
text-decoration: underline;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BuyerBothRequestsSuccessComponent } from './buyer-both-requests-success.component';

describe('BuyerBothRequestsSuccessComponent', () => {
let component: BuyerBothRequestsSuccessComponent;
let fixture: ComponentFixture<BuyerBothRequestsSuccessComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BuyerBothRequestsSuccessComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(BuyerBothRequestsSuccessComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
selector: 'app-buyer-both-requests-success',
templateUrl: './buyer-both-requests-success.component.html',
styleUrls: ['./buyer-both-requests-success.component.scss'],
})
export class BuyerBothRequestsSuccessComponent implements OnInit {
public routeDetails:any;
constructor(private route: ActivatedRoute, private router: Router, private titleService: Title) {
this.route.queryParams.subscribe((para: any) => {
this.routeDetails = JSON.parse(atob(para.data));
console.log("this.routeDetails",this.routeDetails)
switch (this.routeDetails.status) {
case "accept": {
this.titleService.setTitle(
`${ 'Accept right to buy status – success' } - CCS`
);
break;
}
case 'decline': {
this.titleService.setTitle(
`${ 'Decline right to buy status – success' } - CCS`
);
break;
}
default: {
//statements;
break;
}
}
});
}

ngOnInit(): void {}

public returnToRequests() {
this.router.navigateByUrl('manage-buyer-both');
}

public returnToDashBoard() {
this.router.navigateByUrl('home');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="user-profile-container">
<div class="govuk-breadcrumbs">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" routerLink="/home">
{{ 'ADMINISTRATOR_DASHBOARD' | translate }}</a>
</li>
<li class="govuk-breadcrumbs__list-item">
<span class="govuk-breadcrumbs__link">Manage Buyer status requests</span>
</li>
</ol>
</div>
<h1 class="govuk-heading-xl page-title header-bread-align">Manage Buyer status requests</h1>
<div class="manage-groups-bg">
<p class="govuk-body-l">This page allows you to approve or decline the Buyer status requests for organisations
</p>
</div>
<div class="govuk-form-group" id="search-form-group" [class.govuk-form-group--error]="searchSumbited && searchText ===''">
<label class="govuk-label" for="search"> Search for organisations </label>
<span id="first-name-error" class="govuk-error-message"
*ngIf="searchSumbited && searchText ===''">
<span class="govuk-visually-hidden">{{ 'ERROR_PREFIX' | translate }}</span> Enter a organisation name
</span>
<app-search-box [(searchText)]="searchText" (onSearchClickEvent)="onSearchClick()">
</app-search-box>
</div>
</div>
</div>
</div>
<div class="govuk-tabs" data-module="govuk-tabs">
<ul class="govuk-tabs__list">
<li class="govuk-tabs__list-item" [ngClass]="{'govuk-tabs__list-item--selected' : tabConfig.pendingOrg}" (click)="tabChanged('pendingOrg')">
<a class="govuk-tabs__tab" href="javascript:;" onClick="return false;">
Buyer status pending
</a>
</li>
<li class="govuk-tabs__list-item" [ngClass]="{'govuk-tabs__list-item--selected' : tabConfig.verifiedOrg}" (click)="tabChanged('verifiedOrg')">
<a class="govuk-tabs__tab" href="javascript:;" onClick="return false;">
Approved / declined Buyer status requests
</a>
</li>
</ul>
<div class="govuk-tabs__panel" id="past-day" [ngClass]="{'govuk-tabs__panel--hidden' : tabConfig.verifiedOrg}">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="user-table">
<app-govuk-table [headerTextKeys]="pendingVerificationBuyerAndBoth.usersTableHeaders" [data]="pendingVerificationBuyerAndBoth.userList.userList"
[dataKeys]="pendingVerificationBuyerAndBoth.usersColumnsToDisplay" [isHyperLinkVisible]="false"
[pageName]="pendingVerificationBuyerAndBoth.pageName" [hyperArrayVisible]="true" [hyperLinkArray]=pendingVerificationBuyerAndBoth.hyperTextrray
(hyperLinkClickEvent)="onLinkClick($event)" [useServerPagination]="true" [serverPageCount]="pendingVerificationBuyerAndBoth.pageCount"
[serverPageCurrentPage]="pendingVerificationBuyerAndBoth.currentPage" (changeCurrentPageEvent)="setPagecurrentUsers($event)"></app-govuk-table>
</div>
</div>
</div>
</div>
<div class="govuk-tabs__panel" id="past-week" [ngClass]="{'govuk-tabs__panel--hidden' : tabConfig.pendingOrg}">
<div class="user-table">
<app-govuk-table [headerTextKeys]="verifiedBuyerAndBoth.usersTableHeaders" [data]="verifiedBuyerAndBoth.userList.userList"
[dataKeys]="verifiedBuyerAndBoth.usersColumnsToDisplay" [isHyperLinkVisible]="false"
[pageName]="verifiedBuyerAndBoth.pageName" [hyperArrayVisible]="true" [hyperLinkArray]=verifiedBuyerAndBoth.hyperTextrray
(hyperLinkClickEvent)="OnClickView($event)" [useServerPagination]="true" [serverPageCount]="verifiedBuyerAndBoth.pageCount"
[serverPageCurrentPage]="verifiedBuyerAndBoth.currentPage" (changeCurrentPageEvent)="setPageexpiredUsers($event)"></app-govuk-table>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.header-bread-align {
margin-bottom: 30px !important;
margin-top: 30px !important;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BuyerBothRequestsComponent } from './buyer-both-requests.component';

describe('BuyerBothRequestsComponent', () => {
let component: BuyerBothRequestsComponent;
let fixture: ComponentFixture<BuyerBothRequestsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BuyerBothRequestsComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(BuyerBothRequestsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading