added related user story

This commit is contained in:
Michael 2020-06-22 17:12:09 +02:00
parent 3461103930
commit 8346801074
3 changed files with 66 additions and 65 deletions

View File

@ -1,4 +1,3 @@
<!-- <div class="modal-lg"> -->
<div class="modal-content p-3">
<div class="modal-header">
<table>
@ -6,7 +5,7 @@
<h4 class="modal-title">Neuen Task anlegen</h4>
</tr>
<tr>
<h6 class="modal-caption text-muted"> Gehört zu Story: <a href="#"></a></h6>
<h6 class="modal-caption text-muted"> Gehört zu Story: <a href="#" id="userstoryTitle">{{this.userstoryId}}</a></h6>
</tr>
<!--getUserstory fehlt noch-->
</table>
@ -59,11 +58,11 @@
</div>
</div>
</div>
</form>
<div class="modal-footer">
<button (click)="onClose()" type="dismiss" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
<button type="submit" class="btn btn-primary">Erstellen</button>
</div>
</form>
</div>
</div>
<!-- </div> -->

View File

@ -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,13 +16,17 @@ 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;
public editing: Boolean;
public userstoryId: string;
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {}
constructor(
private backendService: BackendService,
private activeModalService: NgbActiveModal
) {}
ngOnInit(): void {
if (this.task === null || this.task === undefined) {
@ -32,7 +36,6 @@ export class TaskFormComponent implements OnInit {
this.editing = true;
}
document.getElementById('titleField').focus();
this.getRelatedStory();
}
@ -57,13 +60,12 @@ export class TaskFormComponent implements OnInit {
this.activeModalService.dismiss(this.task);
}
getRelatedStory(): any{
this.backendService.getUserstory(1).subscribe(response => {
getRelatedStory() {
this.backendService.getUserstory(2).subscribe((response) => {
if (response.status > 399) {
alert('Fehler');
}
else {
console.log(response);
} else {
this.userstoryId = response.body.title;
}
});
}

View File

@ -1,7 +1,7 @@
(function(window) {
window["env"] = window["env"] || {};
window['env'] = window['env'] || {};
// Environment variables
window["env"]["apiUrl"] = "http://localhost:5001";
window["env"]["debug"] = false;
window['env']['apiUrl'] = 'http://taskboard.dev.nig.gl/api';
window['env']['debug'] = false;
})(this);