diff --git a/src/main/webapp/app/admin/admin.module.ts b/src/main/webapp/app/admin/admin.module.ts index 1d5d5e8314ed..0a236665c96d 100644 --- a/src/main/webapp/app/admin/admin.module.ts +++ b/src/main/webapp/app/admin/admin.module.ts @@ -75,6 +75,7 @@ const ENTITY_STATES = [...adminState]; StandardizedCompetencyDetailComponent, DeleteUsersButtonComponent, ProfilePictureComponent, + AdminImportStandardizedCompetenciesComponent, BuildAgentSummaryComponent, BuildAgentDetailsComponent, ], @@ -102,7 +103,6 @@ const ENTITY_STATES = [...adminState]; StandardizedCompetencyEditComponent, KnowledgeAreaEditComponent, StandardizedCompetencyManagementComponent, - AdminImportStandardizedCompetenciesComponent, ], }) export class ArtemisAdminModule {} diff --git a/src/main/webapp/app/admin/standardized-competencies/import/admin-import-standardized-competencies.component.ts b/src/main/webapp/app/admin/standardized-competencies/import/admin-import-standardized-competencies.component.ts index a61113395a00..bd63f1306106 100644 --- a/src/main/webapp/app/admin/standardized-competencies/import/admin-import-standardized-competencies.component.ts +++ b/src/main/webapp/app/admin/standardized-competencies/import/admin-import-standardized-competencies.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { faBan, faChevronRight, faFileImport, faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; import { KnowledgeAreaDTO, @@ -18,6 +18,12 @@ import { ActivatedRoute, Router } from '@angular/router'; import { MatTreeNestedDataSource } from '@angular/material/tree'; import { NestedTreeControl } from '@angular/cdk/tree'; import { getIcon } from 'app/entities/competency.model'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { ArtemisSharedModule } from 'app/shared/shared.module'; +import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; +import { StandardizedCompetencyDetailComponent } from 'app/shared/standardized-competencies/standardized-competency-detail.component'; +import { KnowledgeAreaTreeComponent } from 'app/shared/standardized-competencies/knowledge-area-tree.component'; +import { ArtemisMarkdownModule } from 'app/shared/markdown.module'; interface ImportCount { knowledgeAreas: number; @@ -26,7 +32,9 @@ interface ImportCount { @Component({ selector: 'jhi-admin-import-standardized-competencies', + standalone: true, templateUrl: './admin-import-standardized-competencies.component.html', + imports: [ArtemisSharedModule, ArtemisSharedComponentModule, ArtemisMarkdownModule, FontAwesomeModule, StandardizedCompetencyDetailComponent, KnowledgeAreaTreeComponent], }) export class AdminImportStandardizedCompetenciesComponent { protected isLoading = false; @@ -76,12 +84,10 @@ export class AdminImportStandardizedCompetenciesComponent { } \`\`\``; - public constructor( - private alertService: AlertService, - private adminStandardizedCompetencyService: AdminStandardizedCompetencyService, - private activatedRoute: ActivatedRoute, - private router: Router, - ) {} + private alertService = inject(AlertService); + private adminStandardizedCompetencyService = inject(AdminStandardizedCompetencyService); + private activatedRoute = inject(ActivatedRoute); + private router = inject(Router); /** * Verifies the file (only .json, smaller than 20 MB) and then tries to read the importData from it diff --git a/src/test/javascript/spec/component/standardized-competencies/admin-import-standardized-competencies.spec.ts b/src/test/javascript/spec/component/standardized-competencies/admin-import-standardized-competencies.spec.ts index 15ce0871d27a..cea5d75e4e6e 100644 --- a/src/test/javascript/spec/component/standardized-competencies/admin-import-standardized-competencies.spec.ts +++ b/src/test/javascript/spec/component/standardized-competencies/admin-import-standardized-competencies.spec.ts @@ -1,6 +1,6 @@ import { ArtemisTestModule } from '../../test.module'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MockComponent, MockPipe, MockProvider } from 'ng-mocks'; +import { MockComponent, MockModule, MockPipe, MockProvider } from 'ng-mocks'; import { AdminImportStandardizedCompetenciesComponent } from 'app/admin/standardized-competencies/import/admin-import-standardized-competencies.component'; import { HtmlForMarkdownPipe } from 'app/shared/pipes/html-for-markdown.pipe'; import { KnowledgeAreaTreeStubComponent } from './knowledge-area-tree-stub.component'; @@ -15,6 +15,11 @@ import { HttpResponse } from '@angular/common/http'; import { of } from 'rxjs'; import { KnowledgeAreasForImportDTO } from 'app/entities/competency/standardized-competency.model'; import { StandardizedCompetencyDetailComponent } from 'app/shared/standardized-competencies/standardized-competency-detail.component'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { ArtemisSharedModule } from '../../../../../main/webapp/app/shared/shared.module'; +import { ArtemisSharedComponentModule } from '../../../../../main/webapp/app/shared/components/shared-component.module'; +import { KnowledgeAreaTreeComponent } from '../../../../../main/webapp/app/shared/standardized-competencies/knowledge-area-tree.component'; +import { ArtemisMarkdownModule } from '../../../../../main/webapp/app/shared/markdown.module'; describe('AdminImportStandardizedCompetenciesComponent', () => { let componentFixture: ComponentFixture; @@ -29,6 +34,12 @@ describe('AdminImportStandardizedCompetenciesComponent', () => { KnowledgeAreaTreeStubComponent, MockComponent(ButtonComponent), MockComponent(StandardizedCompetencyDetailComponent), + MockModule(ArtemisSharedModule), + MockModule(ArtemisSharedComponentModule), + MockModule(ArtemisMarkdownModule), + MockModule(FontAwesomeModule), + MockComponent(StandardizedCompetencyDetailComponent), + MockComponent(KnowledgeAreaTreeComponent), ], providers: [{ provide: Router, useClass: MockRouter }, MockProvider(AlertService)], })