Ignore:
Timestamp:
11/29/21 22:35:07 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
84d0fbb
Parents:
8d391a1
Message:

spring security

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

Legend:

Unmodified
Added
Removed
  • trip-planner-front/src/app/planner/edit-planner/edit-planner.component.html

    r8d391a1 r1ad8e64  
    4343    </div>
    4444    <button pButton pRipplelabel label="Save" class="p-button-help"></button>
    45     <button pButton pRipple label="Back" class="p-button-info" (click)="onClickBack()" [style]="{'margin-left': '.5em'}"></button>
    46 
    4745</form>
    48 
     46<button pButton pRipple label="Back" class="p-button-info" (click)="onClickBack()" [style]="{'margin-left': '.11em'}"></button>
  • trip-planner-front/src/app/planner/edit-planner/edit-planner.component.ts

    r8d391a1 r1ad8e64  
    7878
    7979  onClickBack(){
    80     console.log("promena");
    8180    this.router.navigate(['planners']);
    8281  }
  • trip-planner-front/src/app/planner/planner.component.html

    r8d391a1 r1ad8e64  
    11<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
    22
    3 
     3<p-toast></p-toast>
    44<button pButton pRipple type="button" label="Create initial planner" class="p-button-help " (click)="show()"></button>
    55<br>
  • trip-planner-front/src/app/planner/planner.component.ts

    r8d391a1 r1ad8e64  
    55import { Router } from '@angular/router';
    66import { PlannerDto } from '../_models/dto/plannerDto';
    7 import { FormBuilder, FormGroup, Validators } from '@angular/forms';
    87import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
    9 import { PrimeNGConfig } from 'primeng/api';
     8import { MessageService, PrimeNGConfig } from 'primeng/api';
    109
    1110
     
    1312  selector: 'app-planner',
    1413  templateUrl: './planner.component.html',
    15   styleUrls: ['./planner.component.css']
     14  styleUrls: ['./planner.component.css'],
     15  providers: [DialogService, MessageService]
    1616})
    1717export class PlannerComponent implements OnInit {
     
    1919  planners: Planner[];
    2020  plannerDto: PlannerDto;
    21   editForm: FormGroup;
    2221  ref: DynamicDialogRef;
    2322
    2423
    2524  constructor(private plannerService: PlannerService, private router: Router,
    26     private fb: FormBuilder, private dialogService: DialogService, private primengConfig: PrimeNGConfig) {
     25    private dialogService: DialogService, private primengConfig: PrimeNGConfig, private messageService: MessageService) {
    2726    this.planners = [];
    2827    this.plannerDto = new PlannerDto();
    29     this.editForm = fb.group({
    30       title: fb.control('initial value', Validators.required)
    31     });
    32     this.ref = new DynamicDialogRef;   
     28    this.ref = new DynamicDialogRef;
    3329  }
    3430
     
    5147      }
    5248    );
     49  }
    5350
    54   }
    5551  show() {
    5652    this.ref = this.dialogService.open(CreateInitialPlannerComponent, {
     
    6056      baseZIndex: 10000
    6157    });
     58    this.ref.onClose.subscribe((planner: Planner) => {
     59      console.log("NOVOKREIRANIOT NAME NA PLANNER: " + planner.name);
     60      this.plannerService.postInitialPlanner(planner).subscribe(
     61        data=>{
     62          console.log(data);
     63        },
     64        error => console.log('oops', error)
     65     );
     66      this.messageService.add({ severity: 'success', summary: 'The planner: ' + planner.name + ' has been created.' });
     67    });
     68   
    6269  }
     70
    6371}
Note: See TracChangeset for help on using the changeset viewer.