Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 71 additions & 57 deletions src/app/components/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { UserRole } from '@models/enums';
import { ApplicationUserExtended } from '@models/extended';
import { HealthCheckService } from '@shared/health-check/health-check.service';
import { AuthService } from '@shared/services/auth/auth.service';
import { SpinnerService } from '@shared/services/spinners/spinner-service';
import { untilDestroyed } from '@shared/subscriptions/until-destroyed';
import { _getFocusedElementPierceShadowDom } from "@angular/cdk/platform";
import { Component, OnDestroy, OnInit } from "@angular/core";
import { UserRole } from "@models/enums";
import { ApplicationUserExtended } from "@models/extended";
import { HealthCheckService } from "@shared/health-check/health-check.service";
import { AuthService } from "@shared/services/auth/auth.service";
import { SpinnerService } from "@shared/services/spinners/spinner-service";
import { untilDestroyed } from "@shared/subscriptions/until-destroyed";

interface NavbarLink {
title: string;
Expand All @@ -19,9 +20,9 @@ interface NavbarDropdown {
}

@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss']
selector: "app-navbar",
templateUrl: "./navbar.component.html",
styleUrls: ["./navbar.component.scss"],
})
export class NavbarComponent implements OnInit, OnDestroy {
loginButtonAvailable = false;
Expand Down Expand Up @@ -69,10 +70,12 @@ export class NavbarComponent implements OnInit, OnDestroy {
}

private setupSubscribers(): void {
this.authService.loggedOutInvoked$.pipe(untilDestroyed(this)).subscribe(() => {
this.currentUser = null;
this.renderNavbar();
});
this.authService.loggedOutInvoked$
.pipe(untilDestroyed(this))
.subscribe(() => {
this.currentUser = null;
this.renderNavbar();
});

this.authService.loggedOut$.pipe(untilDestroyed(this)).subscribe(() => {
this.currentUser = null;
Expand All @@ -90,55 +93,66 @@ export class NavbarComponent implements OnInit, OnDestroy {

this.dropdowns = [
{
title: 'Interviews',
title: "Interviews",
show: hasCurrentUser && this.currentUser!.hasRole(UserRole.Interviewer),
links: [
{
title: 'Start an interview',
url: '/interviews/create',
show: true
title: "Start an interview",
url: "/interviews/create",
show: true,
},
{
title: 'My interviews',
url: '/interviews/my',
show: true
}
]
title: "My interviews",
url: "/interviews/my",
show: true,
},
],
},
{
title: 'Templates',
title: "Templates",
show: true,
links: [
{
title: 'Create a template',
url: '/interviews/templates/create',
show: hasCurrentUser && this.currentUser!.hasRole(UserRole.Interviewer)
title: "Create a template",
url: "/interviews/templates/create",
show:
hasCurrentUser && this.currentUser!.hasRole(UserRole.Interviewer),
},
{
title: 'My templates',
url: '/interviews/templates/my',
show: hasCurrentUser && this.currentUser!.hasRole(UserRole.Interviewer)
title: "My templates",
url: "/interviews/templates/my",
show:
hasCurrentUser && this.currentUser!.hasRole(UserRole.Interviewer),
},
{
title: 'Public templates',
url: '/interviews/templates/public',
show: true
}
]
title: "Public templates",
url: "/interviews/templates/public",
show: true,
},
],
},
{
title: 'Salaries',
title: "Salaries",
show: true,
links: [
{
title: 'Salaries chart',
url: '/salaries',
show: true
title: "Salaries chart",
url: "/salaries",
show: true,
},
]
}
],
},
];

if (window.innerWidth <= 768) {
const navbarContent = document.getElementById("navbarSupportedContent");
const navbarToggler = document.querySelector(".navbar-toggler");
navbarContent?.classList.add("d-none");
navbarToggler?.addEventListener("click", function () {
navbarContent?.classList.toggle("d-none");
});
}

