Fixed test
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
ab2309c958
commit
22ee53e9db
|
@ -31,7 +31,7 @@ import {
|
|||
} from "./components/groups/components/client-main-view/partition-assistant/partition-assistant.component";
|
||||
import {RepositoriesComponent} from "./components/repositories/repositories.component";
|
||||
import {
|
||||
CreateImageComponent
|
||||
CreateClientImageComponent
|
||||
} from "./components/groups/components/client-main-view/create-image/create-image.component";
|
||||
import {
|
||||
DeployImageComponent
|
||||
|
@ -66,7 +66,7 @@ const routes: Routes = [
|
|||
{ path: 'clients/deploy-image', component: DeployImageComponent },
|
||||
{ path: 'clients/partition-assistant', component: PartitionAssistantComponent },
|
||||
{ path: 'clients/:id', component: ClientMainViewComponent },
|
||||
{ path: 'clients/:id/create-image', component: CreateImageComponent },
|
||||
{ path: 'clients/:id/create-image', component: CreateClientImageComponent },
|
||||
{ path: 'images', component: ImagesComponent },
|
||||
{ path: 'repositories', component: RepositoriesComponent },
|
||||
{ path: 'repository/:id', component: MainRepositoryViewComponent },
|
||||
|
|
|
@ -101,6 +101,7 @@ import {MatSliderModule} from '@angular/material/slider';
|
|||
import { ClientMainViewComponent } from './components/groups/components/client-main-view/client-main-view.component';
|
||||
import { ImagesComponent } from './components/images/images.component';
|
||||
import { CreateImageComponent } from './components/images/create-image/create-image.component';
|
||||
import { CreateClientImageComponent} from './components/groups/components/client-main-view/create-image/create-image.component';
|
||||
import { PartitionAssistantComponent } from './components/groups/components/client-main-view/partition-assistant/partition-assistant.component';
|
||||
import { SoftwareComponent } from './components/software/software.component';
|
||||
import { CreateSoftwareComponent } from './components/software/create-software/create-software.component';
|
||||
|
@ -172,6 +173,7 @@ export function HttpLoaderFactory(http: HttpClient) {
|
|||
CreateCommandComponent,
|
||||
CalendarComponent,
|
||||
CreateCalendarComponent,
|
||||
CreateClientImageComponent,
|
||||
CreateCalendarRuleComponent,
|
||||
CommandsGroupsComponent,
|
||||
CommandsTaskComponent,
|
||||
|
@ -203,7 +205,7 @@ export function HttpLoaderFactory(http: HttpClient) {
|
|||
EnvVarsComponent,
|
||||
MenusComponent,
|
||||
CreateMenuComponent,
|
||||
CreateMultipleClientComponent
|
||||
CreateMultipleClientComponent,
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
imports: [BrowserModule,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="header-container">
|
||||
<div class="header-container-title">
|
||||
<h2 joyrideStep="groupsTitleStepText" text="{{ 'groupsTitleStepText' | translate }}">
|
||||
<h2 >
|
||||
Crear imagen desde {{ clientName }}
|
||||
</h2>
|
||||
</div>
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CreateImageComponent } from './create-image.component';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('CreateImageComponent', () => {
|
||||
let component: CreateImageComponent;
|
||||
let fixture: ComponentFixture<CreateImageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CreateImageComponent,
|
||||
ReactiveFormsModule,
|
||||
MatDialogModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatCheckboxModule,
|
||||
MatButtonModule,
|
||||
MatTabsModule,
|
||||
MatTableModule,
|
||||
MatPaginatorModule,
|
||||
BrowserAnimationsModule,
|
||||
ToastrModule.forRoot(),
|
||||
TranslateModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
ToastrService,
|
||||
provideHttpClient(),
|
||||
provideHttpClientTesting(),
|
||||
{
|
||||
provide: MatDialogRef,
|
||||
useValue: {}
|
||||
},
|
||||
{
|
||||
provide: MAT_DIALOG_DATA,
|
||||
useValue: {}
|
||||
},
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
useValue: {
|
||||
snapshot: {
|
||||
paramMap: {
|
||||
get: (key: string) => 'valorSimulado'
|
||||
}
|
||||
},
|
||||
params: of({ id: 'valorSimulado' })
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(CreateImageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -2,65 +2,14 @@ import {Component, EventEmitter, Output} from '@angular/core';
|
|||
import {HttpClient} from "@angular/common/http";
|
||||
import {ToastrService} from "ngx-toastr";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {MatButton} from "@angular/material/button";
|
||||
import {MatDivider} from "@angular/material/divider";
|
||||
import {NgForOf, NgIf} from "@angular/common";
|
||||
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
|
||||
import {
|
||||
MatCell, MatCellDef,
|
||||
MatColumnDef,
|
||||
MatHeaderCell,
|
||||
MatHeaderCellDef, MatHeaderRow, MatHeaderRowDef, MatRow, MatRowDef,
|
||||
MatTable,
|
||||
MatTableDataSource
|
||||
} from "@angular/material/table";
|
||||
import {MatChip} from "@angular/material/chips";
|
||||
import {MatCheckbox} from "@angular/material/checkbox";
|
||||
import {MatTableDataSource} from "@angular/material/table";
|
||||
import {SelectionModel} from "@angular/cdk/collections";
|
||||
import {MatRadioButton, MatRadioGroup} from "@angular/material/radio";
|
||||
import {MatFormField, MatLabel} from "@angular/material/form-field";
|
||||
import {MatOption} from "@angular/material/autocomplete";
|
||||
import {MatSelect} from "@angular/material/select";
|
||||
import {MatInput} from "@angular/material/input";
|
||||
import {JoyrideModule} from "ngx-joyride";
|
||||
import {TranslatePipe} from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-create-image',
|
||||
templateUrl: './create-image.component.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatButton,
|
||||
MatDivider,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
ReactiveFormsModule,
|
||||
MatTable,
|
||||
MatColumnDef,
|
||||
MatHeaderCell,
|
||||
MatHeaderCellDef,
|
||||
MatCell,
|
||||
MatCellDef,
|
||||
MatChip,
|
||||
MatHeaderRow,
|
||||
MatRow,
|
||||
MatHeaderRowDef,
|
||||
MatRowDef,
|
||||
MatCheckbox,
|
||||
MatRadioGroup,
|
||||
MatRadioButton,
|
||||
MatFormField,
|
||||
MatLabel,
|
||||
MatOption,
|
||||
MatSelect,
|
||||
MatInput,
|
||||
FormsModule,
|
||||
JoyrideModule,
|
||||
TranslatePipe
|
||||
],
|
||||
styleUrl: './create-image.component.css'
|
||||
})
|
||||
export class CreateImageComponent {
|
||||
export class CreateClientImageComponent {
|
||||
baseUrl: string = import.meta.env.NG_APP_BASE_API_URL;
|
||||
@Output() dataChange = new EventEmitter<any>();
|
||||
|
||||
|
@ -114,7 +63,6 @@ export class CreateImageComponent {
|
|||
|
||||
ngOnInit() {
|
||||
this.clientId = this.route.snapshot.paramMap.get('id');
|
||||
|
||||
this.loadPartitions();
|
||||
this.loadImages();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="header-container">
|
||||
<div class="header-container-title">
|
||||
<h2 joyrideStep="groupsTitleStepText" text="{{ 'groupsTitleStepText' | translate }}">
|
||||
Despliegue de imagen
|
||||
<h2>
|
||||
{{ 'deployImage' | translate }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="subnets-button-row">
|
||||
|
|
|
@ -17,6 +17,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import {MatExpansionModule} from "@angular/material/expansion";
|
||||
|
||||
describe('DeployImageComponent', () => {
|
||||
let component: DeployImageComponent;
|
||||
|
@ -32,6 +33,7 @@ describe('DeployImageComponent', () => {
|
|||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatCheckboxModule,
|
||||
MatExpansionModule,
|
||||
MatButtonModule,
|
||||
MatTableModule,
|
||||
MatDividerModule,
|
||||
|
|
|
@ -100,7 +100,7 @@ export class DeployImageComponent {
|
|||
) {
|
||||
const navigation = this.router.getCurrentNavigation();
|
||||
this.clientData = navigation?.extras?.state?.['clientData'];
|
||||
this.clientId = this.clientData[0]['@id'];
|
||||
this.clientId = this.clientData?.[0]['@id'];
|
||||
this.loadImages();
|
||||
this.loadPartitions()
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import { JoyrideModule } from 'ngx-joyride';
|
|||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatTreeModule } from '@angular/material/tree';
|
||||
import { TreeNode } from './model/model';
|
||||
import {ExecuteCommandComponent} from "../commands/main-commands/execute-command/execute-command.component";
|
||||
|
||||
describe('GroupsComponent', () => {
|
||||
let component: GroupsComponent;
|
||||
|
@ -32,7 +33,7 @@ describe('GroupsComponent', () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [GroupsComponent],
|
||||
declarations: [GroupsComponent, ExecuteCommandComponent],
|
||||
imports: [
|
||||
HttpClientTestingModule,
|
||||
ToastrModule.forRoot(),
|
||||
|
@ -120,4 +121,4 @@ describe('GroupsComponent', () => {
|
|||
component.expandPathToNode(node);
|
||||
expect(component.expandPathToNode).toHaveBeenCalledWith(node);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -253,7 +253,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
private expandPathToNode(node: TreeNode): void {
|
||||
expandPathToNode(node: TreeNode): void {
|
||||
const path: TreeNode[] = [];
|
||||
let currentNode: TreeNode | null = node;
|
||||
|
||||
|
@ -318,23 +318,6 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
getNodeIcon(node: TreeNode): string {
|
||||
switch (node.type) {
|
||||
case NodeType.OrganizationalUnit:
|
||||
return 'apartment';
|
||||
case NodeType.ClassroomsGroup:
|
||||
return 'doors';
|
||||
case NodeType.Classroom:
|
||||
return 'school';
|
||||
case NodeType.ClientsGroup:
|
||||
return 'lan';
|
||||
case NodeType.Client:
|
||||
return 'computer';
|
||||
default:
|
||||
return 'group';
|
||||
}
|
||||
}
|
||||
|
||||
addOU(event: MouseEvent, parent: TreeNode | null = null): void {
|
||||
event.stopPropagation();
|
||||
const dialogRef = this.dialog.open(CreateOrganizationalUnitComponent, {
|
||||
|
@ -486,22 +469,6 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
);
|
||||
}
|
||||
|
||||
fetchCommands(): void {
|
||||
this.commandsLoading = true;
|
||||
this.subscriptions.add(
|
||||
this.http.get<{ 'hydra:member': Command[] }>(`${this.baseUrl}/commands?page=1&itemsPerPage=30`).subscribe(
|
||||
(response) => {
|
||||
this.commands = response['hydra:member'];
|
||||
this.commandsLoading = false;
|
||||
},
|
||||
(error) => {
|
||||
console.error('Error fetching commands:', error);
|
||||
this.commandsLoading = false;
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
executeCommand(command: Command, selectedNode: TreeNode | null): void {
|
||||
|
||||
if (!selectedNode) {
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"diskUsedLabel": "Used",
|
||||
"diskTotalLabel": "Total",
|
||||
"diskImageAssistantTitle": "Disk image assistant",
|
||||
"deployImage": "Deploy image",
|
||||
"partitionColumn": "Partition",
|
||||
"isoImageColumn": "ISO Image",
|
||||
"ogliveColumn": "OgLive",
|
||||
|
|
|
@ -273,6 +273,7 @@
|
|||
"isoImageColumn": "Imagen ISO",
|
||||
"ogliveColumn": "OgLive",
|
||||
"selectImageOption": "Seleccionar imagen",
|
||||
"deployImage": "Desplegar imagen",
|
||||
"selectOgLiveOption": "Seleccionar OgLive",
|
||||
"saveAssociationsButton": "Guardar Asociaciones",
|
||||
"partitionAssistantTitle": "Asistente de particionado",
|
||||
|
|
Loading…
Reference in New Issue