better positioning for userstory modal

This commit is contained in:
Michael 2020-06-21 18:00:09 +02:00
parent aa223ffa10
commit 53dd69ed56
6 changed files with 60 additions and 59 deletions

View File

@ -45,5 +45,13 @@
"ts-node": "~8.3.0", "ts-node": "~8.3.0",
"tslint": "~6.1.0", "tslint": "~6.1.0",
"typescript": "~3.8.3" "typescript": "~3.8.3"
} },
"description": "This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.7.",
"main": "karma.conf.js",
"repository": {
"type": "git",
"url": "https://git.informatik.fh-nuernberg.de/scrum-taskboard/frontend.git"
},
"author": "",
"license": "ISC"
} }

View File

@ -4,11 +4,10 @@ import { Routes, RouterModule } from '@angular/router';
import { TaskListComponent } from './task-list/task-list.component'; import { TaskListComponent } from './task-list/task-list.component';
import { UserstoryListComponent } from './userstory-list/userstory-list.component'; import { UserstoryListComponent } from './userstory-list/userstory-list.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'tasks', component: TaskListComponent }, { path: 'tasks', component: TaskListComponent },
{ path: 'userstories', component: UserstoryListComponent }, { path: 'userstories', component: UserstoryListComponent },
{ path: '', redirectTo: '/tasks', pathMatch: 'full' }, { path: '', redirectTo: '/tasks', pathMatch: 'full' }
]; ];
@NgModule({ @NgModule({

View File

@ -2,11 +2,11 @@
border-top: 0px solid; border-top: 0px solid;
padding-top: 5%; padding-top: 5%;
} }
.modal-lg{ .modal-content {
width: 1040px; width: 1040px;
right: 55%;
} }
.modal { .modal {
margin: 0 auto; margin: 0 auto;
} }

View File

@ -1,4 +1,4 @@
<div class="modal-lg"> <!-- <div class="modal-lg"> -->
<div class="modal-content p-3"> <div class="modal-content p-3">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Neue Userstory anlegen</h4> <h4 class="modal-title">Neue Userstory anlegen</h4>
@ -58,4 +58,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> <!-- </div> -->

View File

@ -8,35 +8,29 @@ import { BackendService, ScrumUserstory, Priority } from '../services/backend.se
styleUrls: [ './userstory-form.component.css' ] styleUrls: [ './userstory-form.component.css' ]
}) })
export class UserstoryFormComponent implements OnInit { export class UserstoryFormComponent implements OnInit {
@Input() public userstory: ScrumUserstory;
@Input()
public userstory: ScrumUserstory;
private editing: boolean; private editing: boolean;
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {} constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {}
ngOnInit(): void { ngOnInit(): void {
if (this.userstory === null || this.userstory === undefined) { if (this.userstory === null || this.userstory === undefined) {
this.userstory = {title: ""}; this.userstory = { title: '' };
this.editing = false; this.editing = false;
} } else {
else
{
this.editing = true; this.editing = true;
} }
} }
onSubmit() { onSubmit() {
if (this.editing) { if (this.editing) {
this.backendService.putUserstory(this.userstory).subscribe(response => { this.backendService.putUserstory(this.userstory).subscribe((response) => {
if (response.status > 399) { if (response.status > 399) {
alert('Fehler'); alert('Fehler');
} }
}); });
} } else {
else { this.backendService.postUserstory(this.userstory).subscribe((response) => {
this.backendService.postUserstory(this.userstory).subscribe(response => {
if (response.status > 399) { if (response.status > 399) {
alert('Fehler'); alert('Fehler');
} }