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-content p-3">
<div class="modal-header"> <div class="modal-header">
<table> <table>
@ -6,7 +5,7 @@
<h4 class="modal-title">Neuen Task anlegen</h4> <h4 class="modal-title">Neuen Task anlegen</h4>
</tr> </tr>
<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> </tr>
<!--getUserstory fehlt noch--> <!--getUserstory fehlt noch-->
</table> </table>
@ -59,11 +58,11 @@
</div> </div>
</div> </div>
</div> </div>
</form>
<div class="modal-footer"> <div class="modal-footer">
<button (click)="onClose()" type="dismiss" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button> <button (click)="onClose()" type="dismiss" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
<button type="submit" class="btn btn-primary">Erstellen</button> <button type="submit" class="btn btn-primary">Erstellen</button>
</div> </div>
</form>
</div> </div>
</div> </div>
<!-- </div> -->

View File

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

View File

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