created delete and create function
This commit is contained in:
parent
42c3ffdda7
commit
e99e0aeb69
@ -51,15 +51,15 @@
|
||||
<div class="form-group">
|
||||
<label for="Inhalt">Status</label>
|
||||
<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
|
||||
}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<div class="form-group">
|
||||
<a class="dropdown-item" href="#">Neuer Status</a>
|
||||
<a class="dropdown-item" href="#">Status löschen</a>
|
||||
<a class="dropdown-item" href="#" (click)="createTaskStatus()">Neuer Status</a>
|
||||
<a class="dropdown-item" href="#" (click)="deleteStatus()">Status löschen</a>
|
||||
<input type="text" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
ScrumCategory,
|
||||
ScrumUser,
|
||||
ScrumProject,
|
||||
ScrumUserstory,
|
||||
ScrumUserstory
|
||||
} from '../services/backend.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
@ -16,7 +16,7 @@ import { HttpResponse } from '@angular/common/http';
|
||||
@Component({
|
||||
selector: 'app-task-form',
|
||||
templateUrl: './task-form.component.html',
|
||||
styleUrls: ['./task-form.component.css'],
|
||||
styleUrls: [ './task-form.component.css' ]
|
||||
})
|
||||
export class TaskFormComponent implements OnInit {
|
||||
@Input() public task: ScrumTask;
|
||||
@ -26,10 +26,7 @@ export class TaskFormComponent implements OnInit {
|
||||
public allStatus: any[] = [];
|
||||
public status: ScrumStatus;
|
||||
|
||||
constructor(
|
||||
private backendService: BackendService,
|
||||
private activeModalService: NgbActiveModal
|
||||
) {
|
||||
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
|
||||
this.getUserStories();
|
||||
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