Skip to content

Commit

Permalink
New Features:
Browse files Browse the repository at this point in the history
New Pages:
1. Load Test Chooser Page
Bugs Corrected:
1. Dates where not being sorted corrctly in the software testing chooser page
To Be Corrected:
0. On product delete, delete trace results
1. On product delete, delete flamegraph result
  • Loading branch information
juanfranciscocis committed Sep 16, 2024
1 parent 1e2f975 commit abe4843
Show file tree
Hide file tree
Showing 18 changed files with 186 additions and 89 deletions.
32 changes: 15 additions & 17 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,42 +147,40 @@ const routes: Routes = [
loadChildren: () => import('./pages/software_testing/system_tests/execute-system-test/execute-system-test.module').then(m => m.ExecuteSystemTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},







{
path: 'board',
loadChildren: () => import('./pages/board/board.module').then( m => m.BoardPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'render-restart',
loadChildren: () => import('./pages/render-restart/render-restart.module').then( m => m.RenderRestartPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'view-history-system-test',
loadChildren: () => import('./pages/software_testing/system_tests/view-history-system-test/view-history-system-test.module').then(m => m.ViewHistorySystemTestPageModule)
loadChildren: () => import('./pages/software_testing/system_tests/view-history-system-test/view-history-system-test.module').then(m => m.ViewHistorySystemTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'view-system-test',
loadChildren: () => import('./pages/software_testing/system_tests/view-system-test/view-system-test.module').then(m => m.ViewSystemTestPageModule)
loadChildren: () => import('./pages/software_testing/system_tests/view-system-test/view-system-test.module').then(m => m.ViewSystemTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'create-unit-test',
loadChildren: () => import('./pages/software_testing/unit_tests/create-unit-test/create-unit-test.module').then( m => m.CreateUnitTestPageModule)
loadChildren: () => import('./pages/software_testing/unit_tests/create-unit-test/create-unit-test.module').then( m => m.CreateUnitTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'settings',
loadChildren: () => import('./pages/settings/settings.module').then( m => m.SettingsPageModule)
loadChildren: () => import('./pages/settings/settings.module').then( m => m.SettingsPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'create-integration-test',
loadChildren: () => import('./pages/software_testing/integration_tests/create-integration-test/create-integration-test.module').then( m => m.CreateIntegrationTestPageModule)
loadChildren: () => import('./pages/software_testing/integration_tests/create-integration-test/create-integration-test.module').then( m => m.CreateIntegrationTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'load-test-chooser',
loadChildren: () => import('./pages/load_test/load-test-chooser/load-test-chooser.module').then( m => m.LoadTestChooserPageModule),
...canActivate(redirectUnauthorizedToLogin),
},

];
Expand Down
5 changes: 5 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export class AppComponent implements OnInit {
url: '/software-testing',
icon: 'flask'
},
{
title:'Load Test',
url:'/load-test-chooser',
icon:'barbell'
},
{
title: 'My Team',
url: '/myteam',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { RenderRestartPage } from './render-restart.page';
import { LoadTestChooserPage } from './load-test-chooser.page';

const routes: Routes = [
{
path: '',
component: RenderRestartPage
component: LoadTestChooserPage
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class RenderRestartPageRoutingModule {}
export class LoadTestChooserPageRoutingModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { IonicModule } from '@ionic/angular';

import { LoadTestChooserPageRoutingModule } from './load-test-chooser-routing.module';

import { LoadTestChooserPage } from './load-test-chooser.page';
import {ComponentsModule} from "../../../components/components.module";

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
LoadTestChooserPageRoutingModule,
ComponentsModule
],
declarations: [LoadTestChooserPage]
})
export class LoadTestChooserPageModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<app-header [title]="'Load Test Chooser'"></app-header>

<ion-content [fullscreen]="true">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content></ion-refresher-content>
</ion-refresher>

<ion-grid>
<app-title [title]="'Load Test Chooser'"></app-title>
<ion-row class="lg:m-10 md:m-10">
<ion-col size="12" size-md="4" size-lg="4" class="">
<p>Choose a product and a product step to load test the product step.</p>
</ion-col>
</ion-row>
<ion-row class="lg:m-10 md:m-10">
<ion-col size="12" size-md="4" size-lg="4" class="" *ngFor="let product of products">
<ion-card>
<ion-card-header>
<ion-card-title>{{ product.productObjective }}</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-list>
<ion-item *ngFor="let step of product.productSteps" (click)="navigateToLoadTest(product, step)">
<ion-label>{{ step }}</ion-label>
<ion-icon name="arrow-forward" color="primary"></ion-icon>
</ion-item>
</ion-list>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoadTestChooserPage } from './load-test-chooser.page';

describe('LoadTestChooserPage', () => {
let component: LoadTestChooserPage;
let fixture: ComponentFixture<LoadTestChooserPage>;

beforeEach(() => {
fixture = TestBed.createComponent(LoadTestChooserPage);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Component, OnInit } from '@angular/core';
import {Product} from "../../../interfaces/product";
import {ProductService} from "../../../services/product.service";
import {Router} from "@angular/router";
import {LoadingController} from "@ionic/angular";
import {User} from "../../../interfaces/user";

@Component({
selector: 'app-load-test-chooser',
templateUrl: './load-test-chooser.page.html',
styleUrls: ['./load-test-chooser.page.scss'],
})
export class LoadTestChooserPage implements OnInit {
products: Product[] = [];

/**
* @constructor
* @param {ProductService} productService - The service to handle product operations.
* @param {Router} router - The router object to handle routing operations.
*/
constructor(
private productService: ProductService,
private router: Router,
private loadingCtrl: LoadingController
) {
}

ngOnInit() {
}

/**
* @method ionViewWillEnter
* @description Lifecycle hook that is called when the page is about to enter and become the active page.
*/
async ionViewWillEnter() {
await this.showLoading();
this.getAllProducts();
await this.hideLoading();
}

/**
* @method getAllProducts
* @description Fetches all products for the current user's organization.
*/
async getAllProducts(){
const userString = localStorage.getItem('user');
if (!userString) {
return;
}
const user: User = JSON.parse(userString);
const orgName = user.orgName!;
this.products = await this.productService.getProducts(orgName);
}

/**
* @method doRefresh
* @description Refreshes the product list.
* @param {any} $event - The event object.
*/
async doRefresh($event: any) {
this.getAllProducts().then(() => {
$event.target.complete();
});
}

async navigateToLoadTest(product: Product, step: string) {
await this.router.navigate(['/load-test', {productObjective: product.productObjective, step: step}]);
}


/**
* Show a loading spinner.
*/
async showLoading() {
const loading = await this.loadingCtrl.create({
});
await loading.present();
}

/**
* Hide the loading spinner.
*/
async hideLoading() {
await this.loadingCtrl.dismiss();
}
}
20 changes: 0 additions & 20 deletions src/app/pages/render-restart/render-restart.module.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/pages/render-restart/render-restart.page.html

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/pages/render-restart/render-restart.page.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/pages/render-restart/render-restart.page.ts

This file was deleted.

1 change: 0 additions & 1 deletion www/2580.dd2d37daccf76d3f.js

This file was deleted.

1 change: 1 addition & 0 deletions www/4163.dd6bee594e4d801a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

<body>
<app-root></app-root>
<script src="runtime.df8961418ea268d0.js" type="module"></script><script src="polyfills.e9ea84778c1ce49f.js" type="module"></script><script src="main.456b85accee6d028.js" type="module"></script></body>
<script src="runtime.3e5492d526293db2.js" type="module"></script><script src="polyfills.e9ea84778c1ce49f.js" type="module"></script><script src="main.599eeda2e5aeff8f.js" type="module"></script></body>

</html>
1 change: 0 additions & 1 deletion www/main.456b85accee6d028.js

This file was deleted.

1 change: 1 addition & 0 deletions www/main.599eeda2e5aeff8f.js

Large diffs are not rendered by default.

Loading

0 comments on commit abe4843

Please sign in to comment.