-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.Logic to see a product detail New Pages: Bugs Corrected: To Be Corrected: 1.Delete a product 2. Edit a product
- Loading branch information
1 parent
7c0c5ff
commit 95108dc
Showing
18 changed files
with
210 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { ViewProductPage } from './view-product.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: ViewProductPage | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class ViewProductPageRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { ViewProductPageRoutingModule } from './view-product-routing.module'; | ||
|
||
import { ViewProductPage } from './view-product.page'; | ||
import {ComponentsModule} from "../../components/components.module"; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
IonicModule, | ||
ViewProductPageRoutingModule, | ||
ComponentsModule | ||
], | ||
declarations: [ViewProductPage] | ||
}) | ||
export class ViewProductPageModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
<app-header [title]=product.productObjective!></app-header> | ||
|
||
|
||
<ion-content [fullscreen]="true"> | ||
<div class="flex flex-col flex-grow lg:flex-row md:flex-row min-w-full h-full"> | ||
<ion-card class="flex flex-col flex-grow"> | ||
<ion-card-header class="flex flex-row justify-center"> | ||
<ion-card-title>Product Steps</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<ion-list #stepList> | ||
@for (step of product.productSteps; track step){ | ||
<ion-item> | ||
<ion-input value="{{step}}"></ion-input> | ||
</ion-item> | ||
} | ||
</ion-list> | ||
</ion-card-content> | ||
</ion-card> | ||
<ion-card class="flex flex-col flex-grow"> | ||
<ion-card-header class="flex flex-row justify-center"> | ||
<ion-card-title>Product Services</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<ion-list> | ||
@for (step of product.productServices; track step){ | ||
<ion-item> | ||
<ion-input value="{{step}}"></ion-input> | ||
</ion-item> | ||
} | ||
</ion-list> | ||
</ion-card-content> | ||
</ion-card> | ||
<ion-card class="flex flex-col flex-grow"> | ||
<ion-card-header class="flex flex-row justify-center"> | ||
<ion-card-title>Product SLOs</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<ion-list> | ||
@for (step of product.productSLOs; track step){ | ||
<ion-item> | ||
<ion-input value="{{step}}"></ion-input> | ||
</ion-item> | ||
} | ||
</ion-list> | ||
</ion-card-content> | ||
</ion-card> | ||
</div> | ||
<div class="flex flex-row justify-center items-center mt-auto"> | ||
<ion-item-divider color="light"> | ||
<div class="flex justify-center items-center min-w-full p-4"> | ||
<div class="p-1"> | ||
<ion-button color="success">Add Step</ion-button> | ||
</div> | ||
<div class="p-1"> | ||
<ion-button color="primary" (click)="getAllInputValues()">Edit Product</ion-button> | ||
</div> | ||
<div class="p-1"> | ||
<ion-button color="danger">Delete Product</ion-button> | ||
</div> | ||
</div> | ||
</ion-item-divider> | ||
</div> | ||
|
||
|
||
|
||
|
||
</ion-content> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { ViewProductPage } from './view-product.page'; | ||
|
||
describe('ViewProductPage', () => { | ||
let component: ViewProductPage; | ||
let fixture: ComponentFixture<ViewProductPage>; | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ViewProductPage); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import {Component, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core'; | ||
import {Product} from "../../interfaces/product"; | ||
import {ActivatedRoute} from "@angular/router"; | ||
import {IonInput, IonList} from "@ionic/angular"; | ||
|
||
@Component({ | ||
selector: 'app-view-product', | ||
templateUrl: './view-product.page.html', | ||
styleUrls: ['./view-product.page.scss'], | ||
}) | ||
export class ViewProductPage implements OnInit { | ||
/** | ||
* Product object. | ||
*/ | ||
product: Product = { | ||
productObjective: '', | ||
productSteps: [], | ||
productServices: [], | ||
productSLOs: [] | ||
} | ||
|
||
@ViewChildren(IonInput) inputs: QueryList<IonInput> | undefined; | ||
|
||
constructor( | ||
private route: ActivatedRoute | ||
) { } | ||
|
||
async ngOnInit() { | ||
this.getProductFromParams(); | ||
} | ||
|
||
|
||
|
||
|
||
getProductFromParams() { | ||
// Get product from URL params | ||
this.route.queryParams.subscribe(params => { | ||
this.product = JSON.parse(params['product']); | ||
}); | ||
console.log(this.product); | ||
|
||
} | ||
|
||
|
||
getAllInputValues() { | ||
const inputValues = this.inputs!.map(input => input.value); | ||
|
||
//dividing the input values into productSteps, productServices, and productSLOs | ||
const itemsPerSection = this.product!.productSteps!.length; | ||
|
||
const productSteps = inputValues.slice(0, itemsPerSection); | ||
const productServices = inputValues.slice(itemsPerSection, itemsPerSection * 2); | ||
const productSLOs = inputValues.slice(itemsPerSection * 2, itemsPerSection * 3); | ||
|
||
console.log(productSteps); | ||
console.log(productServices); | ||
console.log(productSLOs); | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.