-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cb2-10210): add M145 statement (#1374)
* feat(cb2-10210): add M145 statement * feat(cb2-10210): use custom view component for styling + labelling
- Loading branch information
1 parent
63e4835
commit 2f3b427
Showing
11 changed files
with
126 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...orms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<ng-container *ngIf="control"> | ||
<table class="govuk-table m-0"> | ||
<tbody class="govuk-table__body"> | ||
<tr class="govuk-table__row"> | ||
<td class="govuk-table__cell border-b-0" [style.width.%]="30"> | ||
<b>M145:</b> | ||
</td> | ||
<td class="govuk-table__cell border-b-0 break-words">{{ control.value | defaultNullOrEmpty }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ng-container> |
11 changes: 11 additions & 0 deletions
11
...orms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.m-0 { | ||
margin: 0; | ||
} | ||
|
||
.break-words { | ||
word-break: break-word; | ||
} | ||
|
||
.border-b-0 { | ||
border-bottom-width: 0; | ||
} |
41 changes: 41 additions & 0 deletions
41
...s/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { | ||
FormsModule, NG_VALUE_ACCESSOR, NgControl, ReactiveFormsModule, | ||
} from '@angular/forms'; | ||
import { DynamicFormsModule } from '@forms/dynamic-forms.module'; | ||
import { CustomFormControl, FormNodeTypes } from '@forms/services/dynamic-form.types'; | ||
import { provideMockStore } from '@ngrx/store/testing'; | ||
import { State, initialAppState } from '@store/index'; | ||
import { AdrTankDetailsM145ViewComponent } from './adr-tank-details-m145-view.component'; | ||
|
||
describe('AdrTankDetailsM145ViewComponent', () => { | ||
let component: AdrTankDetailsM145ViewComponent; | ||
let fixture: ComponentFixture<AdrTankDetailsM145ViewComponent>; | ||
|
||
const control = new CustomFormControl({ | ||
name: 'techRecord_adrDetails_m145Statement', | ||
type: FormNodeTypes.CONTROL, | ||
value: [], | ||
}); | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [AdrTankDetailsM145ViewComponent], | ||
imports: [DynamicFormsModule, FormsModule, ReactiveFormsModule], | ||
providers: [ | ||
provideMockStore<State>({ initialState: initialAppState }), | ||
{ provide: NG_VALUE_ACCESSOR, useExisting: AdrTankDetailsM145ViewComponent, multi: true }, | ||
{ provide: NgControl, useValue: { control } }, | ||
], | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AdrTankDetailsM145ViewComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
.../forms/custom-sections/adr-tank-details-m145-view/adr-tank-details-m145-view.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { BaseControlComponent } from '@forms/components/base-control/base-control.component'; | ||
|
||
@Component({ | ||
selector: 'app-adr-tank-details-m145-view', | ||
templateUrl: './adr-tank-details-m145-view.component.html', | ||
styleUrls: ['./adr-tank-details-m145-view.component.scss'], | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: AdrTankDetailsM145ViewComponent, | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
export class AdrTankDetailsM145ViewComponent extends BaseControlComponent { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters