Skip to content

Commit

Permalink
Merge pull request #112 from nhsengland/develop
Browse files Browse the repository at this point in the history
Release 1.11.0 of the innovation service
  • Loading branch information
JyotiJaiswal169 authored Jan 31, 2022
2 parents 4500294 + 95a47c2 commit efa107d
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<h1 class="nhsuk-heading-xl nhsuk-u-margin-bottom-5"> {{ pageTitle }} </h1>

<a *ngIf="innovation.support?.status === 'ENGAGING'" routerLink="/accessor/innovations/{{ innovationId }}/action-tracker/new" class="nhsuk-button nhsuk-u-margin-bottom-7"> Create new action </a>
<a *ngIf="innovation.support?.status === 'ENGAGING' || innovation.support?.status === 'FURTHER_INFO_REQUIRED'" routerLink="/accessor/innovations/{{ innovationId }}/action-tracker/new" class="nhsuk-button nhsuk-u-margin-bottom-7"> Create new action </a>

<theme-spinner *ngIf="pageStatus === 'LOADING'" cssClass="nhsuk-u-margin-9"></theme-spinner>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

<form [formGroup]="form">

<theme-form-textarea controlName="reason" label="Enter a comment" [pageUniqueField]="false"></theme-form-textarea>

<ng-container *ngIf="pageStep === 'CODE_REQUEST'">
<theme-form-input controlName="code" label="Enter the confirmation code" [pageUniqueField]="false"></theme-form-input>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2 class="nhsuk-heading-l nhsuk-u-margin-bottom-3">The innovation</h2>

<dl class="nhsuk-summary-list">

<!-- Maturity level item -->
<!-- Maturity level item -->
<div class="nhsuk-summary-list__row">
<dt class="nhsuk-summary-list__key nhsuk-u-font-weight-normal">{{ innovationMaturityLevel.label }}</dt>
<dd class="nhsuk-summary-list__key width-auto">{{ innovationMaturityLevel.value }}</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const routes: Routes = [
},
{
path: 'comments', pathMatch: 'full', component: PageInnovationCommentsListComponent,
resolve: { innovationData: InnovationDataResolver },
data: { layoutOptions: { type: 'innovationLeftAsideMenu', showInnovationHeader: true } }
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class PageAccountManageUserAccountComponent extends CoreComponent impleme
reason: new FormControl(''),
email: new FormControl('', [CustomValidators.required('An email is required'), CustomValidators.equalTo(this.user.email, 'The email is incorrect')]),
confirmation: new FormControl('', [CustomValidators.required('A confirmation text is neccessry'), CustomValidators.equalTo('delete my account')]),
});
}, { updateOn: 'blur' });

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class PageAccountManageInnovationsArchivalComponent extends CoreComponent
reason: new FormControl(''),
email: new FormControl('', [CustomValidators.required('An email is required'), CustomValidators.equalTo(user.email, 'The email is incorrect')]),
confirmation: new FormControl('', [CustomValidators.required('A confirmation text is neccessry'), CustomValidators.equalTo('archive my innovation')]),
});
}, { updateOn: 'blur' });
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ describe('FeatureModules/Innovator/Pages/Account/ManageInnovations/PageAccountMa

const expected = {
type: 'ERROR',
title: 'An error occurred when creating an action',
message: 'Please try again or contact us for further help',
title: 'An error occurred when transferring innovation ownership.',
message: 'Please check the details and try again or contact us for further info.',
setFocus: true
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class PageAccountManageInnovationsTransferComponent extends CoreComponent
innovation: new FormControl('', CustomValidators.required('Please choose an innovation')),
email: new FormControl('', [CustomValidators.required('An email is required'), Validators.email]),
confirmation: new FormControl('', [CustomValidators.required('A confirmation text is neccessry'), CustomValidators.equalTo('transfer my innovation')]),
});
}, { updateOn: 'blur' });

formInnovationsItems: FormEngineParameterModel['items'] = [];

