Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Migrate standard competencies admin import component #9911

Merged
merged 6 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 0 additions & 2 deletions src/main/webapp/app/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { UserImportModule } from 'app/shared/user-import/user-import.module';
import { SubmissionResultStatusModule } from 'app/overview/submission-result-status.module';
import { BuildAgentDetailsComponent } from 'app/localci/build-agents/build-agent-details/build-agent-details/build-agent-details.component';
import { KnowledgeAreaEditComponent } from 'app/admin/standardized-competencies/knowledge-area-edit.component';
import { AdminImportStandardizedCompetenciesComponent } from 'app/admin/standardized-competencies/import/admin-import-standardized-competencies.component';
import { KnowledgeAreaTreeComponent } from 'app/shared/standardized-competencies/knowledge-area-tree.component';
import { StandardizedCompetencyFilterComponent } from 'app/shared/standardized-competencies/standardized-competency-filter.component';
import { StandardizedCompetencyDetailComponent } from 'app/shared/standardized-competencies/standardized-competency-detail.component';
Expand Down Expand Up @@ -102,7 +101,6 @@ const ENTITY_STATES = [...adminState];
StandardizedCompetencyEditComponent,
KnowledgeAreaEditComponent,
StandardizedCompetencyManagementComponent,
AdminImportStandardizedCompetenciesComponent,
],
})
export class ArtemisAdminModule {}
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -76,12 +84,12 @@ 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);

public constructor() {}

ole-ve marked this conversation as resolved.
Show resolved Hide resolved
ole-ve marked this conversation as resolved.
Show resolved Hide resolved
/**
* Verifies the file (only .json, smaller than 20 MB) and then tries to read the importData from it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@ 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<AdminImportStandardizedCompetenciesComponent>;
let component: AdminImportStandardizedCompetenciesComponent;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ArtemisTestModule, NgbCollapseMocksModule],
imports: [
ole-ve marked this conversation as resolved.
Show resolved Hide resolved
ArtemisTestModule,
NgbCollapseMocksModule,
FontAwesomeModule,
ArtemisSharedModule,
ArtemisSharedComponentModule,
StandardizedCompetencyDetailComponent,
KnowledgeAreaTreeComponent,
ArtemisMarkdownModule,
],
ole-ve marked this conversation as resolved.
Show resolved Hide resolved
declarations: [
AdminImportStandardizedCompetenciesComponent,
MockPipe(HtmlForMarkdownPipe),
Expand Down
Loading