From 2b43753e546b85ad3aea411df9636b23153fb9d8 Mon Sep 17 00:00:00 2001 From: schencej Date: Mon, 9 Dec 2019 17:46:39 -0500 Subject: added pre cooking page --- recipeBuddy/src/app/app-routing.module.ts | 2 ++ recipeBuddy/src/app/app.module.ts | 12 ++++++----- .../pre-cook-pop-up/pre-cook-pop-up.component.css | 0 .../pre-cook-pop-up/pre-cook-pop-up.component.html | 13 +++++++++++ .../pre-cook-pop-up.component.spec.ts | 25 ++++++++++++++++++++++ .../pre-cook-pop-up/pre-cook-pop-up.component.ts | 24 +++++++++++++++++++++ 6 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.css create mode 100644 recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.html create mode 100644 recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.spec.ts create mode 100644 recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.ts diff --git a/recipeBuddy/src/app/app-routing.module.ts b/recipeBuddy/src/app/app-routing.module.ts index a6e4399..3e4d67a 100644 --- a/recipeBuddy/src/app/app-routing.module.ts +++ b/recipeBuddy/src/app/app-routing.module.ts @@ -2,9 +2,11 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { CookPageComponent } from './cook-page/cook-page.component'; +import { PreCookPopUpComponent } from './pre-cook-pop-up/pre-cook-pop-up.component'; const routes: Routes = [ { path: '', redirectTo: '/cook', pathMatch: 'full' }, + {path: 'preCook' , component: PreCookPopUpComponent }, { path: 'cook', component: CookPageComponent } ]; diff --git a/recipeBuddy/src/app/app.module.ts b/recipeBuddy/src/app/app.module.ts index eaa0553..9b7a049 100644 --- a/recipeBuddy/src/app/app.module.ts +++ b/recipeBuddy/src/app/app.module.ts @@ -2,20 +2,22 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatCardModule } from '@angular/material'; +import { MatDialogModule } from '@angular/material'; import { AppComponent } from './app.component'; import { CookPageComponent} from './cook-page/cook-page.component'; -import { StepCardComponent } from './cook-page/step-card/step-card.component'; import { AppRoutingModule } from './app-routing.module'; -import {HttpClientModule } from '@angular/common/http' +import { HttpClientModule } from '@angular/common/http'; +import { PreCookPopUpComponent } from './pre-cook-pop-up/pre-cook-pop-up.component'; +import { RecipePassService } from './recipePass/recipe-pass.service' @NgModule({ declarations: [ AppComponent, CookPageComponent, - StepCardComponent + PreCookPopUpComponent, ], imports: [ BrowserModule, @@ -23,7 +25,7 @@ import {HttpClientModule } from '@angular/common/http' MatCardModule, HttpClientModule ], - providers: [], - bootstrap: [AppComponent] + providers: [RecipePassService], + bootstrap: [AppComponent], }) export class AppModule { } diff --git a/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.css b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.css new file mode 100644 index 0000000..e69de29 diff --git a/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.html b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.html new file mode 100644 index 0000000..dc87efd --- /dev/null +++ b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.html @@ -0,0 +1,13 @@ +
+{{cookedRecipe.name}} +
+ Serving Size: {{cookedRecipe.servingSize}} +
+
Ingredients: +
  • + {{ing.name}}, {{ing.amount}} unit: {{ing.units}} + +
  • +
    + + diff --git a/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.spec.ts b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.spec.ts new file mode 100644 index 0000000..b355855 --- /dev/null +++ b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PreCookPopUpComponent } from './pre-cook-pop-up.component'; + +describe('PreCookPopUpComponent', () => { + let component: PreCookPopUpComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PreCookPopUpComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PreCookPopUpComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.ts b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.ts new file mode 100644 index 0000000..396784d --- /dev/null +++ b/recipeBuddy/src/app/pre-cook-pop-up/pre-cook-pop-up.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { RecipePassService } from '../RecipePass/recipe-pass.service'; +import { Recipe } from '../DataModels/recipe'; +import { BackendService } from '../REST_service/backend.service'; + +@Component({ + selector: 'app-pre-cook-pop-up', + templateUrl: './pre-cook-pop-up.component.html', + styleUrls: ['./pre-cook-pop-up.component.css'] +}) +export class PreCookPopUpComponent implements OnInit { + + cookedRecipe: Recipe; + + constructor(private recipePass: RecipePassService, private backend: BackendService) { } + + ngOnInit() { + this.backend.getRecipe(1).subscribe(res => + { + this.cookedRecipe = res + }); + //this.recipeToBeCooked = this.recipePass.getRecipe(); + } +} -- cgit v1.1 From 365d78a6a7884b21fe588df9d502240c4c52bf05 Mon Sep 17 00:00:00 2001 From: schencej Date: Tue, 10 Dec 2019 22:22:35 -0500 Subject: added funcitonality to cook-page --- .../src/app/cook-page/cook-page.component.css | 14 +---- .../src/app/cook-page/cook-page.component.html | 4 +- .../src/app/cook-page/cook-page.component.ts | 69 +++++++++++++--------- 3 files changed, 47 insertions(+), 40 deletions(-) diff --git a/recipeBuddy/src/app/cook-page/cook-page.component.css b/recipeBuddy/src/app/cook-page/cook-page.component.css index 4f44224..b2b97e5 100644 --- a/recipeBuddy/src/app/cook-page/cook-page.component.css +++ b/recipeBuddy/src/app/cook-page/cook-page.component.css @@ -1,14 +1,3 @@ -.previous-step { - -} - -.current-step { - -} - -.next-step { -} - .previous { margin: auto; width: 200px; @@ -17,6 +6,7 @@ align: center; text-align: center; grid-column: 1; + background-color: grey; } @@ -28,6 +18,7 @@ border: solid; text-align: center; grid-column: 2; + background-color: grey; } .next { @@ -38,6 +29,7 @@ align: center; text-align: center; grid-column: 3; + background-color: grey; } diff --git a/recipeBuddy/src/app/cook-page/cook-page.component.html b/recipeBuddy/src/app/cook-page/cook-page.component.html index db1c0a8..c0a00d1 100644 --- a/recipeBuddy/src/app/cook-page/cook-page.component.html +++ b/recipeBuddy/src/app/cook-page/cook-page.component.html @@ -1,4 +1,5 @@
    + Serving {{servingSize}}