Expand Down Expand Up @@ -89,8 +89,8 @@ export class PageAccountManageInnovationsTransferComponent extends CoreComponent
() => {
this.alert = {
type: 'ERROR',
title: 'An error occurred when creating an action',
message: 'Please try again or contact us for further help',
title: 'An error occurred when transferring innovation ownership.',
message: 'Please check the details and try again or contact us for further info.',
setFocus: true
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export class TriageInnovatorPackLayoutComponent extends CoreComponent {
{ title: 'Find support', url: `/triage-innovator-pack` },
{ title: 'Innovation guides', url: `/innovation-guides`, fullReload: true },
{ title: 'Case studies', url: `/case-studies`, fullReload: true },
{ title: 'About the service', url: `/about-the-service`, fullReload: true },
{ title: 'Find support', url: `/triage-innovator-pack`, fullReload: true }
{ title: 'About the service', url: `/about-the-service`, fullReload: true }
],
rightItems: [
{ title: 'My dashboard', url: `${this.stores.environment.APP_URL}/dashboard`, fullReload: true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<p class="nhsuk-heading-l nhsuk-u-margin-bottom-0"> {{ innovation.name }} </p>
</div>
<div *ngIf="innovation.assessment.id" class="nhsuk-grid-column-one-third text-align-right">
<a routerLink="/{{ module }}/innovations/{{ innovationId }}/assessments/{{ innovation.assessment.id }}"> View needs assessment </a>
<a routerLink="/{{ module }}/innovations/{{ innovationId }}/assessments/{{ innovation.assessment.id }}"> View
needs assessment </a>
</div>
</div>
<hr class="nhsuk-section-break nhsuk-section-break--visible nhsuk-u-margin-bottom-3" />
Expand All @@ -17,29 +18,40 @@
<p> {{ alert.message }} </p>
</theme-alert>

<h1 class="nhsuk-heading-xl"> {{ pageTitle }} </h1>
<h1 class="nhsuk-heading-xl"> {{ pageTitle }} </h1>

<theme-spinner *ngIf="pageStatus === 'LOADING'" cssClass="nhsuk-u-margin-9"></theme-spinner>

<ng-container *ngIf="pageStatus === 'READY'">
<p class="nhsuk-body-s">All comments can be seen by the innovator, needs assessment team, and selected support organisations depending on the innovator's sharing preferences.</p>

<button class="nhsuk-button" [disabled]="!allSectionsSubmitted()"
routerLink="/{{ module }}/innovations/{{ innovationId }}/comments/new"> Add new comment </button>
<p *ngIf="!allSectionsSubmitted()">Submit your record before you add a new comment.</p>


<button class="nhsuk-button" routerLink="/{{ module }}/innovations/{{ innovationId }}/comments/new"> Add new comment </button>

<div class="d-flex align-items-center justify-content-space-between nhsuk-u-margin-bottom-2">
<div class="nhsuk-body-s font-color-secondary nhsuk-u-font-weight-bold nhsuk-u-margin-0"> Showing {{ commentsList.length }} results </div>
<div class="nhsuk-body-s font-color-secondary nhsuk-u-font-weight-bold nhsuk-u-margin-0"> Showing {{
commentsList.length }} results </div>
<div class="d-flex">
<a *ngIf="currentCreatedOrder === 'asc'" routerLink="/{{ module }}/innovations/{{ innovationId }}/comments" [queryParams]="{ createdOrder: 'desc' }"
class="nhsuk-body-s nhsuk-u-margin-bottom-0 right-border-separator nhsuk-u-padding-right-3" aria-label="Sort comments by newest first">
<a *ngIf="currentCreatedOrder === 'asc'" routerLink="/{{ module }}/innovations/{{ innovationId }}/comments"
[queryParams]="{ createdOrder: 'desc' }"
class="nhsuk-body-s nhsuk-u-margin-bottom-0 right-border-separator nhsuk-u-padding-right-3"
aria-label="Sort comments by newest first">
Newest first
</a>
<span *ngIf="currentCreatedOrder === 'desc'" class="nhsuk-body-s nhsuk-u-margin-bottom-0 right-border-separator nhsuk-u-padding-right-3">
<span *ngIf="currentCreatedOrder === 'desc'"
class="nhsuk-body-s nhsuk-u-margin-bottom-0 right-border-separator nhsuk-u-padding-right-3">
<span class="nhsuk-u-visually-hidden"> Comments are sorted by </span> Newest first
</span>
<a *ngIf="currentCreatedOrder === 'desc'" routerLink="/{{ module }}/innovations/{{ innovationId }}/comments" [queryParams]="{ createdOrder: 'asc' }"
class="nhsuk-body-s nhsuk-u-margin-bottom-0 nhsuk-u-margin-left-3" aria-label="Sort comments by oldest first">
<a *ngIf="currentCreatedOrder === 'desc'" routerLink="/{{ module }}/innovations/{{ innovationId }}/comments"
[queryParams]="{ createdOrder: 'asc' }" class="nhsuk-body-s nhsuk-u-margin-bottom-0 nhsuk-u-margin-left-3"
aria-label="Sort comments by oldest first">
Oldest first
</a>
<span *ngIf="currentCreatedOrder === 'asc'" class="nhsuk-body-s nhsuk-u-margin-bottom-0 nhsuk-u-margin-left-3">
<span *ngIf="currentCreatedOrder === 'asc'"
class="nhsuk-body-s nhsuk-u-margin-bottom-0 nhsuk-u-margin-left-3">
<span class="nhsuk-u-visually-hidden"> Comments are sorted by </span> Oldest first
</span>
</div>
Expand All @@ -56,48 +68,65 @@ <h1 class="nhsuk-heading-xl"> {{ pageTitle }} </h1>
<div class="nhsuk-u-margin-bottom-0">
<div class="d-flex">
<div class="nhsuk-u-padding-right-1">
<p class="nhsuk-u-font-weight-bold nhsuk-u-margin-0"> {{ comment.user.name }}{{ comment.user.organisationUnit ? ', ' + comment.user.organisationUnit.name : '' }} </p>
<p class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0"> {{ getTeamTitle(comment.user.type) }} </p>
<p class="nhsuk-u-font-weight-bold nhsuk-u-margin-0"> {{ comment.user.name }}{{
comment.user.organisationUnit ? ', ' + comment.user.organisationUnit.name : '' }} </p>
<p class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0"> {{ getTeamTitle(comment.user.type)
}} </p>
</div>
<notification-tag *ngIf="comment.notifications && comment.notifications.count > 0" type="circle"></notification-tag>
<notification-tag *ngIf="comment.notifications && comment.notifications.count > 0" type="circle">
</notification-tag>
</div>
</div>
<p class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0"> {{ comment.createdAt | date: ('app.date_formats.long_date_time' | translate) }} </p>
<p class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0"> {{ comment.createdAt | date:
('app.date_formats.long_date_time' | translate) }} </p>
</div>

