created delete and create function
This commit is contained in:
parent
42c3ffdda7
commit
e99e0aeb69
@ -51,15 +51,15 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Inhalt">Status</label>
|
<label for="Inhalt">Status</label>
|
||||||
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio" [(ngModel)]="task.statusid">
|
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio" [(ngModel)]="task.statusid">
|
||||||
<option *ngFor="let status of allStatus" [value]="status.title">{{
|
<option *ngFor="let status of allStatus" [value]="status.id">{{
|
||||||
status.title
|
status.title
|
||||||
}}</option>
|
}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<a class="dropdown-item" href="#">Neuer Status</a>
|
<a class="dropdown-item" href="#" (click)="createTaskStatus()">Neuer Status</a>
|
||||||
<a class="dropdown-item" href="#">Status löschen</a>
|
<a class="dropdown-item" href="#" (click)="deleteStatus()">Status löschen</a>
|
||||||
<input type="text" class="form-control"/>
|
<input type="text" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
ScrumCategory,
|
ScrumCategory,
|
||||||
ScrumUser,
|
ScrumUser,
|
||||||
ScrumProject,
|
ScrumProject,
|
||||||
ScrumUserstory,
|
ScrumUserstory
|
||||||
} from '../services/backend.service';
|
} from '../services/backend.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { HttpResponse } from '@angular/common/http';
|
import { HttpResponse } from '@angular/common/http';
|
||||||
@ -16,7 +16,7 @@ import { HttpResponse } from '@angular/common/http';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-task-form',
|
selector: 'app-task-form',
|
||||||
templateUrl: './task-form.component.html',
|
templateUrl: './task-form.component.html',
|
||||||
styleUrls: ['./task-form.component.css'],
|
styleUrls: [ './task-form.component.css' ]
|
||||||
})
|
})
|
||||||
export class TaskFormComponent implements OnInit {
|
export class TaskFormComponent implements OnInit {
|
||||||
@Input() public task: ScrumTask;
|
@Input() public task: ScrumTask;
|
||||||
@ -26,10 +26,7 @@ export class TaskFormComponent implements OnInit {
|
|||||||
public allStatus: any[] = [];
|
public allStatus: any[] = [];
|
||||||
public status: ScrumStatus;
|
public status: ScrumStatus;
|
||||||
|
|
||||||
constructor(
|
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
|
||||||
private backendService: BackendService,
|
|
||||||
private activeModalService: NgbActiveModal
|
|
||||||
) {
|
|
||||||
this.getUserStories();
|
this.getUserStories();
|
||||||
this.getTaskStatus();
|
this.getTaskStatus();
|
||||||
}
|
}
|
||||||
@ -103,4 +100,12 @@ export class TaskFormComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleteStatus() {
|
||||||
|
this.backendService.deleteStatus(this.status).subscribe((response) => {
|
||||||
|
if (response.status > 399) {
|
||||||
|
alert('Fehler');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user