diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 823c9cb..8f54269 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -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), }, ]; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9a250b3..5071af8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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', diff --git a/src/app/pages/render-restart/render-restart-routing.module.ts b/src/app/pages/load_test/load-test-chooser/load-test-chooser-routing.module.ts similarity index 61% rename from src/app/pages/render-restart/render-restart-routing.module.ts rename to src/app/pages/load_test/load-test-chooser/load-test-chooser-routing.module.ts index 34e4432..9e95713 100644 --- a/src/app/pages/render-restart/render-restart-routing.module.ts +++ b/src/app/pages/load_test/load-test-chooser/load-test-chooser-routing.module.ts @@ -1,12 +1,12 @@ 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 } ]; @@ -14,4 +14,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class RenderRestartPageRoutingModule {} +export class LoadTestChooserPageRoutingModule {} diff --git a/src/app/pages/load_test/load-test-chooser/load-test-chooser.module.ts b/src/app/pages/load_test/load-test-chooser/load-test-chooser.module.ts new file mode 100644 index 0000000..a6636c9 --- /dev/null +++ b/src/app/pages/load_test/load-test-chooser/load-test-chooser.module.ts @@ -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 {} diff --git a/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.html b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.html new file mode 100644 index 0000000..5a09b5f --- /dev/null +++ b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + Choose a product and a product step to load test the product step. + + + + + + + {{ product.productObjective }} + + + + + {{ step }} + + + + + + + + + diff --git a/src/app/pages/render-restart/render-restart.page.scss b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.scss similarity index 100% rename from src/app/pages/render-restart/render-restart.page.scss rename to src/app/pages/load_test/load-test-chooser/load-test-chooser.page.scss diff --git a/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.spec.ts b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.spec.ts new file mode 100644 index 0000000..82c9bca --- /dev/null +++ b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.spec.ts @@ -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; + + beforeEach(() => { + fixture = TestBed.createComponent(LoadTestChooserPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.ts b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.ts new file mode 100644 index 0000000..1159af8 --- /dev/null +++ b/src/app/pages/load_test/load-test-chooser/load-test-chooser.page.ts @@ -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(); + } +} diff --git a/src/app/pages/render-restart/render-restart.module.ts b/src/app/pages/render-restart/render-restart.module.ts deleted file mode 100644 index 5f8aebc..0000000 --- a/src/app/pages/render-restart/render-restart.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { RenderRestartPageRoutingModule } from './render-restart-routing.module'; - -import { RenderRestartPage } from './render-restart.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - RenderRestartPageRoutingModule - ], - declarations: [RenderRestartPage] -}) -export class RenderRestartPageModule {} diff --git a/src/app/pages/render-restart/render-restart.page.html b/src/app/pages/render-restart/render-restart.page.html deleted file mode 100644 index 2b2abec..0000000 --- a/src/app/pages/render-restart/render-restart.page.html +++ /dev/null @@ -1,13 +0,0 @@ - - - render-restart - - - - - - - render-restart - - - diff --git a/src/app/pages/render-restart/render-restart.page.spec.ts b/src/app/pages/render-restart/render-restart.page.spec.ts deleted file mode 100644 index 761ecfd..0000000 --- a/src/app/pages/render-restart/render-restart.page.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { RenderRestartPage } from './render-restart.page'; - -describe('RenderRestartPage', () => { - let component: RenderRestartPage; - let fixture: ComponentFixture; - - beforeEach(() => { - fixture = TestBed.createComponent(RenderRestartPage); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/render-restart/render-restart.page.ts b/src/app/pages/render-restart/render-restart.page.ts deleted file mode 100644 index c5e7a0e..0000000 --- a/src/app/pages/render-restart/render-restart.page.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-render-restart', - templateUrl: './render-restart.page.html', - styleUrls: ['./render-restart.page.scss'], -}) -export class RenderRestartPage implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/www/2580.dd2d37daccf76d3f.js b/www/2580.dd2d37daccf76d3f.js deleted file mode 100644 index e61c766..0000000 --- a/www/2580.dd2d37daccf76d3f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2580],{2580:(f,d,a)=>{a.r(d),a.d(d,{RenderRestartPageModule:()=>g});var R=a(177),u=a(4341),s=a(7863),l=a(7650),t=a(4438);const c=[{path:"",component:(()=>{var e;class r{constructor(){}ngOnInit(){}}return(e=r).\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.VBU({type:e,selectors:[["app-render-restart"]],decls:9,vars:2,consts:[[3,"translucent"],[3,"fullscreen"],["collapse","condense"],["size","large"]],template:function(n,p){1&n&&(t.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title"),t.EFF(3,"render-restart"),t.k0s()()(),t.j41(4,"ion-content",1)(5,"ion-header",2)(6,"ion-toolbar")(7,"ion-title",3),t.EFF(8,"render-restart"),t.k0s()()()()),2&n&&(t.Y8G("translucent",!0),t.R7$(4),t.Y8G("fullscreen",!0))},dependencies:[s.W9,s.eU,s.BC,s.ai]}),r})()}];let i=(()=>{var e;class r{}return(e=r).\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({imports:[l.iI.forChild(c),l.iI]}),r})(),g=(()=>{var e;class r{}return(e=r).\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({imports:[R.MD,u.YN,s.bv,i]}),r})()}}]); \ No newline at end of file diff --git a/www/4163.dd6bee594e4d801a.js b/www/4163.dd6bee594e4d801a.js new file mode 100644 index 0000000..09afcd7 --- /dev/null +++ b/www/4163.dd6bee594e4d801a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4163],{5553:(C,h,r)=>{r.d(h,{h:()=>c});var g=r(177),m=r(7863),n=r(4438);let c=(()=>{var i;class o{}return(i=o).\u0275fac=function(f){return new(f||i)},i.\u0275mod=n.$C({type:i}),i.\u0275inj=n.G2t({imports:[g.MD,m.bv]}),o})()},4163:(C,h,r)=>{r.r(h),r.d(h,{LoadTestChooserPageModule:()=>y});var g=r(177),m=r(4341),n=r(7863),c=r(7650),i=r(467),o=r(4438),p=r(6241),f=r(385),v=r(8453);function T(t,d){if(1&t){const a=o.RV6();o.j41(0,"ion-item",7),o.bIt("click",function(){const s=o.eBV(a).$implicit,l=o.XpG().$implicit,u=o.XpG();return o.Njj(u.navigateToLoadTest(l,s))}),o.j41(1,"ion-label"),o.EFF(2),o.k0s(),o.nrm(3,"ion-icon",8),o.k0s()}if(2&t){const a=d.$implicit;o.R7$(2),o.JRh(a)}}function L(t,d){if(1&t&&(o.j41(0,"ion-col",4)(1,"ion-card")(2,"ion-card-header")(3,"ion-card-title"),o.EFF(4),o.k0s()(),o.j41(5,"ion-card-content")(6,"ion-list"),o.DNE(7,T,4,1,"ion-item",6),o.k0s()()()()),2&t){const a=d.$implicit;o.R7$(4),o.JRh(a.productObjective),o.R7$(3),o.Y8G("ngForOf",a.productSteps)}}const P=[{path:"",component:(()=>{var t;class d{constructor(e,s,l){this.productService=e,this.router=s,this.loadingCtrl=l,this.products=[]}ngOnInit(){}ionViewWillEnter(){var e=this;return(0,i.A)(function*(){yield e.showLoading(),e.getAllProducts(),yield e.hideLoading()})()}getAllProducts(){var e=this;return(0,i.A)(function*(){const s=localStorage.getItem("user");if(!s)return;const u=JSON.parse(s).orgName;e.products=yield e.productService.getProducts(u)})()}doRefresh(e){var s=this;return(0,i.A)(function*(){s.getAllProducts().then(()=>{e.target.complete()})})()}navigateToLoadTest(e,s){var l=this;return(0,i.A)(function*(){yield l.router.navigate(["/load-test",{productObjective:e.productObjective,step:s}])})()}showLoading(){var e=this;return(0,i.A)(function*(){yield(yield e.loadingCtrl.create({})).present()})()}hideLoading(){var e=this;return(0,i.A)(function*(){yield e.loadingCtrl.dismiss()})()}}return(t=d).\u0275fac=function(e){return new(e||t)(o.rXU(p.b),o.rXU(c.Ix),o.rXU(n.Xi))},t.\u0275cmp=o.VBU({type:t,selectors:[["app-load-test-chooser"]],decls:12,vars:4,consts:[[3,"title"],[3,"fullscreen"],["slot","fixed",3,"ionRefresh"],[1,"lg:m-10","md:m-10"],["size","12","size-md","4","size-lg","4",1,""],["size","12","size-md","4","size-lg","4","class","",4,"ngFor","ngForOf"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["name","arrow-forward","color","primary"]],template:function(e,s){1&e&&(o.nrm(0,"app-header",0),o.j41(1,"ion-content",1)(2,"ion-refresher",2),o.bIt("ionRefresh",function(u){return s.doRefresh(u)}),o.nrm(3,"ion-refresher-content"),o.k0s(),o.j41(4,"ion-grid"),o.nrm(5,"app-title",0),o.j41(6,"ion-row",3)(7,"ion-col",4)(8,"p"),o.EFF(9,"Choose a product and a product step to load test the product step."),o.k0s()()(),o.j41(10,"ion-row",3),o.DNE(11,L,8,2,"ion-col",5),o.k0s()()()),2&e&&(o.Y8G("title","Load Test Chooser"),o.R7$(),o.Y8G("fullscreen",!0),o.R7$(4),o.Y8G("title","Load Test Chooser"),o.R7$(6),o.Y8G("ngForOf",s.products))},dependencies:[g.Sq,n.b_,n.I9,n.ME,n.tN,n.hU,n.W9,n.lO,n.iq,n.uz,n.he,n.nf,n.To,n.Ki,n.ln,f.l,v.W]}),d})()}];let M=(()=>{var t;class d{}return(t=d).\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.$C({type:t}),t.\u0275inj=o.G2t({imports:[c.iI.forChild(P),c.iI]}),d})();var R=r(5553);let y=(()=>{var t;class d{}return(t=d).\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.$C({type:t}),t.\u0275inj=o.G2t({imports:[g.MD,m.YN,n.bv,M,R.h]}),d})()}}]); \ No newline at end of file diff --git a/www/index.html b/www/index.html index 5482f88..0c0752c 100644 --- a/www/index.html +++ b/www/index.html @@ -21,6 +21,6 @@ - +
Choose a product and a product step to load test the product step.