diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index cd844d86..e448e27f 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,37 +1,34 @@ import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; -import { TestBed } from "@angular/core/testing"; +import { TestBed, waitForAsync } from "@angular/core/testing"; import { RouterTestingModule } from "@angular/router/testing"; import { AuthService } from "@shared/services/auth/auth.service"; +import { SharedModule } from "@shared/shared.module"; +import { SpinnerService } from "@shared/services/spinners/spinner-service"; import { MockAuthService, - mostUsedImports, mostUsedServices, testUtilStubs, } from "@shared/test-utils"; import { AppComponent } from "./app.component"; describe("AppComponent", () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ providers: [ - ...mostUsedServices, { provide: AuthService, useClass: MockAuthService }, + ...testUtilStubs, + ...mostUsedServices, + SpinnerService, ], - imports: [RouterTestingModule, ...mostUsedImports], declarations: [AppComponent], + imports: [RouterTestingModule, SharedModule], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); - }); + })); it("should create the app", () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); - - it(`should have as title 'Techinterview.space'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual("Techinterview.space"); - }); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d15887db..378254e3 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -10,15 +10,11 @@ import { untilDestroyed } from "./shared/subscriptions/until-destroyed"; standalone: false, }) export class AppComponent implements OnInit, OnDestroy { - isAuthenticated = false; - title = "Techinterview.space"; - get showAdminNavbar(): boolean { return this.router.url.startsWith("/admin"); } constructor( - private readonly authService: AuthService, private readonly router: Router, ) {} diff --git a/src/app/components/admin-navbar/admin-navbar.component.ts b/src/app/components/admin-navbar/admin-navbar.component.ts index 1187c3bd..7f637a48 100644 --- a/src/app/components/admin-navbar/admin-navbar.component.ts +++ b/src/app/components/admin-navbar/admin-navbar.component.ts @@ -71,6 +71,11 @@ export class AdminNavbarComponent { url: "/admin/salaries/imported-salaries", isExternal: false, }, + { + title: "График исторических данных", + url: "/admin/salaries/historical-data-templates", + isExternal: false, + }, ], }, { diff --git a/src/app/modules/admin/admin-routing.module.ts b/src/app/modules/admin/admin-routing.module.ts index d1e81cb4..475b44be 100644 --- a/src/app/modules/admin/admin-routing.module.ts +++ b/src/app/modules/admin/admin-routing.module.ts @@ -23,6 +23,7 @@ import { GitHubJobsPageComponent } from "./components/github/github-jobs-page/gi import { OpenAiPromptsAdminPageComponent } from "./components/openai-prompts/openai-prompts-admin-page.component"; import { CompanyReviewsStatSubscriptionsComponent } from "./components/telegram/reviews-stat-subscriptions/reviews-stat-subscriptions.component"; import { JobPostingMessageSubscriptionsComponent } from "./components/telegram/job-posting-message-subscriptions/job-posting-message-subscriptions.component"; +import { HistoricalDataTemplatesComponent } from "./components/salaries/historical-data-templates/historical-data-templates.component"; const routes: Routes = [ { path: "", component: AdminStartPageComponent }, @@ -73,6 +74,10 @@ const routes: Routes = [ { path: "github/processing-jobs", component: GitHubJobsPageComponent }, { path: "openai-prompts", component: OpenAiPromptsAdminPageComponent }, + { + path: "salaries/historical-data-templates", + component: HistoricalDataTemplatesComponent, + }, ]; @NgModule({ diff --git a/src/app/modules/admin/admin.module.ts b/src/app/modules/admin/admin.module.ts index 783cbb4b..623b773f 100644 --- a/src/app/modules/admin/admin.module.ts +++ b/src/app/modules/admin/admin.module.ts @@ -4,6 +4,7 @@ import { CommonModule } from "@angular/common"; import { AdminRoutingModule } from "./admin-routing.module"; import { SharedModule } from "@shared/shared.module"; import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { NgSelectModule } from "@ng-select/ng-select"; import { BackgroundJobsComponent } from "./components/background-jobs/background-jobs.component"; import { HealthCheckTableComponent } from "./components/health-check-table/health-check-table.component"; import { JobsTableComponent } from "./components/jobs-table/jobs-table.component"; @@ -36,6 +37,8 @@ import { CompanyReviewsStatSubscriptionsComponent } from "./components/telegram/ import { JobPostingMessageSubscriptionsComponent } from "./components/telegram/job-posting-message-subscriptions/job-posting-message-subscriptions.component"; import { JobPostingMessageSubscriptionsService } from "@services/job-posting-message-subscriptions.service"; import { TelegramSubscriptionsService } from "@services/telegram-subscriptions.service"; +import { HistoricalDataTemplatesComponent } from "./components/salaries/historical-data-templates/historical-data-templates.component"; +import { SalariesHistoricalDataTemplatesService } from "@services/salaries-historical-data-templates.service"; const adminServices = [ AdminDashboardService, @@ -44,6 +47,7 @@ const adminServices = [ CompanyReviewsTelegramSubscriptionsService, JobPostingMessageSubscriptionsService, TelegramSubscriptionsService, + SalariesHistoricalDataTemplatesService, ]; @NgModule({ @@ -74,6 +78,7 @@ const adminServices = [ OpenAiPromptsAdminPageComponent, CompanyReviewsStatSubscriptionsComponent, JobPostingMessageSubscriptionsComponent, + HistoricalDataTemplatesComponent, ], imports: [ CommonModule, @@ -81,6 +86,7 @@ const adminServices = [ AdminRoutingModule, FormsModule, ReactiveFormsModule, + NgSelectModule, ], providers: adminServices, exports: [], diff --git a/src/app/modules/admin/components/companies/companies-admin-page/companies-admin-page.component.html b/src/app/modules/admin/components/companies/companies-admin-page/companies-admin-page.component.html index 9ed0f273..c3ee3443 100644 --- a/src/app/modules/admin/components/companies/companies-admin-page/companies-admin-page.component.html +++ b/src/app/modules/admin/components/companies/companies-admin-page/companies-admin-page.component.html @@ -74,7 +74,7 @@ >
| ID | +Название | +Специальности | +Создано | +Обновлено | +Действия | +
|---|---|---|---|---|---|
| + ...{{ item.id.split('-').pop() }} + | +{{ item.name }} | ++ 0" + href="#" + class="text-primary" + (click)="openProfessionsModal(item.professionIds); $event.preventDefault()" + > + {{ item.professionIds.length }} специальност{{ item.professionIds.length === 1 ? 'ь' : (item.professionIds.length < 5 ? 'и' : 'ей') }} + + - + | +{{ item.createdAt | date: "yyyy-MM-dd HH:mm" }} | +{{ item.updatedAt | date: "yyyy-MM-dd HH:mm" }} | +
+
+
+
+
+ |
+