import { Component } from '@angular/core' ; import { GenericCreateComponent } from 'src/app/components/generic' ; import { ActivatedRoute , Router } from '@angular/router' ; import { Input , Name , TextInput } from 'src/app/form/Input' ; import { MatSnackBar } from '@angular/material/snack-bar' ; import { MissionRouter } from 'src/app/router/MissionRouter' ; import { MissionsService } from 'src/app/services/missions.service' ; import { MissionTypeAutocompleteInput , MultipleClientsAutocompleteInput , MultipleUsersAutocompleteInput , } from 'src/app/form/Queryable' ; import { RangeDateInput } from 'src/app/form/Date' ; import { NgForm } from '@angular/forms' ; @ Component ( { selector : 'app-missions-create' , templateUrl : '../generic/form/generic-form.component.html' , styleUrls : [ ] , } ) export class MissionsCreateComponent extends GenericCreateComponent { public singularResource = 'mission' ; public routerHelper = MissionRouter ; public inputs : Input [ ] = [ ] ; constructor ( protected service , protected router , protected route , protected snackBar , usersSelectInput , clientsSelectInput , missionTypeSelectInput ) { super ( service , router , route , snackBar ) ; this . inputs = [ new Name ( ) , usersSelectInput , clientsSelectInput , new RangeDateInput ( ) , missionTypeSelectInput , new TextInput ( { name : 'credentials' , label : 'Credentials' , } ) , new TextInput ( { name : 'pathToCodi' , label : 'Path to CodiMD' , } ) , ] ; } onSubmit ( { value } ) { super . onSubmit ( { value : { ... value , period : this . period . value , } , } as NgForm ) ; } }