if (hasCurrentUser && this.currentUser!.organizations.length === 1) {
const orgName = this.currentUser!.organizations[0].organization.name;
const organizationId = this.currentUser!.organizations[0].organizationId;
Expand All @@ -148,41 +162,41 @@ export class NavbarComponent implements OnInit, OnDestroy {
show: true,
links: [
{
title: 'Open organization',
title: "Open organization",
url: `/organizations/${organizationId}`,
show: true
show: true,
},
{
title: 'Recruitment pipeline board',
title: "Recruitment pipeline board",
url: `/boards/${organizationId}/recruitment-pipeline`,
show: true
show: true,
},
{
title: 'Interviews',
title: "Interviews",
url: `/organizations/${organizationId}/interviews`,
show: true
show: true,
},
{
title: 'Interview templates',
title: "Interview templates",
url: `/organizations/${organizationId}/interview-templates`,
show: true
show: true,
},
{
title: 'Candidate cards',
title: "Candidate cards",
url: `/organizations/${organizationId}/candidate-cards`,
show: true
show: true,
},
{
title: 'Candidates',
title: "Candidates",
url: `/organizations/${organizationId}/candidates`,
show: true
show: true,
},
{
title: 'Labels',
title: "Labels",
url: `/organizations/${organizationId}/labels`,
show: true
}
]
show: true,
},
],
});
}
}
Expand Down
34 changes: 28 additions & 6 deletions src/app/modules/home/components/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
<div class="col-sm d-flex align-items-end">
<div class="d-inline-block my-5">
<div class="display-1">Tech.Interview</div>
<div class="lead">Conduct an interview. Make your notes. Create templates.</div>
<div class="lead">
Conduct an interview. Make your notes. Create templates.
</div>
</div>
</div>
<div class="col-sm">
<img src="/assets/img/Job-Interview-vector.png" alt="Interviewer" class="img-fluid" />
<img
src="/assets/img/Job-Interview-vector.png"
alt="Interviewer"
class="img-fluid"
/>
</div>
</div>
</div>
Expand All @@ -21,8 +27,15 @@
<div class="mt-3 feature-subtitle">{{ hint.subtitle }}</div>
</div>
<div class="col-sm-8">
<div *ngIf="hint.showPreloader" class="h-100 d-flex justify-content-center align-items-center">
<div class="spinner-border" style="width: 3rem; height: 3rem" role="status">
<div
*ngIf="hint.showPreloader"
class="h-100 d-flex justify-content-center align-items-center"
>
<div
class="spinner-border"
style="width: 3rem; height: 3rem"
role="status"
>
<span class="visually-hidden">Loading...</span>
</div>
</div>
Expand Down Expand Up @@ -52,9 +65,18 @@

<div class="feature bg-white">
<div class="container">
<div class="feature-title">Ready to start? Just create your first interview or template</div>
<div class="feature-title text-center">
Ready to start? Just create your first interview or template
</div>
<div class="mt-5">
<button type="button" class="btn btn-huge btn-primary" (click)="getStarted()">{{ getStartedButtonTitle }}</button>
<button
type="button"
class="btn btn-huge btn-primary mx-auto"
style="display: flex; justify-content: center"
(click)="getStarted()"
>
{{ getStartedButtonTitle }}
</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="row">
<div class="col-md-4 col-sm-12 mb-4" *ngFor="let card of cards">
<div class="card h-100 shadow-lg d-flex align-items-start flex-column">
<div class="card h-100 shadow-lg d-flex align-items-center flex-column">
<div class="card-body">
<div class="text-center p-3">
<div class="h4 card-title">{{ card.title }}</div>
Expand Down Expand Up @@ -51,5 +51,7 @@
</ng-template>

<ng-template #disabledButton>
<button class="btn btn-outline-primary btn-lg disabled" disabled>Coming soon</button>
<button class="btn btn-outline-primary btn-lg disabled" disabled>
Coming soon
</button>
</ng-template>