Skip to content

Commit

Permalink
Merge pull request #144 from nhsengland/develop
Browse files Browse the repository at this point in the history
Release 1.15.0 of the innovation service
  • Loading branch information
JyotiJaiswal169 authored Mar 29, 2022
2 parents 5b95de5 + ffabb6f commit 88335f0
Show file tree
Hide file tree
Showing 59 changed files with 1,524 additions and 334 deletions.
4 changes: 2 additions & 2 deletions src/app/config/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const locale = {
validations: {
equal_to: 'Value does not match',
invalid_email: 'Invalid email',
invalid_format: 'Invalid format.',
invalid_format: 'Invalid format',
invalid_hexadecimal_format: 'Invalid hexadecimal format',
invalid_json_format: 'Invalid JSON format',
invalid_url_format: 'Invalid URL',
Expand All @@ -199,7 +199,7 @@ export const locale = {
min_length: 'Text must have at least {{ maxLength }} characters',
max_length: 'Text cannot exceed {{ maxLength }} characters',
password_mismatch: 'Passwords don\'t appear to match',
password_regex: 'The password must contain at least minimum 8 characters: one uppercase, one lowercase, one number and one special character.',
password_regex: 'The password must contain at least minimum 8 characters: one uppercase, one lowercase, one number and one special character',
required: 'Required'
}
}
Expand Down
27 changes: 21 additions & 6 deletions src/modules/feature-modules/accessor/accessor-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { PageInnovationSupportStatusListComponent } from '@shared-module/pages/i

// Resolvers.
import { InnovationDataResolver } from './resolvers/innovation-data.resolver';
import { PageInnovationCommentsEditComponent } from '@modules/shared/pages/innovation/comments/comments-edit.component';

const routes: Routes = [

Expand Down Expand Up @@ -142,12 +143,26 @@ const routes: Routes = [
data: { layoutOptions: { type: 'innovationLeftAsideMenu', backLink: { url: '/accessor/innovations/:innovationId/action-tracker/:actionId', label: 'Go back' } } }
},
{
path: 'comments', pathMatch: 'full', component: PageInnovationCommentsListComponent,
data: { layoutOptions: { type: 'innovationLeftAsideMenu', backLink: { url: '/accessor/innovations', label: 'Innovations' } } }
},
{
path: 'comments/new', pathMatch: 'full', component: PageInnovationCommentsNewComponent,
data: { layoutOptions: { type: 'emptyLeftAside', backLink: { url: '/accessor/innovations/:innovationId/comments', label: 'Go back' } } }
path: 'comments',
data: { layoutOptions: { type: 'innovationLeftAsideMenu', backLink: { url: '/accessor/innovations', label: 'Innovations' } } },
children: [
{
path: '', component: PageInnovationCommentsListComponent,
pathMatch: 'full'
},
{
path: 'new', pathMatch: 'full', component: PageInnovationCommentsNewComponent,
data: { layoutOptions: { type: 'emptyLeftAside', backLink: { url: '/accessor/innovations/:innovationId/comments', label: 'Go back' } } }
},
{
path: ':commentId', pathMatch: 'full', component: PageInnovationCommentsEditComponent,
data: { layoutOptions: { type: 'emptyLeftAside', backLink: { url: 'innovations/:innovationId/comments', label: 'Go back' } }, subModule: 'comment' }
},
{
path: ':commentId/replies/:replyId', pathMatch: 'full', component: PageInnovationCommentsEditComponent,
data: { layoutOptions: { type: 'emptyLeftAside', backLink: { url: 'innovations/:innovationId/comments', label: 'Go back' } }, subModule: 'reply' }
}
]
},
{
path: 'assessments/:assessmentId', pathMatch: 'full', component: InnovationNeedsAssessmentOverviewComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<router-outlet></router-outlet>

<div class="app-index-navigation app-u-hide-desktop">
<div class="nhsuk-u-padding-top-4 nhsuk-u-padding-bottom-5 app-u-hide-desktop">
<nav class="app-side-nav" role="navigation" aria-label="Main Navigation">

<ul class="nhsuk-list app-side-nav__list">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ActionAdvancedFilterComponent extends CoreComponent implements OnIn
search: new FormControl(),
innovationStatus: new FormArray([]),
innovationSection: new FormArray([])
});
}, { updateOn: 'change' });

anyFilterSelected = false;
filters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export class InnovationActionTrackerEditComponent extends CoreComponent implemen
statusError = '';

form = new FormGroup({
status: new FormControl('', CustomValidators.required('Please choose a status')),
status: new FormControl('', { validators: CustomValidators.required('Please choose a status'), updateOn: 'change' }),
comment: new FormControl('', CustomValidators.required('A comment is required'))
});
}, { updateOn: 'blur' });


constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export class InnovationActionTrackerNewComponent extends CoreComponent {
sectionItems: { value: string, label: string }[] = [];

form = new FormGroup({
section: new FormControl('', CustomValidators.required('Choose at least one section')),
section: new FormControl('', { validators: CustomValidators.required('Choose at least one section'), updateOn: 'change' }),
description: new FormControl('', CustomValidators.required('A description is required'))
});
}, { updateOn: 'blur' });


constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export class InnovationSupportOrganisationsSupportStatusSuggestComponent extends
alert: AlertType = { type: null };

form = new FormGroup({
organisationUnits: new FormArray([], Validators.required),
organisationUnits: new FormArray([], { validators: Validators.required, updateOn: 'change' }),
comment: new FormControl('', CustomValidators.required('A comment is required')),
confirm: new FormControl(false)
});
confirm: new FormControl(false, { updateOn: 'change' })
}, { updateOn: 'blur' });
formSubmitted = false;

groupedItems: Required<FormEngineParameterModel>['groupedItems'] = [];
Expand Down Expand Up @@ -83,43 +83,43 @@ export class InnovationSupportOrganisationsSupportStatusSuggestComponent extends
this.accessorService.getInnovationSupports(this.innovationId, false)
]).subscribe(([organisations, needsAssessmentInfo, supportsInfo]) => {

const needsAssessmentSuggestedOrganisations = needsAssessmentInfo.assessment.organisations.map(item => item.id);
const needsAssessmentSuggestedOrganisations = needsAssessmentInfo.assessment.organisations.map(item => item.id);

this.groupedItems = organisations.map(item => {
this.groupedItems = organisations.map(item => {

const description = needsAssessmentSuggestedOrganisations.includes(item.id) ? 'Suggested by needs assessment' : undefined;
const description = needsAssessmentSuggestedOrganisations.includes(item.id) ? 'Suggested by needs assessment' : undefined;

return {
value: item.id,
label: item.name,
description,
items: item.organisationUnits.map(i => ({
value: i.id,
label: i.name,
description: (item.organisationUnits.length === 1 ? description : undefined),
isEditable: true
})),
};

});
return {
value: item.id,
label: item.name,
description,
items: item.organisationUnits.map(i => ({
value: i.id,
label: i.name,
description: (item.organisationUnits.length === 1 ? description : undefined),
isEditable: true
})),
};

supportsInfo.filter(s => s.status === 'ENGAGING').forEach(s => {
});

(this.form.get('organisationUnits') as FormArray).push(new FormControl(s.organisationUnit.id));
supportsInfo.filter(s => s.status === 'ENGAGING').forEach(s => {

this.groupedItems.forEach(o => {
const ou = o.items.find(i => i.value === s.organisationUnit.id);
if (ou) {
ou.isEditable = false;
ou.label += ` (currently engaging)`;
}
});
(this.form.get('organisationUnits') as FormArray).push(new FormControl(s.organisationUnit.id));

this.groupedItems.forEach(o => {
const ou = o.items.find(i => i.value === s.organisationUnit.id);
if (ou) {
ou.isEditable = false;
ou.label += ` (currently engaging)`;
}
});

this.setPageStatus('READY');
});

},
this.setPageStatus('READY');

},
() => {
this.setPageStatus('ERROR');
this.alert = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export class InnovationSupportUpdateComponent extends CoreComponent implements O
currentStatus: { label: string, cssClass: string, description: string };

form = new FormGroup({
status: new FormControl('', Validators.required),
accessors: new FormArray([]),
status: new FormControl('', { validators: Validators.required, updateOn: 'change' }),
accessors: new FormArray([], { updateOn: 'change' }),
comment: new FormControl('', CustomValidators.required('A comment is required')),
});
}, { updateOn: 'blur' });


constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class InnovationsAdvancedReviewComponent extends CoreComponent implements
supportStatuses: new FormArray([]),
assignedToMe: new FormControl(false),
suggestedOnly: new FormControl(true)
});
}, { updateOn: 'change' });

anyFilterSelected = false;
filters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class InnovationsReviewComponent extends CoreComponent implements OnInit
form = new FormGroup({
assignedToMe: new FormControl(false),
suggestedOnly: new FormControl(true)
});
}, { updateOn: 'change' });

innovationsList: TableModel<(getInnovationsListEndpointOutDTO['data'][0])>;

Expand Down
14 changes: 13 additions & 1 deletion src/modules/feature-modules/admin/admin-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import { PageServiceUsersInfoComponent } from './pages/service-users/service-use
import { PageServiceUsersLockComponent } from './pages/service-users/service-users-lock.component';
import { PageServiceUsersNewComponent } from './pages/service-users/service-users-new/service-users-new.component';
import { PageServiceUsersUnlockComponent } from './pages/service-users/service-users-unlock.component';
import { PageAdminUsersNewComponent } from './pages/admin-users/admin-users-new/admin-users-new.component';

