Skip to content

Commit

Permalink
Merge pull request #1629 from Crown-Commercial-Service/release/nft
Browse files Browse the repository at this point in the history
CaT+UAT038+26+07+2022
  • Loading branch information
BalwinderSinghCts committed Jul 26, 2022
2 parents 6e4f88a + 0e7dd27 commit 3f25643
Show file tree
Hide file tree
Showing 27 changed files with 347 additions and 196 deletions.
3 changes: 2 additions & 1 deletion src/main/common/middlewares/event-management/activeevents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export class EventEngagementMiddleware {
//singleEvent=events[i];
//singleEvent.activeEvent=getEventsData[j];
if (singleEvent.activeEvent != undefined && singleEvent.activeEvent?.status != undefined && (singleEvent.activeEvent.eventType == 'RFI' || singleEvent.activeEvent.eventType == 'EOI')) {
if (singleEvent.activeEvent?.dashboardStatus == 'COMPLETE' || singleEvent.activeEvent?.dashboardStatus == 'CLOSED') {
if (singleEvent.activeEvent?.dashboardStatus == 'COMPLETE' || singleEvent.activeEvent?.dashboardStatus == 'CLOSED'
|| (singleEvent.activeEvent?.dashboardStatus=='UNKNOWN' && singleEvent.activeEvent?.status=='withdrawn')) {
// Historical Events
historicalEvents.push(singleEvent)
} else if (singleEvent.activeEvent?.dashboardStatus == 'IN-PROGRESS') {
Expand Down
24 changes: 16 additions & 8 deletions src/main/features/event-management/controller/evaluateSuppliers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,26 @@ export const EVALUATE_SUPPLIERS = async (req: express.Request, res: express.Resp
const ScoresAndFeedbackURL =`tenders/projects/${projectId}/events/${eventId}/scores`
const ScoresAndFeedbackURLdata = await TenderApi.Instance(SESSION_ID).get(ScoresAndFeedbackURL)
const supplierInterestURL = `tenders/projects/${projectId}/events/${eventId}/responses`
const supplierdata = await TenderApi.Instance(SESSION_ID).get(supplierInterestURL)
const supplierdata= await TenderApi.Instance(SESSION_ID).get(supplierInterestURL)
var submittedCount = 0
for (let i = 0; i < supplierdata.data.responders.length; i++) {
if(supplierdata.data.responders[i].responseState == 'Submitted')
{
submittedCount++
}
}
let supData = [];
let supplierName = [];

let showallDownload = false;
for (let i = 0; i < ScoresAndFeedbackURLdata.data.length; i++) {

for(let j=0;j<supplierdata.data.responders.length;j++)
{
if(supplierdata.data.responders[j].supplier.id==ScoresAndFeedbackURLdata.data[i].organisationId)
if(supplierdata.data.responders[j].supplier.id==ScoresAndFeedbackURLdata.data[i].organisationId )
{
supData[i]=supplierdata.data.responders[j];
break;
}
}
}
//supplierdata.data.responders.filter((a:any)=>{a.supplier.id==ScoresAndFeedbackURLdata.data[i].organisationId});
//let commentData=supplierdata.data.responders[i].supplier.filter((a:any)=>{a.organisationId==supplierdata.data.responders[i].supplier.id});
Expand All @@ -115,7 +121,7 @@ export const EVALUATE_SUPPLIERS = async (req: express.Request, res: express.Resp
completion = "Yes"
}


let dataPrepared = {

"id": supData[i].supplier.id,
Expand All @@ -126,24 +132,26 @@ export const EVALUATE_SUPPLIERS = async (req: express.Request, res: express.Resp
"responseDate": supData[i].responseDate,
"completionStatus":completion,
}

if (supplierdata.data.responders[i].responseState == 'Submitted') {
showallDownload = true;
}
supplierName.push(dataPrepared)
}

}

const supplierSummary = supplierdata.data;
var count =0;
let ConfirmFlag = false;
//count of completionstatus="yes" == count of responders
for (let k = 0; k < supplierName.length; k++) {
if(supplierName[k].completionStatus == "Yes")
if(supplierName[k].completionStatus == "Yes" && supplierName[k].responseState == "Submitted" )
{
count++;
}
}
if(count == supplierName.length)
if(count == submittedCount)
{
ConfirmFlag = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const EVENT_MANAGEMENT = async (req: express.Request, res: express.Respon
const supplierAwardDetail = await (await TenderApi.Instance(SESSION_ID).get(supplierAwardDetailURL)).data;

supplierAwardDetail?.suppliers?.map((item: any) => {
supplierDetailsDataList.filter(x => x.supplierId == item.id)[0].supplierState = item.state;
supplierDetailsDataList.filter(x => x.supplierId == item.id)[0].supplierState = "Awarded";
supplierDetails = supplierDetailsDataList.filter(x => x.supplierId == item.id)[0];
});

Expand Down Expand Up @@ -552,15 +552,15 @@ export const SUPPLIER_ANSWER_DOWNLOAD = async (req: express.Request, res: expres
}
}

//supplieranswer?download=1
//supplieranswerall?supplierid=1
export const SUPPLIER_ANSWER_DOWNLOAD_ALL = async (req: express.Request, res: express.Response) => {
const { SESSION_ID } = req.cookies; //jwt
const { projectId } = req.session;
const { eventId } = req.session;
const { download, download_all } = req.query;
const { supplierid, download_all } = req.query;

try {
if (download != undefined) {
if (supplierid != undefined) {
const FileDownloadURL = `/tenders/projects/${projectId}/events/${eventId}/responses/export`;
const FetchDocuments = await DynamicFrameworkInstance.file_dowload_Instance(SESSION_ID).get(FileDownloadURL, {
responseType: 'arraybuffer',
Expand Down
16 changes: 16 additions & 0 deletions src/main/features/event-management/controller/steps-to-continue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as express from 'express'
import { LoggTracer } from '@common/logtracer/tracer'
import { TokenDecoder } from '@common/tokendecoder/tokendecoder'
import * as data from '../../../resources/content/event-management/steps-to-continue.json'
import { TenderApi } from './../../../common/util/fetch/procurementService/TenderApiInstance';

/**
*
Expand Down Expand Up @@ -56,6 +57,21 @@ export const POST_STEPS_TO_CONTINUE = async (req: express.Request, res: express.
try {

const rfi_next_steps = req.body.rfi_next_steps_to_continue;

let baseUrl = `/tenders/projects/${req.session.projectId}/events`;
let body = {
"name": "Further Competition Event",
"eventType": "FCA"
}
const { data } = await TenderApi.Instance(SESSION_ID).post(baseUrl, body);
if(data != null && data !=undefined)
{
req.session['eventId'] = data.id;
req.session.procurements[0]['eventId'] = data.id;
req.session.procurements[0]['eventType'] = data.eventType;
req.session.procurements[0]['started'] = false;
}

if (rfi_next_steps) {
switch (rfi_next_steps) {
case '[DA]':
Expand Down
16 changes: 12 additions & 4 deletions src/main/features/event-management/views/awardDocumentComplete.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% from "macros/csrf.njk" import csrfProtection %}
{% from "components/support/macro.njk" import howToGetSupport %}

{% set title = 'Award documents ' %}
{% set title = 'Your project ' %}
{% block breadCrumb %}
{{ CCSBreadcrumbs({
items:[
Expand All @@ -21,6 +21,14 @@
{% block content %}
<main class="govuk-main-wrapper govuk-main-wrapper--auto-spacing" id="main-content" role="main">

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-xl">
<strong> {{title}}</strong>
</h1>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="project-overview">
Expand Down Expand Up @@ -55,16 +63,16 @@

<h3> <strong>Awarded supplier contract templates </strong></h3>

<p> If you have not already complete the order form and call off schedules template, you must download and complete it before continuing.</p>
<p> If you have not already completed the order form and call off schedules template, you must download and complete it before continuing.</p>
<div class="govuk-grid-row govuk-!-margin-bottom-6 govuk-!-margin-top-6">
<div class="govuk-grid-column-full">
<table class="govuk-table">
<caption class="govuk-table__caption govuk-visually-hidden">Supplier Evaluation</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Supplier's name</th>
<th scope="col" class="govuk-table__header govuk-text-align govuk-!-text-align-centre">Documents Template</th>
<th scope="col" class="govuk-table__header govuk-text-align govuk-!-text-align-centre">Order from and call of schedules template</th>
<th scope="col" class="govuk-table__header govuk-text-align govuk-!-text-align-centre">Document templates</th>
<th scope="col" class="govuk-table__header govuk-text-align govuk-!-text-align-centre">Order form and call off schedules template</th>
</tr>
</thead>
{% for supplier in eventManagementData.documentTemplateDataList %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ or messages in your inbox.See supplier's answer to your published project.</p>
<strong class="govuk-tag app-task-list__tag govuk-tag--grey" id="suppliers-status">{{status}}</strong>
</h2>
<p class="govuk-body">
{% if(showCloseProject) and status.toLowerCase !== "complete" %}
{#{% if(showCloseProject) and status.toLowerCase !== "complete" %}#}
<a class="govuk-link" href="/rfi/nextsteps">{{ data.subsection2_content }}</a>
{% endif %}
{#{% endif %}#}
</p>
</div>
</div>
Expand Down Expand Up @@ -181,7 +181,7 @@ or messages in your inbox.See supplier's answer to your published project.</p>
</tr>
</thead>
{% for supplier in supplierDetailsDataList %}
{# {% if supplier.responseState =='Draft' %} #}
{% if supplier.responseState.toLowerCase() =='submitted' %}
<tbody class="govuk-table__body">

<tr class="govuk-table__row">
Expand All @@ -197,7 +197,7 @@ or messages in your inbox.See supplier's answer to your published project.</p>
</td>

<td class="govuk-text-align govuk-!-text-align-centre">
<a class="govuk-link" href="/supplier-evaluation?reviewsupplierid={{supplier.supplierId}}">Review evaluation</a>
<a class="govuk-link" href="/eventmanagement?reviewsupplierid={{supplier.supplierId}}">Review evaluation</a>
</td>

<th scope="row" class="govuk-table__cell govuk-!-text-align-centre">
Expand All @@ -214,6 +214,7 @@ or messages in your inbox.See supplier's answer to your published project.</p>
</th>
</tr>
</tbody>
{% endif %}
{% endfor %}
</table>
</div>
Expand Down
14 changes: 11 additions & 3 deletions src/main/features/event-management/views/awardSupplier.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% from "macros/csrf.njk" import csrfProtection %}
{% from "components/support/macro.njk" import howToGetSupport %}

{% set title = 'Award Supplier ' %}
{% set title = 'Your project ' %}
{% block breadCrumb %}
{{ CCSBreadcrumbs({
items:[
Expand Down Expand Up @@ -32,6 +32,14 @@
}) }}
{% endif %}

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-xl">
<strong> {{title}}</strong>
</h1>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="project-overview">
Expand Down Expand Up @@ -120,11 +128,11 @@

</th>
<td class="govuk-table__cell govuk-text-align govuk-!-text-align-centre">
<a class="govuk-link" href="/download-supplier-responce?supplierid=={{supplier.supplierId}}">Download</a>
<a class="govuk-link" href="/download-supplier-responce?supplierid={{supplier.supplierId}}">Download</a>
</td>

<td class="govuk-table__cell govuk-text-align govuk-!-text-align-centre">
<a class="govuk-link" href="/eventmanagement?supplierid={{supplier.supplierId}}">Review evaluation</a>
<a class="govuk-link" href="/eventmanagement?reviewsupplierid={{supplier.supplierId}}">Review evaluation</a>
</td>
<th scope="row" class="govuk-table__cell govuk-text-align govuk-!-text-align-centre">
<p class="govuk-body govuk-!-margin-bottom-0">{{supplier.score}}</p>
Expand Down
12 changes: 10 additions & 2 deletions src/main/features/event-management/views/confirmSupplier.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% from "macros/csrf.njk" import csrfProtection %}
{% from "components/support/macro.njk" import howToGetSupport %}

{% set title = 'Event management ' %}
{% set title = 'Your project' %}
{% block breadCrumb %}
{{ CCSBreadcrumbs({
items:[
Expand All @@ -21,6 +21,14 @@
{% block content %}
<main class="govuk-main-wrapper govuk-main-wrapper--auto-spacing" id="main-content" role="main">

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-xl">
<strong> {{title}}</strong>
</h1>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="project-overview">
Expand Down Expand Up @@ -107,7 +115,7 @@
</td>

<td class="govuk-table__cell govuk-text-align govuk-!-text-align-centre">
<a class="govuk-link" href="/supplier-evaluation?reviewsupplierid={{supplier.supplierId}}">Review evaluation</a>
<a class="govuk-link" href="/eventmanagement?reviewsupplierid={{supplier.supplierId}}">Review evaluation</a>
</td>
<td scope="row" class="govuk-table__cell govuk-text-align govuk-!-text-align-centre">
<p class="govuk-body govuk-!-margin-bottom-0">{{supplier.score}}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"text": "Your Project",
"href": "/dashboard"
"href": "/event/management?id="+eventId
},
{
"text": "Evaluate Suppliers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% from "macros/csrf.njk" import csrfProtection %}
{% from "components/support/macro.njk" import howToGetSupport %}

{% set title = 'Event management ' %}
{% set title = 'Review your supplier evaluation ' %}
{% block breadCrumb %}
{{ CCSBreadcrumbs({
items:[
Expand Down Expand Up @@ -94,25 +94,15 @@

<br/>

{{ CCSInput({
label: {
text: "Final Feedback ",
classes: "govuk-label--m",
name: "enter_evaluation_readOnly"
},
value:supplierDetails.supplierFeedBack,
id: "enter_evaluation_feedback_readOnly",
name: "enter_evaluation_feedback",
spellcheck: true,
classes: "govuk-input",
maxlength: "5000"
})
}}
<p class="govuk-body"><h2><strong>Final Feedback </p>
<textarea class="govuk-textarea govuk-js-character-count" id="enter_evaluation_feedback_readOnly" name="enter_evaluation_feedback" rows="7" >{{supplierDetails.supplierFeedBack}}</textarea>


<p><label id="supplierFeedback"></label></p>

<div class="govuk-button-group">
{% set returnLink = "/event/management?id="+supplierDetails.eventId %}
<a href="{{returnLink}}" class="govuk-link govuk-link--no-visited-state">Return to project</a>
<a href="{{returnLink}}" class="govuk-link govuk-link--no-visited-state">Return to your project</a>
</div>


Expand Down
10 changes: 5 additions & 5 deletions src/main/features/event-management/views/evaluateSuppliers.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
{{ CCSBreadcrumbs({
items:[
{
"text": "Dashboard",
"text": "Your Dashboard",
"href": "/dashboard"
},
{
"text": "Your Project",
"href": "#"
"href": "/event/management?id="+eventId
},
{
"text": "Evaluate Suppliers",
Expand Down Expand Up @@ -70,7 +70,7 @@
</tr>
</thead>
{% for supplier in supplierName %}
{#{% if supplier.responseState =='Submitted' %} #}
{% if supplier.responseState =='Submitted' %}
<tbody class="govuk-table__body">

<tr class="govuk-table__row">
Expand All @@ -81,15 +81,15 @@
{#</p>#}

</th>
<td class="govuk-table__cell">{{ supplier.responseDate }}</td>
<td class="govuk-table__cell">{{ supplier.responseDate |dateddmmyyyy }}</td>
<td class="govuk-table__cell">
<a class="govuk-link" href="/evaluate-download?supplierid={{supplier.id}}">{{ data.Downloadresponse[0].text }}</a>
</td>
<td class="govuk-table__cell"> <a href="/enter-evaluation?supplierid={{supplier.id}}&suppliername={{supplier.name}}" class="govuk-link govuk-link--no-visited-state"> Add or edit </a></td>
<td class="govuk-table__cell"> {{supplier.completionStatus}} </td>
</tr>
</tbody>
{#{% endif %} #}
{% endif %}
{% endfor %}
</table>
</div>
Expand Down
Loading

0 comments on commit 3f25643

Please sign in to comment.