* initial commit
This commit is contained in:
parent
73df66f187
commit
11aed00a05
@ -19,6 +19,7 @@
|
|||||||
"testTsconfig": "tsconfig.spec.json",
|
"testTsconfig": "tsconfig.spec.json",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"styles": [
|
"styles": [
|
||||||
|
"../node_modules/semantic-ui-css/semantic.css",
|
||||||
"styles.css"
|
"styles.css"
|
||||||
],
|
],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
|
|||||||
55
package-lock.json
generated
55
package-lock.json
generated
@ -1180,6 +1180,11 @@
|
|||||||
"hoek": "2.16.3"
|
"hoek": "2.16.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"bowser": {
|
||||||
|
"version": "1.9.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.3.tgz",
|
||||||
|
"integrity": "sha512-/gp96UlcFw5DbV2KQPCqTqi0Mb9gZRyDAHiDsGEH+4B/KOQjeoE5lM1PxlVX8DQDvfEfitmC1rW2Oy8fk/XBDg=="
|
||||||
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
@ -2371,6 +2376,11 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"date-fns": {
|
||||||
|
"version": "2.0.0-alpha.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.0.0-alpha.1.tgz",
|
||||||
|
"integrity": "sha512-4gYdF1rDgv9X/0ko69pt+FgpQtDU5rgqZVmckIOhDicfCSTndwHMhUhLJw+pa4DlPdzIkEBtHg6L6VlQ6ueD1g=="
|
||||||
|
},
|
||||||
"date-format": {
|
"date-format": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/date-format/-/date-format-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/date-format/-/date-format-1.2.0.tgz",
|
||||||
@ -2787,6 +2797,11 @@
|
|||||||
"integrity": "sha1-SpJzTgBEyM8LFVO+V+riGkxuX6s=",
|
"integrity": "sha1-SpJzTgBEyM8LFVO+V+riGkxuX6s=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"element-closest": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/element-closest/-/element-closest-2.0.2.tgz",
|
||||||
|
"integrity": "sha1-cqdAoQdFM4LijfnOXbtajfD5Zuw="
|
||||||
|
},
|
||||||
"elliptic": {
|
"elliptic": {
|
||||||
"version": "6.4.0",
|
"version": "6.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",
|
||||||
@ -3313,8 +3328,7 @@
|
|||||||
"extend": {
|
"extend": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
|
||||||
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
|
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"extend-shallow": {
|
"extend-shallow": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
@ -5828,6 +5842,11 @@
|
|||||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
|
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"is-ua-webview": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-ua-webview/-/is-ua-webview-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-0/ex7fXiKlsAOs8IbGi9nzYu6eTCHNUmK0wa2QlQ3zuxejGYjoG5ROJ51dsek4Ut2RMD5xaFwB/H0XUWrpTHlQ=="
|
||||||
|
},
|
||||||
"is-utf8": {
|
"is-utf8": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
||||||
@ -6066,6 +6085,11 @@
|
|||||||
"integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=",
|
"integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"jquery": {
|
||||||
|
"version": "3.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
|
||||||
|
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg=="
|
||||||
|
},
|
||||||
"js-base64": {
|
"js-base64": {
|
||||||
"version": "2.4.3",
|
"version": "2.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz",
|
||||||
@ -7223,6 +7247,20 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"ng2-semantic-ui": {
|
||||||
|
"version": "0.9.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/ng2-semantic-ui/-/ng2-semantic-ui-0.9.7.tgz",
|
||||||
|
"integrity": "sha512-A7I3c1n65OXKa7YVxq6I2DjgWgKcyInVjSpze1hm73HPEEULoUSGBOK8IxbUxUUWiVvC6aGHd+IuoE4EkAIS0w==",
|
||||||
|
"requires": {
|
||||||
|
"bowser": "1.9.3",
|
||||||
|
"date-fns": "2.0.0-alpha.1",
|
||||||
|
"element-closest": "2.0.2",
|
||||||
|
"extend": "3.0.1",
|
||||||
|
"is-ua-webview": "1.0.1",
|
||||||
|
"popper.js": "1.14.3",
|
||||||
|
"rxjs": "5.5.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
"no-case": {
|
"no-case": {
|
||||||
"version": "2.3.2",
|
"version": "2.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
|
||||||
@ -8188,6 +8226,11 @@
|
|||||||
"find-up": "2.1.0"
|
"find-up": "2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"popper.js": {
|
||||||
|
"version": "1.14.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.3.tgz",
|
||||||
|
"integrity": "sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU="
|
||||||
|
},
|
||||||
"portfinder": {
|
"portfinder": {
|
||||||
"version": "1.0.13",
|
"version": "1.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz",
|
||||||
@ -9260,6 +9303,14 @@
|
|||||||
"node-forge": "0.7.1"
|
"node-forge": "0.7.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"semantic-ui-css": {
|
||||||
|
"version": "2.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/semantic-ui-css/-/semantic-ui-css-2.3.1.tgz",
|
||||||
|
"integrity": "sha512-8M2OkoKZHfEnNUYB4Ha8q+tTAWN/g17X2l6HUg6n3DP4QDJLQl1xyhnRvM9UhJpsRvkRqgWgQLbRA6cl7Ep2dw==",
|
||||||
|
"requires": {
|
||||||
|
"jquery": "3.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.5.0",
|
"version": "5.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||||
|
|||||||
@ -22,7 +22,9 @@
|
|||||||
"@angular/platform-browser-dynamic": "^5.2.0",
|
"@angular/platform-browser-dynamic": "^5.2.0",
|
||||||
"@angular/router": "^5.2.0",
|
"@angular/router": "^5.2.0",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
|
"ng2-semantic-ui": "^0.9.7",
|
||||||
"rxjs": "^5.5.6",
|
"rxjs": "^5.5.6",
|
||||||
|
"semantic-ui-css": "^2.3.1",
|
||||||
"zone.js": "^0.8.19"
|
"zone.js": "^0.8.19"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
23
src/app/admin/admin-routing.module.ts
Normal file
23
src/app/admin/admin-routing.module.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
|
import { TeamListComponent} from './team-list/team-list.component';
|
||||||
|
import { TeamService } from '../shared/service/team.service';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'admin/teams/list',
|
||||||
|
component: TeamListComponent,
|
||||||
|
// canActivate: [AuthGuardService, RoleGuardService],
|
||||||
|
resolve: {
|
||||||
|
teams: TeamService,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class AdminRoutingModule {
|
||||||
|
}
|
||||||
15
src/app/admin/admin.module.ts
Normal file
15
src/app/admin/admin.module.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { AdminRoutingModule } from './admin-routing.module';
|
||||||
|
import { TeamListComponent } from './team-list/team-list.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
AdminRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [TeamListComponent],
|
||||||
|
providers: []
|
||||||
|
})
|
||||||
|
export class AdminModule { }
|
||||||
0
src/app/admin/team-list/team-list.component.css
Normal file
0
src/app/admin/team-list/team-list.component.css
Normal file
26
src/app/admin/team-list/team-list.component.html
Normal file
26
src/app/admin/team-list/team-list.component.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<div class="ui main container">
|
||||||
|
<h1 class="ui dividing header">Teams</h1>
|
||||||
|
<div class="ui raised segments">
|
||||||
|
<div class="ui segment">
|
||||||
|
<table *ngIf="teams?.length" class="ui celled definition table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th class="clickable">Team</th>
|
||||||
|
<th class="clickable">Members</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let team of teams">
|
||||||
|
<td class="collapsing">
|
||||||
|
<a [routerLink]="['/team/edit', team.id]" title="Change"><i
|
||||||
|
class="large edit link icon"></i></a>
|
||||||
|
</td>
|
||||||
|
<td>{{team.name}}</td>
|
||||||
|
<td>{{fancyMemberNames(team)}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
25
src/app/admin/team-list/team-list.component.spec.ts
Normal file
25
src/app/admin/team-list/team-list.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { TeamListComponent } from './team-list.component';
|
||||||
|
|
||||||
|
describe('TeamListComponent', () => {
|
||||||
|
let component: TeamListComponent;
|
||||||
|
let fixture: ComponentFixture<TeamListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ TeamListComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(TeamListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
36
src/app/admin/team-list/team-list.component.ts
Normal file
36
src/app/admin/team-list/team-list.component.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { Title } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
import { Team } from '../../shared/team';
|
||||||
|
import { TeamService } from '../../shared/service/team.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-team-list',
|
||||||
|
templateUrl: './team-list.component.html',
|
||||||
|
styleUrls: ['./team-list.component.css']
|
||||||
|
})
|
||||||
|
export class TeamListComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(private teamService: TeamService,
|
||||||
|
private titleService: Title,
|
||||||
|
private route: ActivatedRoute) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.titleService.setTitle('Teams : MTAStv');
|
||||||
|
this.route.data.subscribe((data: {teams: Array<Team>}) => this.teams = data.teams);
|
||||||
|
}
|
||||||
|
|
||||||
|
get teams(): Array<Team> {
|
||||||
|
return this.teamService.teams;
|
||||||
|
}
|
||||||
|
|
||||||
|
set teams(teams: Array<Team>) {
|
||||||
|
this.teamService.teams = teams;
|
||||||
|
}
|
||||||
|
|
||||||
|
public fancyMemberNames(team: Team): String {
|
||||||
|
return team.members.map(member => member.name).join(', ');
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/app/app-routing.module.ts
Normal file
18
src/app/app-routing.module.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
// import { HomeComponent } from "./home/home.component";
|
||||||
|
// import { AuthGuardService } from "./auth/auth-guard.service";
|
||||||
|
// import { PageNotFoundComponent } from "./page-not-found/page-not-found.component";
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
// {path: '', component: HomeComponent, canActivate: [AuthGuardService]},
|
||||||
|
// {path: '**', component: PageNotFoundComponent},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forRoot(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class AppRoutingModule {
|
||||||
|
}
|
||||||
@ -1,20 +1 @@
|
|||||||
<!--The content below is only a placeholder and can be replaced.-->
|
<router-outlet></router-outlet>
|
||||||
<div style="text-align:center">
|
|
||||||
<h1>
|
|
||||||
Welcome to {{ title }}!
|
|
||||||
</h1>
|
|
||||||
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
|
|
||||||
</div>
|
|
||||||
<h2>Here are some links to help you start: </h2>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
@ -1,18 +1,32 @@
|
|||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { SuiModule } from 'ng2-semantic-ui';
|
||||||
|
|
||||||
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
import { TeamService } from './shared/service/team.service';
|
||||||
|
import { SlideService } from './shared/service/slide.service';
|
||||||
|
import { AdminModule } from './admin/admin.module';
|
||||||
|
import { DisplayModule } from './display/display.module';
|
||||||
|
import { CommitTrackerService } from './shared/service/commit-tracker.service';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule
|
BrowserModule,
|
||||||
|
HttpClientModule,
|
||||||
|
FormsModule,
|
||||||
|
SuiModule,
|
||||||
|
DisplayModule,
|
||||||
|
AdminModule,
|
||||||
|
AppRoutingModule, // must be last RouterModule import for ** route to work
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [TeamService, SlideService, CommitTrackerService],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule {
|
||||||
|
}
|
||||||
|
|||||||
35
src/app/display/commit-tracker/commit-tracker.component.html
Normal file
35
src/app/display/commit-tracker/commit-tracker.component.html
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<div class="ui main container">
|
||||||
|
<h1 class="ui dividing header">Commit tracker</h1>
|
||||||
|
<div class="ui raised segments">
|
||||||
|
<div class="ui segment">
|
||||||
|
<table *ngIf="commits?.length" class="ui celled table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><i class="clock outline icon"></i>Last activity</th>
|
||||||
|
<th><i class="sticky note outline icon"></i>Change subject</th>
|
||||||
|
<th><i class="folder open outline icon"></i>Project</th>
|
||||||
|
<th><i class="code branch icon"></i>Branch</th>
|
||||||
|
<th><i class="coffee icon"></i>Gerrit</th>
|
||||||
|
<th><i class="fire extinguisher icon"></i>Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let commit of commits" [ngClass]="rowClasses(commit)">
|
||||||
|
<td class="collapsing">{{commit.gerrit_time}}</td>
|
||||||
|
<td>{{commit.gerrit_change_subject}}</td>
|
||||||
|
<td class="collapsing">{{commit.gerrit_project}}</td>
|
||||||
|
<td class="collapsing">{{commit.branch}}</td>
|
||||||
|
<td class="collapsing">{{commit.gerrit_change_number}}</td>
|
||||||
|
<td class="collapsing">
|
||||||
|
<div [ngClass]="labelClasses(commit, CommitStatus.Verified)">{{CommitStatus.Verified}}</div>
|
||||||
|
<div [ngClass]="labelClasses(commit, CommitStatus.CodeReview)">{{CommitStatus.CodeReview}}</div>
|
||||||
|
<div [ngClass]="labelClasses(commit, CommitStatus.CommitFeedbackLoop)">{{CommitStatus.CommitFeedbackLoop}}</div>
|
||||||
|
<div [ngClass]="labelClasses(commit, CommitStatus.ShortFeedbackLoop)">{{CommitStatus.ShortFeedbackLoop}}</div>
|
||||||
|
<div [ngClass]="labelClasses(commit, CommitStatus.NightlyFeedbackLoop)">{{CommitStatus.NightlyFeedbackLoop}}</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { CommitTrackerComponent } from './commit-tracker.component';
|
||||||
|
|
||||||
|
describe('CommitTrackerComponent', () => {
|
||||||
|
let component: CommitTrackerComponent;
|
||||||
|
let fixture: ComponentFixture<CommitTrackerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ CommitTrackerComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(CommitTrackerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
106
src/app/display/commit-tracker/commit-tracker.component.ts
Normal file
106
src/app/display/commit-tracker/commit-tracker.component.ts
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Title } from '@angular/platform-browser';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { CommitTrackerService } from '../../shared/service/commit-tracker.service';
|
||||||
|
import { Commit } from '../../shared/commit';
|
||||||
|
import { CommitStatus } from '../../shared/commit-status.enum';
|
||||||
|
import { Result } from '../../shared/result.enum';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-commit-tracker',
|
||||||
|
templateUrl: './commit-tracker.component.html',
|
||||||
|
styleUrls: ['./commit-tracker.component.css']
|
||||||
|
})
|
||||||
|
export class CommitTrackerComponent implements OnInit {
|
||||||
|
|
||||||
|
public CommitStatus = CommitStatus;
|
||||||
|
|
||||||
|
constructor(private commitTrackerService: CommitTrackerService,
|
||||||
|
private titleService: Title,
|
||||||
|
private route: ActivatedRoute) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.titleService.setTitle('Commit-tracker : MTAStv');
|
||||||
|
this.route.data.subscribe((data: {commits: Array<Commit>}) => this.commits = data.commits);
|
||||||
|
}
|
||||||
|
|
||||||
|
get commits(): Array<Commit> {
|
||||||
|
return this.commitTrackerService.commits;
|
||||||
|
}
|
||||||
|
|
||||||
|
set commits(commits: Array<Commit>) {
|
||||||
|
this.commitTrackerService.commits = commits;
|
||||||
|
}
|
||||||
|
|
||||||
|
public labelClasses(commit: Commit, commitStatus: String) {
|
||||||
|
const classes: Object = {
|
||||||
|
ui: true,
|
||||||
|
big: true,
|
||||||
|
circular: true,
|
||||||
|
label: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (commitStatus) {
|
||||||
|
case CommitStatus.Verified:
|
||||||
|
return Object.assign(classes, {
|
||||||
|
green: commit.gerrit_verified === 2,
|
||||||
|
yellow: commit.gerrit_verified === 0,
|
||||||
|
red: commit.gerrit_verified === -2,
|
||||||
|
});
|
||||||
|
case CommitStatus.CodeReview:
|
||||||
|
return Object.assign(classes, {
|
||||||
|
green: commit.gerrit_code_review === 1,
|
||||||
|
yellow: commit.gerrit_code_review === 0,
|
||||||
|
red: commit.gerrit_code_review === -1,
|
||||||
|
});
|
||||||
|
case CommitStatus.CommitFeedbackLoop:
|
||||||
|
return Object.assign(classes, {
|
||||||
|
green: commit.cfl_result === Result.Success,
|
||||||
|
yellow: commit.cfl_result === Result.Aborted,
|
||||||
|
orange: commit.cfl_result === Result.Unstable,
|
||||||
|
red: commit.cfl_result === Result.Failure,
|
||||||
|
brown: commit.cfl_result === Result.NotBuilt,
|
||||||
|
});
|
||||||
|
case CommitStatus.ShortFeedbackLoop:
|
||||||
|
return Object.assign(classes, {
|
||||||
|
green: commit.sfl_result === Result.Success,
|
||||||
|
yellow: commit.sfl_result === Result.Aborted,
|
||||||
|
orange: commit.sfl_result === Result.Unstable,
|
||||||
|
red: commit.sfl_result === Result.Failure,
|
||||||
|
brown: commit.sfl_result === Result.NotBuilt,
|
||||||
|
});
|
||||||
|
case CommitStatus.NightlyFeedbackLoop:
|
||||||
|
return Object.assign(classes, {
|
||||||
|
green: commit.nfl_result === Result.Success,
|
||||||
|
yellow: commit.nfl_result === Result.Aborted,
|
||||||
|
red: commit.nfl_result === Result.Failure,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public rowClasses(commit: Commit) {
|
||||||
|
return {
|
||||||
|
positive: this.isAllOk(commit),
|
||||||
|
negative: this.hasAnyFailure(commit)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private isAllOk(commit: Commit) {
|
||||||
|
return [
|
||||||
|
commit.cfl_result,
|
||||||
|
commit.sfl_result,
|
||||||
|
commit.nfl_result,
|
||||||
|
].every(result => result === Result.Success);
|
||||||
|
}
|
||||||
|
|
||||||
|
private hasAnyFailure(commit: Commit) {
|
||||||
|
return [
|
||||||
|
commit.cfl_result,
|
||||||
|
commit.sfl_result,
|
||||||
|
commit.nfl_result,
|
||||||
|
].some(result => result === Result.Failure);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/app/display/display-routing.module.ts
Normal file
22
src/app/display/display-routing.module.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { CommitTrackerComponent } from './commit-tracker/commit-tracker.component';
|
||||||
|
import { CommitTrackerService } from '../shared/service/commit-tracker.service';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'commit-tracker',
|
||||||
|
component: CommitTrackerComponent,
|
||||||
|
// canActivate: [AuthGuardService, RoleGuardService],
|
||||||
|
resolve: {
|
||||||
|
commits: CommitTrackerService,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class DisplayRoutingModule { }
|
||||||
14
src/app/display/display.module.ts
Normal file
14
src/app/display/display.module.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { DisplayRoutingModule } from './display-routing.module';
|
||||||
|
import { CommitTrackerComponent } from './commit-tracker/commit-tracker.component';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
DisplayRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [CommitTrackerComponent]
|
||||||
|
})
|
||||||
|
export class DisplayModule { }
|
||||||
18
src/app/shared/build.ts
Normal file
18
src/app/shared/build.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { Result } from './result.enum';
|
||||||
|
|
||||||
|
export class Build {
|
||||||
|
abort: boolean;
|
||||||
|
build: {
|
||||||
|
subBuild: Array<Build>;
|
||||||
|
};
|
||||||
|
buildNumber: Number;
|
||||||
|
duration: String;
|
||||||
|
icon: String;
|
||||||
|
jobName: String;
|
||||||
|
parentBuildNumber: Number;
|
||||||
|
parentJobName: String;
|
||||||
|
phaseName: String;
|
||||||
|
result: Result;
|
||||||
|
retry: boolean;
|
||||||
|
url: String;
|
||||||
|
}
|
||||||
7
src/app/shared/commit-status.enum.ts
Normal file
7
src/app/shared/commit-status.enum.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export enum CommitStatus {
|
||||||
|
Verified = 'V',
|
||||||
|
CodeReview = 'C-R',
|
||||||
|
CommitFeedbackLoop = 'CFL',
|
||||||
|
ShortFeedbackLoop = 'SFL',
|
||||||
|
NightlyFeedbackLoop = 'NFL',
|
||||||
|
}
|
||||||
44
src/app/shared/commit.ts
Normal file
44
src/app/shared/commit.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { Build } from './build';
|
||||||
|
import { Result } from './result.enum';
|
||||||
|
|
||||||
|
export class Commit {
|
||||||
|
change_id: String;
|
||||||
|
branch: String;
|
||||||
|
owner: String;
|
||||||
|
gerrit_change_number: Number;
|
||||||
|
gerrit_change_subject: String;
|
||||||
|
gerrit_project: String;
|
||||||
|
gerrit_verified: Number;
|
||||||
|
gerrit_code_review: Number;
|
||||||
|
gerrit_time: String;
|
||||||
|
|
||||||
|
cfl_id: Number;
|
||||||
|
cfl_build_number: Number;
|
||||||
|
cfl_timestamp: Number;
|
||||||
|
cfl_building: Number;
|
||||||
|
cfl_duration: Number;
|
||||||
|
cfl_result: Result;
|
||||||
|
cfl_sub_builds: Build;
|
||||||
|
|
||||||
|
sfl_id: Number;
|
||||||
|
sfl_build_number: Number;
|
||||||
|
sfl_timestamp: Number;
|
||||||
|
sfl_building: Number;
|
||||||
|
sfl_duration: Number;
|
||||||
|
sfl_result: Result;
|
||||||
|
sfl_sub_builds: Build;
|
||||||
|
sfl_fail_count: Number;
|
||||||
|
sfl_skip_count: Number;
|
||||||
|
sfl_total_count: Number;
|
||||||
|
|
||||||
|
nfl_id: Number;
|
||||||
|
nfl_build_number: Number;
|
||||||
|
nfl_timestamp: Number;
|
||||||
|
nfl_building: Number;
|
||||||
|
nfl_duration: Number;
|
||||||
|
nfl_result: Result;
|
||||||
|
nfl_sub_builds: Build;
|
||||||
|
nfl_fail_count: Number;
|
||||||
|
nfl_skip_count: Number;
|
||||||
|
nfl_total_count: Number;
|
||||||
|
}
|
||||||
4
src/app/shared/member.ts
Normal file
4
src/app/shared/member.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export class Member {
|
||||||
|
signum: String;
|
||||||
|
name: String;
|
||||||
|
}
|
||||||
7
src/app/shared/result.enum.ts
Normal file
7
src/app/shared/result.enum.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export enum Result {
|
||||||
|
Aborted = 'ABORTED',
|
||||||
|
Failure = 'FAILURE',
|
||||||
|
NotBuilt = 'NOT_BUILT',
|
||||||
|
Success = 'SUCCESS',
|
||||||
|
Unstable = 'UNSTABLE',
|
||||||
|
}
|
||||||
36
src/app/shared/service/commit-tracker.service.ts
Normal file
36
src/app/shared/service/commit-tracker.service.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
import { environment } from '../../../environments/environment';
|
||||||
|
import { Commit } from '../commit';
|
||||||
|
import { TeamService } from './team.service';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class CommitTrackerService implements Resolve<Array<Commit>> {
|
||||||
|
|
||||||
|
private apiEndPoint = environment.commitTrackerApiUrl;
|
||||||
|
private cachedCommits: Array<Commit> = [];
|
||||||
|
|
||||||
|
constructor(private httpClient: HttpClient,
|
||||||
|
private teamService: TeamService) { }
|
||||||
|
|
||||||
|
public resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<Array<Commit>> {
|
||||||
|
return this.getTeamCommits(this.teamService.teamMembers).toPromise();
|
||||||
|
}
|
||||||
|
|
||||||
|
public getTeamCommits(signums: Array<String>): Observable<Array<Commit>> {
|
||||||
|
return this.httpClient.post<Array<Commit>>(this.apiEndPoint, {
|
||||||
|
json_signums: signums
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
get commits(): Array<Commit> {
|
||||||
|
return this.cachedCommits;
|
||||||
|
}
|
||||||
|
|
||||||
|
set commits(commits: Array<Commit>) {
|
||||||
|
this.cachedCommits = commits;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/app/shared/service/slide.service.spec.ts
Normal file
15
src/app/shared/service/slide.service.spec.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { TestBed, inject } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SlideService } from './slide.service';
|
||||||
|
|
||||||
|
describe('SlideService', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [SlideService]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', inject([SlideService], (service: SlideService) => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
}));
|
||||||
|
});
|
||||||
8
src/app/shared/service/slide.service.ts
Normal file
8
src/app/shared/service/slide.service.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class SlideService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
}
|
||||||
15
src/app/shared/service/sommit-tracker.service.spec.ts
Normal file
15
src/app/shared/service/sommit-tracker.service.spec.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { TestBed, inject } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { CommitTrackerService } from './commit-tracker.service';
|
||||||
|
|
||||||
|
describe('CommitTrackerService', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [CommitTrackerService]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', inject([CommitTrackerService], (service: CommitTrackerService) => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
}));
|
||||||
|
});
|
||||||
15
src/app/shared/service/team.service.spec.ts
Normal file
15
src/app/shared/service/team.service.spec.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { TestBed, inject } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { TeamService } from './team.service';
|
||||||
|
|
||||||
|
describe('TeamService', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [TeamService]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', inject([TeamService], (service: TeamService) => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
}));
|
||||||
|
});
|
||||||
48
src/app/shared/service/team.service.ts
Normal file
48
src/app/shared/service/team.service.ts
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
import { environment } from '../../../environments/environment';
|
||||||
|
import { Team } from '../team';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class TeamService implements Resolve<Array<Team>> {
|
||||||
|
|
||||||
|
private apiEndPoint = environment.apiUrl + '/api/team';
|
||||||
|
private cachedTeams: Array<Team> = [];
|
||||||
|
|
||||||
|
constructor(private httpClient: HttpClient) { }
|
||||||
|
|
||||||
|
public resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<Array<Team>> {
|
||||||
|
return this.list().toPromise();
|
||||||
|
}
|
||||||
|
|
||||||
|
public list(): Observable<Array<Team>> {
|
||||||
|
return this.httpClient.get<Array<Team>>(this.apiEndPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public create(team: Team) {
|
||||||
|
return this.httpClient.post<Team>(this.apiEndPoint, team);
|
||||||
|
}
|
||||||
|
|
||||||
|
public update(team: Team) {
|
||||||
|
return this.httpClient.put<Team>(`${this.apiEndPoint}/${team.id.toString()}`, team);
|
||||||
|
}
|
||||||
|
|
||||||
|
public delete(team: Team) {
|
||||||
|
return this.httpClient.delete<boolean>(`${this.apiEndPoint}/${team.id.toString()}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
get teams(): Array<Team> {
|
||||||
|
return this.cachedTeams;
|
||||||
|
}
|
||||||
|
|
||||||
|
set teams(teams: Array<Team>) {
|
||||||
|
this.cachedTeams = teams;
|
||||||
|
}
|
||||||
|
|
||||||
|
get teamMembers(): Array<string> {
|
||||||
|
return ['eztoli', 'etamecs', 'esteist', 'emrtsis', 'erudvel'];
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/app/shared/slide.ts
Normal file
11
src/app/shared/slide.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { Team } from './team';
|
||||||
|
|
||||||
|
export class Slide {
|
||||||
|
id: Number;
|
||||||
|
title: String;
|
||||||
|
team: Team;
|
||||||
|
slideData: String;
|
||||||
|
isVisible: boolean;
|
||||||
|
createdAt: String;
|
||||||
|
updatedAt: String;
|
||||||
|
}
|
||||||
10
src/app/shared/team.ts
Normal file
10
src/app/shared/team.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { Member } from './member';
|
||||||
|
|
||||||
|
export class Team {
|
||||||
|
id: Number;
|
||||||
|
name: String;
|
||||||
|
members: Array<Member>;
|
||||||
|
isActive: boolean;
|
||||||
|
createdAt: String;
|
||||||
|
updatedAt: String;
|
||||||
|
}
|
||||||
@ -1,3 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true
|
production: true,
|
||||||
|
apiUrl: 'http://localhost:8080',
|
||||||
|
commitTrackerApiUrl: 'https://mtas-trex.rnd.ki.sw.ericsson.se:8080/committracker/api/'
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,5 +4,7 @@
|
|||||||
// The list of which env maps to which file can be found in `.angular-cli.json`.
|
// The list of which env maps to which file can be found in `.angular-cli.json`.
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false
|
production: false,
|
||||||
|
apiUrl: 'http://localhost:8080',
|
||||||
|
commitTrackerApiUrl: 'https://mtas-trex.rnd.ki.sw.ericsson.se:8080/committracker/api/'
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1 +1,8 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
.main.container {
|
||||||
|
margin-top: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui.checkbox > label[for] {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user