* semantic ui added

* very basic kanban module implementation to show api operation
This commit is contained in:
Dávid Danyi 2017-08-02 18:50:50 +02:00
parent 862b53d0e9
commit f7bb463bd4
31 changed files with 3386 additions and 393 deletions

View File

@ -19,9 +19,12 @@
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
"styles.css",
"../semantic/dist/semantic.css"
],
"scripts": [
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",

3376
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.4.1",
"semantic-ui": "^2.2.11",
"zone.js": "^0.8.14"
},
"devDependencies": {

View File

@ -1,10 +1,20 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import { KanbanService } from "./kanban/shared"
import { KanbanBoardComponent } from "./kanban/kanban-board/kanban-board.component"
const routes: Routes = [
{
path: '',
children: []
},{
path: 'kanban',
children: [],
component: KanbanBoardComponent,
resolve: {
kanbanBoard: KanbanService,
},
}
];
@ -12,4 +22,5 @@ const routes: Routes = [
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export class AppRoutingModule {
}

View File

@ -1,21 +1 @@
<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:center">
<h1>
Welcome to {{title}}!
</h1>
<img width="300" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly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><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" href="http://angularjs.blogspot.com/">Angular blog</a></h2>
</li>
</ul>
<router-outlet></router-outlet>

View File

@ -3,6 +3,7 @@ import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { KanbanModule } from './kanban/kanban.module';
@NgModule({
declarations: [
@ -10,7 +11,8 @@ import { AppComponent } from './app.component';
],
imports: [
BrowserModule,
AppRoutingModule
AppRoutingModule,
KanbanModule
],
providers: [],
bootstrap: [AppComponent]

View File

@ -0,0 +1,13 @@
<div class="ui main fullwide-container">
<div class="ui grid">
<div class="six wide column">
<app-kanban-entry-item [kanbanEntries]="kanbanBoard.inbox"></app-kanban-entry-item>
</div>
<div class="six wide column">
<app-kanban-entry-item [kanbanEntries]="kanbanBoard.inProgress"></app-kanban-entry-item>
</div>
<div class="four wide column">
<app-kanban-entry-item [kanbanEntries]="kanbanBoard.verification"></app-kanban-entry-item>
</div>
</div>
</div>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { KanbanBoardComponent } from './kanban-board.component';
describe('KanbanBoardComponent', () => {
let component: KanbanBoardComponent;
let fixture: ComponentFixture<KanbanBoardComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ KanbanBoardComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(KanbanBoardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,27 @@
import {Component, OnInit} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {ActivatedRoute} from '@angular/router';
import {
KanbanBoard
} from "../shared";
@Component({
selector: 'app-kanban-board',
templateUrl: './kanban-board.component.html',
styleUrls: ['./kanban-board.component.css']
})
export class KanbanBoardComponent implements OnInit {
public kanbanBoard: KanbanBoard = new KanbanBoard;
constructor(private titleService: Title,
private route: ActivatedRoute) {
}
ngOnInit() {
this.titleService.setTitle('TaurusXFT : Kanban board');
this.route.data.subscribe((data: { kanbanBoard: KanbanBoard }) => this.kanbanBoard = data.kanbanBoard);
}
}

View File

@ -0,0 +1,17 @@
<div class="ui card" *ngFor="let kanbanEntry of kanbanEntries">
<div class="ui tiny image">
<img src="{{avatarUrl(kanbanEntry.assignee?.avatar)}}">
</div>
<div class="content">
<a class="header">{{kanbanEntry.assignee?.name}}</a>
<div class="description">
{{kanbanEntry.summary}}
</div>
</div>
<div class="extra content">
<a>
<i class="user icon"></i>
22 Friends
</a>
</div>
</div>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { KanbanEntryCardComponent } from './kanban-entry-card.component';
describe('KanbanEntryCardComponent', () => {
let component: KanbanEntryCardComponent;
let fixture: ComponentFixture<KanbanEntryCardComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ KanbanEntryCardComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(KanbanEntryCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,25 @@
import {Component, Input, OnInit} from '@angular/core';
import {environment} from "../../../environments/environment";
import {KanbanEntry} from "../shared/kanban-entry.model";
@Component({
selector: 'app-kanban-entry-card',
templateUrl: './kanban-entry-card.component.html',
styleUrls: ['./kanban-entry-card.component.css']
})
export class KanbanEntryCardComponent implements OnInit {
@Input() kanbanEntries: Array<KanbanEntry>;
constructor() {}
ngOnInit() {}
public avatarUrl(avatar: string): string {
try {
return environment.apiUri + avatar;
} catch (e) {
return "";
}
}
}

View File

@ -0,0 +1,16 @@
<div class="ui divided items">
<div class="item" *ngFor="let kanbanEntry of kanbanEntries">
<div class="ui tiny image">
<img src="{{avatarUrl(kanbanEntry.assignee?.avatar)}}">
</div>
<div class="content">
<a class="header">{{kanbanEntry.key}}</a>
<div class="description">
<p>{{kanbanEntry.summary}}</p>
</div>
<div class="extra">
Additional Details
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { KanbanEntryItemComponent } from './kanban-entry-item.component';
describe('KanbanEntryItemComponent', () => {
let component: KanbanEntryItemComponent;
let fixture: ComponentFixture<KanbanEntryItemComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ KanbanEntryItemComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(KanbanEntryItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,25 @@
import {Component, Input, OnInit} from '@angular/core';
import {environment} from "../../../environments/environment";
import {KanbanEntry} from "../shared/kanban-entry.model";
@Component({
selector: 'app-kanban-entry-item',
templateUrl: './kanban-entry-item.component.html',
styleUrls: ['./kanban-entry-item.component.css']
})
export class KanbanEntryItemComponent implements OnInit {
@Input() kanbanEntries: Array<KanbanEntry>;
constructor() {}
ngOnInit() {}
public avatarUrl(avatarPath: string): string {
try {
return environment.apiUri + avatarPath;
} catch (e) {
return "";
}
}
}

View File

@ -0,0 +1,27 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HttpModule } from "@angular/http";
import { KanbanBoardComponent } from './kanban-board/kanban-board.component';
import { KanbanService } from './shared/kanban.service';
import { KanbanEntryItemComponent } from './kanban-entry-item/kanban-entry-item.component';
import { KanbanEntryCardComponent } from './kanban-entry-card/kanban-entry-card.component';
@NgModule({
imports: [
CommonModule,
HttpModule,
],
declarations: [
KanbanBoardComponent,
KanbanEntryItemComponent,
KanbanEntryCardComponent,
],
providers: [
KanbanService,
],
exports: [],
})
export class KanbanModule {
}

View File

@ -0,0 +1,6 @@
export * from './jira-assignee.model';
export * from './jira-issue-type.model';
export * from './jira-status.model';
export * from './kanban-board.model';
export * from './kanban-entry.model';
export * from './kanban.service';

View File

@ -0,0 +1,7 @@
export class JiraAssignee {
public signum: string;
public name: string;
public email: string;
public avatar: string;
public active: boolean;
}

View File

@ -0,0 +1,5 @@
export class JiraIssueType {
public name: string;
public description: string;
public icon: string;
}

View File

@ -0,0 +1,4 @@
export class JiraStatus {
public name: string;
public color: string;
}

View File

@ -0,0 +1,8 @@
import {KanbanEntry} from "./kanban-entry.model";
export class KanbanBoard {
public inbox: Array<KanbanEntry>;
public inProgress: Array<KanbanEntry>;
public verification: Array<KanbanEntry>;
public done: Array<KanbanEntry>;
}

View File

@ -0,0 +1,22 @@
import {JiraIssueType} from "./jira-issue-type.model";
import {JiraStatus} from "./jira-status.model";
import {JiraAssignee} from "./jira-assignee.model";
export class KanbanEntry {
public id: number;
public key: string;
public summary: string;
public issueType: JiraIssueType;
public status: JiraStatus;
public assignee: JiraAssignee;
public prio: number;
public functionalAreas: Array<string>;
public externalId: string;
public externalLink: string;
public project: string;
public mhwebStatus: string;
public mhwebHot: boolean;
public mhwebExternal: boolean;
public team: string;
public answerCode: string;
}

View File

@ -0,0 +1,15 @@
import { TestBed, inject } from '@angular/core/testing';
import { KanbanService } from './kanban.service';
describe('KanbanService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [KanbanService]
});
});
it('should be created', inject([KanbanService], (service: KanbanService) => {
expect(service).toBeTruthy();
}));
});

View File

@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
import { Http, Headers } from "@angular/http";
import 'rxjs/Rx';
import { Router, Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { environment } from '../../../environments/environment';
import {
KanbanBoard
} from '../shared';
@Injectable()
export class KanbanService {
private url = environment.apiUri + '/api/kanban';
constructor(private httpService: Http) {}
public getList(): Observable<KanbanBoard> {
return this.httpService.get(this.url).map(res => <KanbanBoard>res.json())
}
public resolve(route: ActivatedRouteSnapshot): Promise<KanbanBoard> {
return this.getList().toPromise().then(result => result ? result : false);
}
}

View File

@ -1,3 +1,4 @@
export const environment = {
production: true
production: true,
apiUri: "http://ttt-api.tsp.eth.ericsson.se/taurus-api",
};

View File

@ -4,5 +4,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
production: false
production: false,
apiUri: "http://localhost:8080",
};

View File

@ -9,6 +9,15 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
<app-root>
<div class="ui main container">
<div class="ui visible massive floating icon message">
<i class="notched circle loading icon"></i>
<div class="content">
<div class="header">Loading ...</div>
</div>
</div>
</div>
</app-root>
</body>
</html>

View File

@ -1 +1,9 @@
/* You can add global styles to this file, and also import other style files */
body {
background-color: #FFFFFF;
}
.ui.fullwide-container {
margin-left: 1em;
margin-right: 1em;
}