diff --git a/modules/ui/src/app/components/empty-message/empty-message.component.html b/modules/ui/src/app/components/empty-message/empty-message.component.html index 46f2281ea..ad15f66f0 100644 --- a/modules/ui/src/app/components/empty-message/empty-message.component.html +++ b/modules/ui/src/app/components/empty-message/empty-message.component.html @@ -22,6 +22,7 @@ {{ header() }} {{ message() }} + {{ messageNext() }} diff --git a/modules/ui/src/app/components/empty-message/empty-message.component.scss b/modules/ui/src/app/components/empty-message/empty-message.component.scss index 33e4a4f95..47ec834e5 100644 --- a/modules/ui/src/app/components/empty-message/empty-message.component.scss +++ b/modules/ui/src/app/components/empty-message/empty-message.component.scss @@ -32,7 +32,7 @@ grid-template-columns: auto 1fr; align-items: end; gap: 32px; - max-width: 764px; + max-width: 886px; .empty-message-img { grid-row: 1 / 3; justify-self: end; @@ -53,8 +53,8 @@ .empty-message-header { font-weight: 400; - line-height: 28px; - font-size: 22px; + line-height: 32px; + font-size: 24px; color: colors.$on-surface; } @@ -63,7 +63,13 @@ font-weight: 400; font-size: 16px; line-height: 24px; - letter-spacing: 0.1px; + letter-spacing: 0px; color: colors.$on-surface-variant; display: block; } + +.empty-message-text { + .empty-message-main.next-line { + padding-top: 0; + } +} diff --git a/modules/ui/src/app/components/empty-message/empty-message.component.ts b/modules/ui/src/app/components/empty-message/empty-message.component.ts index 43a6689a8..bf51345e2 100644 --- a/modules/ui/src/app/components/empty-message/empty-message.component.ts +++ b/modules/ui/src/app/components/empty-message/empty-message.component.ts @@ -26,5 +26,6 @@ export class EmptyMessageComponent { image = input(); header = input(); message = input(); + messageNext = input(); isHorizontal = input(false); } diff --git a/modules/ui/src/app/components/empty-page/empty-page.component.html b/modules/ui/src/app/components/empty-page/empty-page.component.html index 4d67a06cf..c0daf35f8 100644 --- a/modules/ui/src/app/components/empty-page/empty-page.component.html +++ b/modules/ui/src/app/components/empty-page/empty-page.component.html @@ -17,6 +17,7 @@ [image]="image()" [header]="header()" [message]="message()" + [messageNext]="messageNext()" [isHorizontal]="true"> diff --git a/modules/ui/src/app/components/empty-page/empty-page.component.ts b/modules/ui/src/app/components/empty-page/empty-page.component.ts index b5cbb6eda..f3ed1a15e 100644 --- a/modules/ui/src/app/components/empty-page/empty-page.component.ts +++ b/modules/ui/src/app/components/empty-page/empty-page.component.ts @@ -25,4 +25,5 @@ export class EmptyPageComponent { image = input(); header = input(); message = input(); + messageNext = input(); } diff --git a/modules/ui/src/app/components/list-layout/list-layout.component.scss b/modules/ui/src/app/components/list-layout/list-layout.component.scss index d18d8380d..9677b1a8d 100644 --- a/modules/ui/src/app/components/list-layout/list-layout.component.scss +++ b/modules/ui/src/app/components/list-layout/list-layout.component.scss @@ -19,6 +19,8 @@ :host { position: relative; + height: 100%; + display: block; } .entity-list app-list-item:has(.selected) { diff --git a/modules/ui/src/app/model/layout-type.ts b/modules/ui/src/app/model/layout-type.ts index 54c6fcc14..736e1ae3b 100644 --- a/modules/ui/src/app/model/layout-type.ts +++ b/modules/ui/src/app/model/layout-type.ts @@ -16,5 +16,5 @@ export enum LayoutType { Device = 'Devices', - Profile = 'Risk Assessement', + Profile = 'Risk Assessment', } diff --git a/modules/ui/src/app/pages/devices/devices.component.html b/modules/ui/src/app/pages/devices/devices.component.html index 2a2c2a207..77d0666e8 100644 --- a/modules/ui/src/app/pages/devices/devices.component.html +++ b/modules/ui/src/app/pages/devices/devices.component.html @@ -50,7 +50,8 @@ + message="To begin testing, you'll need to configure at least one device." + messageNext="Please proceed with the device creation process."> diff --git a/modules/ui/src/app/pages/devices/devices.component.scss b/modules/ui/src/app/pages/devices/devices.component.scss index a584068e2..9256ecf33 100644 --- a/modules/ui/src/app/pages/devices/devices.component.scss +++ b/modules/ui/src/app/pages/devices/devices.component.scss @@ -22,8 +22,5 @@ } .device-add-button { - font-family: variables.$font-text; - margin-bottom: 12px; - width: fit-content; - height: 56px; + @include mixins.add-button; } diff --git a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.html b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.html index 620712a2f..b8f47ed3f 100644 --- a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.html +++ b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.html @@ -14,56 +14,69 @@ limitations under the License. --> - - - - - Risk assessment - - - - - - - - - - Saved profiles - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - New Risk Assessment - - + + + + + + + + add + Create Risk Profile + diff --git a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.scss b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.scss index db1453086..1fbbf41ff 100644 --- a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.scss +++ b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.scss @@ -17,19 +17,8 @@ @use 'variables'; @use 'mixins'; -:host { - overflow: hidden; - display: flex; -} - -.risk-assessment-content-empty { - @include mixins.content-empty; -} - -:host:has(.profiles-drawer) { - .risk-assessment-content-empty { - width: calc(100% - #{variables.$profiles-drawer-width}); - } +.risk-assessment-add-button { + @include mixins.add-button; } .risk-assessment-container, diff --git a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.spec.ts b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.spec.ts index 4ef34fe46..ae09f468c 100644 --- a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.spec.ts +++ b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.spec.ts @@ -95,7 +95,7 @@ describe('RiskAssessmentComponent', () => { expect(component).toBeTruthy(); }); - describe('with no data', () => { + describe('with no profiles data', () => { beforeEach(() => { component.viewModel$ = of({ profiles: [] as Profile[], @@ -106,7 +106,31 @@ describe('RiskAssessmentComponent', () => { fixture.detectChanges(); }); - it('should have "New Risk Assessment" button', () => { + it('should have title', () => { + const title = compiled.querySelector('h2.title'); + const titleContent = title?.innerHTML.trim(); + + expect(title).toBeTruthy(); + expect(titleContent).toContain('Risk Assessment'); + }); + + it('should have empty page with necessary content', () => { + const emptyHeader = compiled.querySelector( + 'app-empty-page .empty-message-header' + ); + const emptyMessage = compiled.querySelector( + 'app-empty-page .empty-message-main' + ); + + expect(emptyHeader).toBeTruthy(); + expect(emptyHeader?.innerHTML).toContain('Risk assessment'); + expect(emptyMessage).toBeTruthy(); + expect(emptyMessage?.innerHTML).toContain( + 'complete a brief risk questionnaire' + ); + }); + + it('should have "Create Risk Profile" button', () => { const newRiskAssessmentBtn = compiled.querySelector( '.risk-assessment-add-button' ); @@ -122,21 +146,13 @@ describe('RiskAssessmentComponent', () => { newRiskAssessmentBtn.click(); fixture.detectChanges(); - const toolbarEl = compiled.querySelector('.risk-assessment-toolbar'); const title = compiled.querySelector('h2.title'); const titleContent = title?.innerHTML.trim(); - const profileForm = compiled.querySelectorAll('app-profile-form'); + // const profileForm = compiled.querySelectorAll('app-profile-form'); - expect(toolbarEl).not.toBeNull(); expect(title).toBeTruthy(); - expect(titleContent).toContain('Risk assessment'); - expect(profileForm).toBeTruthy(); - }); - - it('should not have profiles drawer', () => { - const profilesDrawer = compiled.querySelector('.profiles-drawer'); - - expect(profilesDrawer).toBeFalsy(); + expect(titleContent).toContain('Risk Assessment'); + // expect(profileForm).toBeTruthy(); }); }); @@ -150,17 +166,12 @@ describe('RiskAssessmentComponent', () => { fixture.detectChanges(); }); - it('should have profiles drawer', () => { - const profilesDrawer = compiled.querySelector('.profiles-drawer'); - - expect(profilesDrawer).toBeTruthy(); - }); - - it('should have profile items', () => { - const profileItems = compiled.querySelectorAll('app-profile-item'); - - expect(profileItems.length).toEqual(2); - }); + // TODO: change after profile items are added/updated + // it('should have profile items', () => { + // const profileItems = compiled.querySelectorAll('app-profile-item'); + // + // expect(profileItems.length).toEqual(2); + // }); describe('#deleteProfile', () => { it('should open delete profile modal', fakeAsync(() => { diff --git a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.ts b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.ts index 75ee9b9fe..b711e3a75 100644 --- a/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.ts +++ b/modules/ui/src/app/pages/risk-assessment/risk-assessment.component.ts @@ -42,6 +42,10 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { ProfileFormComponent } from './profile-form/profile-form.component'; +import { MatIconModule } from '@angular/material/icon'; +import { EmptyPageComponent } from '../../components/empty-page/empty-page.component'; +import { ListLayoutComponent } from '../../components/list-layout/list-layout.component'; +import { LayoutType } from '../../model/layout-type'; const matFormFieldDefaultOptions: MatFormFieldDefaultOptions = { hideRequiredMarker: true, @@ -55,9 +59,12 @@ const matFormFieldDefaultOptions: MatFormFieldDefaultOptions = { CommonModule, MatToolbarModule, MatButtonModule, + MatIconModule, ReactiveFormsModule, MatInputModule, MatSidenavModule, + EmptyPageComponent, + ListLayoutComponent, ProfileFormComponent, ProfileItemComponent, ], @@ -71,6 +78,7 @@ const matFormFieldDefaultOptions: MatFormFieldDefaultOptions = { changeDetection: ChangeDetectionStrategy.OnPush, }) export class RiskAssessmentComponent implements OnInit, OnDestroy { + readonly LayoutType = LayoutType; private store = inject(RiskAssessmentStore); dialog = inject(MatDialog); private liveAnnouncer = inject(LiveAnnouncer); diff --git a/modules/ui/src/assets/icons/empty-profiles.svg b/modules/ui/src/assets/icons/empty-profiles.svg new file mode 100644 index 000000000..07e36e80b --- /dev/null +++ b/modules/ui/src/assets/icons/empty-profiles.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/ui/src/styles.scss b/modules/ui/src/styles.scss index 6d13bddd4..b45d2ebf4 100644 --- a/modules/ui/src/styles.scss +++ b/modules/ui/src/styles.scss @@ -436,12 +436,6 @@ body #main { gap: 4px !important; } - app-risk-assessment:has(.profiles-drawer) { - .risk-assessment-content-empty { - width: calc(100% - $profiles-drawer-width-xs) !important; - } - } - app-risk-assessment .main-content { width: auto !important; padding: 16px 4px !important; diff --git a/modules/ui/src/theming/mixins.scss b/modules/ui/src/theming/mixins.scss index 60481194e..987875d86 100644 --- a/modules/ui/src/theming/mixins.scss +++ b/modules/ui/src/theming/mixins.scss @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@use 'variables'; + @mixin dialog { display: grid; overflow: hidden; @@ -66,3 +68,13 @@ opacity: 0.5; pointer-events: none; } + +@mixin add-button { + font-family: variables.$font-text; + margin-bottom: 12px; + width: fit-content; + height: 56px; + padding-left: 30px; + font-size: 16px; + font-weight: 500; +}