// Resolvers.
import { ServiceUserDataResolver } from './resolvers/service-user-data.resolver';
import { PageListOrganisationsAndUnitsComponent } from './pages/list-organisations-and-units/list-organisations-and-units.component';

const routes: Routes = [

Expand All @@ -34,18 +36,28 @@ const routes: Routes = [
pathMatch: 'full',
component: PageDashboardComponent
},
{
path: 'organisations',
pathMatch: 'full',
component: PageListOrganisationsAndUnitsComponent
},

// NOTE: When creating the future admin-users routes, a guard should be created to protect those routes!
{
path: 'administration-users',
data: { breadcrumb: 'administartion users' },
data: { breadcrumb: 'administration users' },
children: [
{
path: '',
pathMatch: 'full',
data: { breadcrumb: null },
component: PageAdminUsersFindComponent
},
{
path: 'new',
pathMatch: 'full',
component: PageAdminUsersNewComponent
},
{
path: ':userId',
pathMatch: 'full',
Expand Down
6 changes: 5 additions & 1 deletion src/modules/feature-modules/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import { PageServiceUsersNewComponent } from './pages/service-users/service-user
import { PageServiceUsersUnlockComponent } from './pages/service-users/service-users-unlock.component';
import { PageAdminUsersFindComponent } from './pages/admin-users/admin-users-find/admin-users-find.component';
import { PageServiceChangeUserRoleComponent } from './pages/change-user-role/change-user-role.component';
import { PageAdminUsersNewComponent } from './pages/admin-users/admin-users-new/admin-users-new.component';

// Services.
import { ServiceUsersService } from './services/service-users.service';

// Resolvers.
import { ServiceUserDataResolver } from './resolvers/service-user-data.resolver';
import { PageAdminUsersInfoComponent } from './pages/admin-users/admin-users-info/admin-users-info.component';
import { PageListOrganisationsAndUnitsComponent } from './pages/list-organisations-and-units/list-organisations-and-units.component';

@NgModule({
imports: [
Expand All @@ -47,7 +49,9 @@ import { PageAdminUsersInfoComponent } from './pages/admin-users/admin-users-inf
PageServiceUsersUnlockComponent,
PageAdminUsersFindComponent,
PageServiceChangeUserRoleComponent,
PageAdminUsersInfoComponent
PageAdminUsersInfoComponent,
PageListOrganisationsAndUnitsComponent,
PageAdminUsersNewComponent
],
providers: [
// Services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<section class="informational-section">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-one-third">
<h2 class="nhsuk-heading-m">User information</h2>
<h2 class="nhsuk-heading-m">Admin information</h2>
</div>
<div class="nhsuk-grid-column-two-thirds">
<dl class="nhsuk-summary-list">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ActivatedRoute } from '@angular/router';
import { CoreComponent } from '@app/base';
import { AlertType, LinkType } from '@app/base/models';
import { RoutingHelper } from '@modules/core';
import { ServiceUsersService } from '../../../services/service-users.service';

@Component({
selector: 'app-admin-pages-admin-users-info',
Expand All @@ -25,21 +26,45 @@ export class PageAdminUsersInfoComponent extends CoreComponent implements OnInit

constructor(
private activatedRoute: ActivatedRoute,
private serviceUsersService: ServiceUsersService
) {
super();
this.setPageTitle('Admin User information');
this.user = { id: this.activatedRoute.snapshot.params.userId, name: RoutingHelper.getRouteData(this.activatedRoute).user.displayName };

switch (this.activatedRoute.snapshot.queryParams.alert) {
case 'adminCreationSuccess':
this.alert = {
type: 'SUCCESS',
title: 'Admin created successfully',
// message: 'Your suggestions were saved and notifications sent.'
};
break;
default:
break;
}
}

ngOnInit(): void {

this.sections.userInfo = [
{ label: 'Name', value: 'Admin' },
{ label: 'Type', value: 'Admin' },
{ label: 'Email address', value: '[email protected]' }
];
this.setPageStatus('READY');
this.serviceUsersService.getUserFullInfo(this.user.id).subscribe(
response => {
this.sections.userInfo = [
{ label: 'Name', value: response.displayName },
{ label: 'Type', value: response.type },
{ label: 'Email address', value: response.email }
];
this.setPageStatus('READY');
},
error => {
this.setPageStatus('ERROR');
this.alert = {
type: 'ERROR',
title: 'Unable to fetch the necessary information',
message: 'Please try again or contact us for further help'
};
}
);

}

}
Loading

0 comments on commit 88335f0

Please sign in to comment.