<p class="nhsuk-card__description" style="word-wrap: break-word; overflow-wrap: break-word;hyphens: auto;">{{ comment.message }}</p>
<p class="nhsuk-card__description"
style="word-wrap: break-word; overflow-wrap: break-word;hyphens: auto;">{{ comment.message }}</p>

<div *ngFor="let reply of comment.replies" class="bg-color-grey nhsuk-u-margin-left-4 nhsuk-u-margin-bottom-3 nhsuk-u-padding-3">
<div *ngFor="let reply of comment.replies"
class="bg-color-grey nhsuk-u-margin-left-4 nhsuk-u-margin-bottom-3 nhsuk-u-padding-3">
<div class="d-flex justify-content-space-between nhsuk-u-margin-bottom-2">
<div class="side-menu-flex">
<div>
<p class="nhsuk-u-font-weight-bold nhsuk-u-margin-0"> {{ reply.user.name }}{{ reply.user.organisationUnit ? ', ' + reply.user.organisationUnit.name : '' }}</p>
<p class="nhsuk-u-font-weight-bold nhsuk-u-margin-0"> {{ reply.user.name }}{{
reply.user.organisationUnit ? ', ' + reply.user.organisationUnit.name : '' }}</p>
</div>
<div>
<notification-tag *ngIf="reply.notifications && reply.notifications.count > 0" type="circle"></notification-tag>
<notification-tag *ngIf="reply.notifications && reply.notifications.count > 0" type="circle">
</notification-tag>
</div>
<div>
<p class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0">{{ reply.createdAt | date: ('app.date_formats.long_date_time' | translate) }} </p>
<p class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0">{{ reply.createdAt | date:
('app.date_formats.long_date_time' | translate) }} </p>
</div>
</div>
</div>
<p class="nhsuk-card__description" style="word-wrap: break-word; overflow-wrap: break-word;hyphens: auto;">{{ reply.message }}</p>
<p class="nhsuk-card__description"
style="word-wrap: break-word; overflow-wrap: break-word;hyphens: auto;">{{ reply.message }}</p>
</div>

