Skip to content

Commit e7bc145

Browse files
committed
configurable deck; edit/delete participant
1 parent 3e071ec commit e7bc145

12 files changed

+181
-96
lines changed

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Open source implementation of planning poker game.
44

55
- The game has three roles: admin, players, observers.
6-
- Cards: 0, 0.5, 1, 2, 3, 5, 10, 20 (gonna make it configurable)
6+
- Cards: 0, 0.5, 1, 2, 3, 5, 10, 20, ? (configurable via `config.json`)
77
- Self-contained, can be run in closed intranet environments.
88

99
The project is built on Angular 5. It uses [http-shared-storage](https://github.com/yarosla/httpstorage)
@@ -19,12 +19,10 @@ backend to store session data.
1919

2020
3. Point your browser to `http://localhost:8080/index.html`
2121

22-
Technologies
23-
------------
22+
## Technologies
2423

2524
- Angular 5
2625

27-
Author
28-
------
26+
## Author
2927

3028
Yaroslav Stavnichiy <yarosla@gmail.com>

package-lock.json

+58-58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,34 @@
1313
},
1414
"private": true,
1515
"dependencies": {
16-
"@angular/animations": "^5.0.0",
17-
"@angular/common": "^5.0.0",
18-
"@angular/compiler": "^5.0.0",
19-
"@angular/core": "^5.0.0",
20-
"@angular/forms": "^5.0.0",
21-
"@angular/http": "^5.0.0",
22-
"@angular/platform-browser": "^5.0.0",
23-
"@angular/platform-browser-dynamic": "^5.0.0",
24-
"@angular/router": "^5.0.0",
16+
"@angular/animations": "^5.2.3",
17+
"@angular/common": "^5.2.3",
18+
"@angular/compiler": "^5.2.3",
19+
"@angular/core": "^5.2.3",
20+
"@angular/forms": "^5.2.3",
21+
"@angular/http": "^5.2.3",
22+
"@angular/platform-browser": "^5.2.3",
23+
"@angular/platform-browser-dynamic": "^5.2.3",
24+
"@angular/router": "^5.2.3",
2525
"core-js": "^2.4.1",
2626
"rxjs": "^5.5.2",
27-
"ts-mockito": "^2.2.7",
28-
"zone.js": "^0.8.14"
27+
"ts-mockito": "^2.2.9",
28+
"zone.js": "^0.8.20"
2929
},
3030
"devDependencies": {
3131
"@angular/cli": "1.6.3",
32-
"@angular/compiler-cli": "^5.0.0",
33-
"@angular/language-service": "^5.0.0",
32+
"@angular/compiler-cli": "^5.2.3",
33+
"@angular/language-service": "^5.2.3",
3434
"@types/jasmine": "~2.5.53",
3535
"@types/jasminewd2": "~2.0.2",
36-
"@types/node": "~6.0.60",
37-
"codelyzer": "^4.0.1",
36+
"@types/node": "^6.0.96",
37+
"codelyzer": "^4.1.0",
3838
"jasmine-core": "~2.6.2",
3939
"jasmine-spec-reporter": "~4.1.0",
4040
"karma": "~1.7.0",
4141
"karma-chrome-launcher": "~2.1.1",
4242
"karma-cli": "~1.0.1",
43-
"karma-coverage-istanbul-reporter": "^1.2.1",
43+
"karma-coverage-istanbul-reporter": "^1.4.1",
4444
"karma-jasmine": "~1.1.0",
4545
"karma-jasmine-html-reporter": "^0.2.2",
4646
"protractor": "~5.1.2",

src/app/config.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Observable } from 'rxjs/Observable';
66
export class Config {
77
httpStoreUrl: string;
88
pollTimeout: number | string;
9+
deck?: string[]
910
}
1011

1112
@Injectable()

src/app/game/game.component.css

+14
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ tr.voting td {
5959
color: white;
6060
}
6161

62+
th button {
63+
font-size: 70%;
64+
padding: 3px 4px 2px;
65+
background-color: #888;
66+
color: #fff;
67+
border: none;
68+
cursor: pointer;
69+
}
70+
71+
th button:hover, .story button:focus {
72+
background-color: #aaa;
73+
color: white;
74+
}
75+
6276
.score {
6377
text-align: center;
6478
width: 80px;

src/app/game/game.component.html

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
<div *ngIf="session">
22
<h1>{{currentParticipant?.name || (isAdmin?'Admin':'Observer')}} @ {{session.name}}
33
<a routerLink="/join/{{sessionId}}" title="Invite more people to join"><i class="ti-share"></i></a></h1>
4-
<app-voting-pad *ngIf="votingStory && !isAdmin && !isObserver" [story]="votingStory"
4+
<app-voting-pad *ngIf="votingStory && currentParticipant" [story]="votingStory"
55
[confirmedVote]="votingStory.votes[currentParticipant.id]"
6+
[deck]="deck"
67
(vote)="httpStorage.vote($event)"></app-voting-pad>
78
<table>
89
<tr>
910
<th class="story">Story</th>
1011
<th *ngFor="let participant of participants" class="score"
1112
[class.current]="participant.id===currentParticipant?.id">
12-
<a *ngIf="isAdmin" routerLink="/play/{{sessionId}}/{{participant.id}}">{{participant.name}}</a>
13+
<span *ngIf="isAdmin"><a routerLink="/play/{{sessionId}}/{{participant.id}}">{{participant.name}}</a><br>
14+
<button type="button" title="Edit participant"
15+
(click)="editParticipant(participant.id)"><i class="ti-pencil"></i></button>
16+
</span>
1317
<span *ngIf="!isAdmin">{{participant.name}}</span>
1418
</th>
1519
</tr>
@@ -39,7 +43,14 @@ <h1>{{currentParticipant?.name || (isAdmin?'Admin':'Observer')}} @ {{session.nam
3943
</tr>
4044
</table>
4145

42-
<form *ngIf="editing">
46+
<form *ngIf="editingParticipant">
47+
<input type="text" name="name" [(ngModel)]="editingParticipantName" placeholder="Participant name...">
48+
<button type="submit" (click)="saveParticipantEdit()">Save</button>
49+
<button type="button" (click)="cancelParticipantEdit()">Cancel</button>
50+
<button type="button" (click)="deleteEditingParticipant()">Delete</button>
51+
</form>
52+
53+
<form *ngIf="editingStory">
4354
<input type="text" name="name" [(ngModel)]="editingStoryName" placeholder="Story name...">
4455
<button type="submit" (click)="saveStoryEdit()">Save</button>
4556
<button type="button" (click)="cancelStoryEdit()">Cancel</button>

0 commit comments

Comments
 (0)