Skip to content

Commit

Permalink
done with project title in backend and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianSzkoluda committed Apr 9, 2018
1 parent fdbb15e commit 8e487b2
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Dashboard.Core/Entities/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Dashboard.Core.Entities
public class Project
{
public int Id { get; set; }

public string ProjectTitle { get; set; }
public string ApiHostUrl { get; set; }
public string ApiProjectId { get; set; }
public string ApiAuthenticationToken { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions src/Dashboard.WebApi/ApiModels/Requests/CreateProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ namespace Dashboard.WebApi.ApiModels.Requests
{
public class CreateProject
{
[Required]
public string ProjectTitle { get; set; }
[Required]
public string ApiHostUrl { get; set; }
[Required]
Expand Down
2 changes: 2 additions & 0 deletions src/Dashboard.WebApi/ApiModels/Requests/UpdateProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace Dashboard.WebApi.ApiModels.Requests
{
public class UpdateProject
{
[Required]
public string ProjectTitle { get; set; }
[Required]
public string ApiHostUrl { get; set; }
[Required]
Expand Down
2 changes: 2 additions & 0 deletions src/Dashboard.WebApi/Controllers/ProjectController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public async Task<IActionResult> Create([FromBody]CreateProject model)
//TODO: change when automapper
var project = new Project()
{
ProjectTitle = model.ProjectTitle,
ApiAuthenticationToken = model.ApiAuthenticationToken,
ApiHostUrl = model.ApiHostUrl,
ApiProjectId = model.ApiProjectId,
Expand All @@ -63,6 +64,7 @@ public async Task<IActionResult> Put(int id, [FromBody]UpdateProject model)
var updatedProject = new Project()
{
Id = id,
ProjectTitle = model.ProjectTitle,
ApiAuthenticationToken = model.ApiAuthenticationToken,
ApiHostUrl = model.ApiHostUrl,
ApiProjectId = model.ApiProjectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

<form #projectForm="ngForm" (ngSubmit)="addProject()">
<mat-card-content>
<mat-form-field class=" example-full-width ">
<input type="text" matInput placeholder="projectTitle " required [(ngModel)]="project.projectTitle" name="projectTitle">
</mat-form-field>
<mat-form-field class=" example-full-width ">
<input type="text" matInput placeholder="apiHostUrl " required [(ngModel)]="project.apiHostUrl" name="apiHostUrl">
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Router} from '@angular/router';
})
export class PanelProjectsComponent implements OnInit {

project = new Project('', '', '', '', undefined);
project = new Project('','', '', '', '', undefined);
dataProviderNames = new SupportedProviders(undefined);

constructor(private projectApiService : ProjectsApiService, private router : Router, private zone : NgZone,) {
Expand All @@ -21,7 +21,6 @@ export class PanelProjectsComponent implements OnInit {
}

addProject() {
console.log('XD');
console.log(this.project);
if (!this.project) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<gridster-item *ngFor="let project of projects" [resizable]="true">
<mat-card>
<mat-card-title>
<h4 style="font-size:1.3vw;">Project number: {{project.id}}</h4>
<h4 style="font-size:1.3vw;">{{project.projectTitle}}</h4>
<h4 style="font-size:1.3vw;" *ngIf="!project.projectTitle">Default title</h4>
</mat-card-title>
<mat-card-content style="font-size:0.9vw; display: inline-block">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {ProjectsApiService} from '../../projects-manager/api/projects-api.service';
import {Project} from '../../projects-manager/project';
import {Project, SupportedProviders} from '../../projects-manager/project';

@Component({selector: 'app-projects-list', templateUrl: './projects-list.component.html', styleUrls: ['./projects-list.component.css']})
export class ProjectsListComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export class SupportedProviders{
}

export class Project {

id : number;
projectTitle : string;
apiHostUrl : string;
apiProjectId : string;
apiAuthenticationToken : string;
dataProviderName : string;
pipelines : Pipeline[];
constructor(apiHostUrl : string, apiProjectId : string, apiAuthenticationToken : string, dataProviderName : string, pipelines : Pipeline[]) {}
constructor(projectTitle : string,apiHostUrl : string, apiProjectId : string, apiAuthenticationToken : string, dataProviderName : string, pipelines : Pipeline[]) {}

}

0 comments on commit 8e487b2

Please sign in to comment.