<p id="comment-reply-label-{{ comment.id }}" class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0 nhsuk-u-margin-left-3">
Write a reply <span class="nhsuk-u-visually-hidden">&nbsp; for comment made by {{ comment.user.name }} on {{ comment.createdAt | date: ('app.date_formats.long_date_time' | translate) }}. (Limited to 2000 characters) </span>
<p id="comment-reply-label-{{ comment.id }}"
class="nhsuk-body-s font-color-secondary nhsuk-u-margin-0 nhsuk-u-margin-left-3">
Write a reply <span class="nhsuk-u-visually-hidden">&nbsp; for comment made by {{ comment.user.name }}
on {{ comment.createdAt | date: ('app.date_formats.long_date_time' | translate) }}. (Limited to 2000
characters) </span>
</p>
<div class="nhsuk-u-margin-left-3">
<div class="nhsuk-form-group reply-container" [ngClass]="{'nhsuk-form-group--error': formSubmittedFields[comment.id]}">
<div class="nhsuk-form-group reply-container"
[ngClass]="{'nhsuk-form-group--error': formSubmittedFields[comment.id]}">
<ng-container *ngIf="formSubmittedFields[comment.id]">
<span id="error-{{ comment.id }}" class="nhsuk-error-message nhsuk-u-font-size-14" role="alert">
<span class="nhsuk-u-visually-hidden">Error:</span> {{ formSubmittedFields[comment.id] | translate }}
<span class="nhsuk-u-visually-hidden">Error:</span> {{ formSubmittedFields[comment.id] | translate
}}
</span>
</ng-container>
<input id="comment-{{ comment.id }}" formControlName="{{ comment.id }}" [name]="comment.id" type="text" maxlength="2000" class="nhsuk-input"
<input id="comment-{{ comment.id }}" formControlName="{{ comment.id }}" [name]="comment.id"
type="text" maxlength="2000" class="nhsuk-input"
attr.aria-labelledby="comment-reply-label-{{ comment.id }}{{ formSubmittedFields[comment.id] ? ' error-' + comment.id : ''}}" />
<button class="nhsuk-button nhsuk-u-font-size-14 nhsuk-u-margin-left-2" (click)="onReply(comment.id)">
Reply <span class="nhsuk-u-visually-hidden"> for comment made by {{ comment.user.name }} on {{ comment.createdAt | date: ('app.date_formats.long_date_time' | translate) }} </span>
Reply <span class="nhsuk-u-visually-hidden"> for comment made by {{ comment.user.name }} on {{
comment.createdAt | date: ('app.date_formats.long_date_time' | translate) }} </span>
</button>
</div>
</div>
Expand All @@ -111,4 +140,4 @@ <h1 class="nhsuk-heading-xl"> {{ pageTitle }} </h1>
</ng-container>

</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ export class PageInnovationCommentsListComponent extends CoreComponent implement
form = new FormGroup({});
formSubmittedFields: { [key: string]: string } = {};


constructor(
private activatedRoute: ActivatedRoute,
private notificationsService: NotificationsService
) {

super();
this.setPageTitle('Comments');

this.module = this.activatedRoute.snapshot.data.module;
this.innovationId = this.activatedRoute.snapshot.params.innovationId;
this.innovation = RoutingHelper.getRouteData(this.activatedRoute).innovationData;
Expand All @@ -62,6 +60,10 @@ export class PageInnovationCommentsListComponent extends CoreComponent implement
}


allSectionsSubmitted(): boolean {
return this.innovation.status !== 'CREATED' && this.innovation.status !== '';
}

ngOnInit(): void {

this.subscriptions.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="nhsuk-u-margin-bottom-3"> {{ pageTitle }} </h1>
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">

<p class="nhsuk-hint">Posting a comment will notify who is currently engaging with your innovation.</p>
<p class="nhsuk-hint">All comments can be seen by the innovator, needs assessment team, and selected support organisations depending on the innovator's sharing preferences.</p>

<form [formGroup]="form">
<theme-form-textarea controlName="comment" label="Enter your comment" [pageUniqueField]="false" lengthLimit="large"></theme-form-textarea>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 class="nhsuk-heading-m">{{ module === 'innovator' ? 'Your' : 'Submitted' }}
</ng-container>

<ng-container *ngIf="module === 'accessor'">
<ng-container *ngIf="innovation.support?.status === 'ENGAGING'">
<ng-container *ngIf="innovation.support?.status === 'ENGAGING' || innovation.support?.status === 'FURTHER_INFO_REQUIRED'">
<button routerLink="/accessor/innovations/{{ innovationId }}/action-tracker/new" [queryParams]="{ section: sectionId }" class="nhsuk-button"> Create action for this section </button>
</ng-container>
</ng-container>
Expand Down

0 comments on commit efa107d

Please sign in to comment.