Ignore:
Timestamp:
11/23/21 14:58:44 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
e29cc2e
Parents:
ceaed42
Message:

adding photos

Location:
trip-planner-front/src/app/location
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/src/app/location/add-location-to-planner-panel/add-location-to-planner-panel.component.html

    rceaed42 r59329aa  
    1313  </form>
    1414 
    15   <button mat-button (click)="onCancelClick()">Cancel</button>
     15  <button type="button"  mat-button (click)="onCancelClick()">Cancel</button>
  • trip-planner-front/src/app/location/add-location-to-planner-panel/add-location-to-planner-panel.component.ts

    rceaed42 r59329aa  
    11import { Component, OnInit } from '@angular/core';
    2 import { NgForm } from '@angular/forms';
    32import { MatDialogRef } from '@angular/material/dialog';
    43import { ActivatedRoute } from '@angular/router';
     
    2120  locationId: number;
    2221  plannerLocationDto: PlannerLocationDto;
     22  locationsInPlanner: Location[];
     23
    2324
    2425  constructor(private dialogRef: MatDialogRef<AddLocationToPlannerPanelComponent>, private plannerService: PlannerService,
     
    2930    this.locationId = 1;
    3031    this.plannerLocationDto = new PlannerLocationDto();
     32    this.locationsInPlanner = [];
    3133  }
    3234
     
    5658    this.plannerLocationDto.locationId = this.locationId;
    5759    this.plannerLocationDto.plannerId = plannerId;
     60    /*
    5861    this.locationService.postLocationToPlanner(this.plannerLocationDto).subscribe(
    5962      data => {
     
    6164      }
    6265    );
    63   }
     66    */
     67
     68   // window.location.reload();
     69    }
    6470
    6571}
  • trip-planner-front/src/app/location/location.component.html

    rceaed42 r59329aa  
    1818      <td>{{location.name}}</td>
    1919      <td><button mat-raised-button color="primary" (click)="openDialogSave(location.id)">Add to my planner</button></td>
    20       <td><button mat-raised-button color="primary">See details</button></td>
     20      <td><button mat-raised-button color="primary" (click)="onClickSeeDetails(location.id)">See details</button></td>
    2121    </tr> 
    2222  </tbody>
  • trip-planner-front/src/app/location/location.component.ts

    rceaed42 r59329aa  
    1 import { Route } from '@angular/compiler/src/core';
    21import { Component, Input, OnInit, Output } from '@angular/core';
    32import { FormBuilder, FormGroup, Validators } from '@angular/forms';
    43import { MatDialog } from '@angular/material/dialog';
    54import { ActivatedRoute, Router } from '@angular/router';
    6 import { Location } from '../_models/location';
    75import { LocationService } from '../_services/location.service';
    86import { AddLocationToPlannerPanelComponent } from './add-location-to-planner-panel/add-location-to-planner-panel.component';
     
    2422  regionOption: boolean = false;
    2523  regionId: number;
     24  locationId: number;
    2625
    2726  constructor(private fb: FormBuilder, private route: ActivatedRoute, private locationService: LocationService,
     
    3635    this.listLocations = [];
    3736    this.regionId = 1;
     37    this.locationId = 1;
    3838  }
    3939
     
    7171  }
    7272
    73   openDialogSave(locationId: number){
    74     console.log(locationId);
     73  openDialogSave(locationId){
     74   // console.log(locationId);
    7575      const dialogRef = this.dialog.open(AddLocationToPlannerPanelComponent, {
    7676        width: '250px',
    7777        data: {}
    7878      });
    79       this.router.navigate(['locations'], {queryParams: {locationId: locationId}});
     79      this.router.navigate(['locations'], {queryParams: {regionId: this.regionId, companionId: this.companionId, lengthOfStay: this.lengthOfStay, categoryIds: this.categoryIds, locationId: locationId}});
     80     
    8081  }
    8182
     83  onClickSeeDetails(id: number){
     84    this.router.navigate(['location'], {queryParams: {id: id}});
     85  }
    8286}
Note: See TracChangeset for help on using the changeset viewer.