
taskBoard: Remove the Task Board and related files.
@f7280519d6f82f5a50baa3882f3b32571c75b72f
--- app/Global.java
+++ app/Global.java
... | ... | @@ -30,7 +30,6 @@ |
30 | 30 |
"issues", "issueComments", |
31 | 31 |
"postings", "postingComments", |
32 | 32 |
"roles", "projectUsers", |
33 |
- "taskBoards", "lines", "cards", "labels", "checkLists", |
|
34 | 33 |
"siteAdmins" |
35 | 34 |
}; |
36 | 35 |
|
--- app/assets/stylesheets/less/_task.less
... | ... | @@ -1,576 +0,0 @@ |
1 | -html.task-body { | |
2 | - height: 100%; | |
3 | - body { | |
4 | - overflow-y: hidden; | |
5 | - overflow-x: auto; | |
6 | - height: 100%; | |
7 | - } | |
8 | - .page-wrap { | |
9 | - overflow: hidden; | |
10 | - min-height: 200px; | |
11 | - &.load { | |
12 | - .page { | |
13 | - .opacity(0); | |
14 | - } | |
15 | - } | |
16 | - .page { | |
17 | - height: 100%; | |
18 | - overflow: hidden; | |
19 | - } | |
20 | - } | |
21 | -} | |
22 | - | |
23 | -.task-page { | |
24 | - min-width: @base-width; | |
25 | - margin: 0 50px; | |
26 | - .gnb-outer { | |
27 | - .gnb-inner { | |
28 | - width: auto; | |
29 | - } | |
30 | - .sub-menu-sp, .side-menu-wrap { | |
31 | - width: auto; | |
32 | - } | |
33 | - } | |
34 | - .page-wrap, | |
35 | - .page-footer-outer { | |
36 | - width: auto; | |
37 | - margin-bottom: 0; | |
38 | - } | |
39 | - height: 100%; | |
40 | -} | |
41 | - | |
42 | -.task-main { | |
43 | - position: relative; | |
44 | - overflow: hidden; | |
45 | - .task-wrap { | |
46 | - margin-right: 300px; | |
47 | - background-color: #DADADA; | |
48 | - overflow: hidden; | |
49 | - .border-radius(10px 10px); | |
50 | - height: 100%; | |
51 | - } | |
52 | - .task-wrap-footer { | |
53 | - height: 20px; | |
54 | - .box-shadow(0 -1px 5px rgba(0, 0, 0, 0.05)); | |
55 | - } | |
56 | - .task-side { | |
57 | - height: 100%; | |
58 | - position: absolute; | |
59 | - width: 280px; | |
60 | - right: 0; | |
61 | - top: 0; | |
62 | - background-color: #F2F2F2; | |
63 | - .border-radius(10px); | |
64 | - .fixed-wrap { | |
65 | - padding: 10px 20px 0 20px; | |
66 | - } | |
67 | - .bg-bubble-top { | |
68 | - left: -27px; | |
69 | - position: relative; | |
70 | - } | |
71 | - .header { | |
72 | - line-height: 30px; | |
73 | - .title { | |
74 | - color: @white; | |
75 | - margin-left: 20px; | |
76 | - } | |
77 | - .ico { | |
78 | - margin-top: -7px; | |
79 | - position: absolute; | |
80 | - right: 10px; | |
81 | - top: 50%; | |
82 | - } | |
83 | - } | |
84 | - .members { | |
85 | - list-style: none; | |
86 | - margin: 0; | |
87 | - padding: 0 0 13px 0; | |
88 | - font-size: 0; | |
89 | - border-bottom: 1px solid @white; | |
90 | - .box-shadow(inset 0 -1px 0 rgba(0, 0, 0, 0.15)); | |
91 | - .member { | |
92 | - .inline-block; | |
93 | - margin: 0 7px 7px 0; | |
94 | - &:nth-child(6n) { | |
95 | - margin-right: 0; | |
96 | - } | |
97 | - .img-rounded { | |
98 | - display: block; | |
99 | - } | |
100 | - } | |
101 | - } | |
102 | - } | |
103 | - .activity-wrap { | |
104 | - overflow-x: hidden; | |
105 | - overflow-y: auto; | |
106 | - padding: 0 20px; | |
107 | - .activities { | |
108 | - list-style: none; | |
109 | - margin: 0; | |
110 | - padding: 0; | |
111 | - .activity { | |
112 | - p { | |
113 | - line-height: 12px; | |
114 | - margin-bottom: 5px; | |
115 | - } | |
116 | - padding: 15px 0; | |
117 | - border-bottom: 1px solid @gray-d4; | |
118 | - .actor-wrap { | |
119 | - margin-bottom: 10px; | |
120 | - .actor-info { | |
121 | - padding-left: 10px; | |
122 | - font-size: 11px; | |
123 | - color: #646464; | |
124 | - overflow: hidden; | |
125 | - .name { | |
126 | - font-size: 10px; | |
127 | - } | |
128 | - .act-date { | |
129 | - color: #B5B5B5; | |
130 | - font-size: 10px; | |
131 | - margin-bottom: 0; | |
132 | - } | |
133 | - } | |
134 | - } | |
135 | - .desc { | |
136 | - color: @gray-66; | |
137 | - &.mentioned { | |
138 | - font-size: 11px; | |
139 | - .border-radius(10px); | |
140 | - border: 1px solid @gray-d4; | |
141 | - background-color: #DBDBDB; | |
142 | - padding: 10px 5px; | |
143 | - .who { | |
144 | - font-weight: bold; | |
145 | - } | |
146 | - } | |
147 | - } | |
148 | - } | |
149 | - } | |
150 | - } | |
151 | -} | |
152 | - | |
153 | -.done-button-wrap { | |
154 | - text-align: right; | |
155 | - padding: 40px 20px 1px 0; | |
156 | - margin-bottom: 15px; | |
157 | - border-bottom: 1px solid @white; | |
158 | - .box-shadow(inset 0 -1px 0 rgba(0, 0, 0, 0.15)); | |
159 | - .btn-done { | |
160 | - font-size: 0; | |
161 | - line-height: 0; | |
162 | - height: 71px; | |
163 | - width: 166px; | |
164 | - .inline-block; | |
165 | - background-image: url('@{base-image-path}/assets/btn-done.png'); | |
166 | - } | |
167 | -} | |
168 | -.task-main { | |
169 | - &.done { | |
170 | - .tasks-proxy-header { | |
171 | - background-color: #999; | |
172 | - } | |
173 | - .task-header { | |
174 | - background-color: #999; | |
175 | - .card-count-wrap { | |
176 | - color: #DBDBDB; | |
177 | - background-color: #777; | |
178 | - } | |
179 | - } | |
180 | - .tasks { | |
181 | - | |
182 | - } | |
183 | - } | |
184 | -} | |
185 | -.tasks-proxy { | |
186 | - position: relative; | |
187 | - padding: 0 2px; | |
188 | - &.full { | |
189 | - overflow: hidden; | |
190 | - } | |
191 | - .tasks-proxy-header { | |
192 | - height: 55px; | |
193 | - width: 100%; | |
194 | - background-color: #4D4D4D; | |
195 | - .border-radius(10px 10px 0 0); | |
196 | - position: absolute; | |
197 | - z-index: 0; | |
198 | - left: 0; | |
199 | - } | |
200 | - overflow: hidden; | |
201 | - .task-header { | |
202 | - height: 55px; | |
203 | - text-align: center; | |
204 | - line-height: 55px; | |
205 | - background-color: #4D4D4D; | |
206 | - color: @white; | |
207 | - .card-count-wrap { | |
208 | - color: #4092A1; | |
209 | - font-size: 11px; | |
210 | - background-color: #333; | |
211 | - .inline-block; | |
212 | - padding: 1px 6px; | |
213 | - .border-radius(5px); | |
214 | - line-height: 11px; | |
215 | - } | |
216 | - } | |
217 | - .tasks { | |
218 | - height: 100%; | |
219 | - z-index: 1; | |
220 | - position: relative; | |
221 | - margin: 0; | |
222 | - padding: 0; | |
223 | - list-style: none; | |
224 | - overflow-y: hidden; | |
225 | - overflow-x: auto; | |
226 | - .task { | |
227 | - &:first-child { | |
228 | - padding-left: 10px; | |
229 | - } | |
230 | - &:last-child { | |
231 | - padding-right: 10px; | |
232 | - } | |
233 | - &.open { | |
234 | - min-width: 695px; | |
235 | - } | |
236 | - max-height: 100%; | |
237 | - display: table-cell; | |
238 | - position: relative; | |
239 | - z-index: 1; | |
240 | - border-right: 1px solid rgba(255, 255, 255, 0.3); | |
241 | - .box-shadow(inset -1px 0 0 rgba(0, 0, 0, 0.15)); | |
242 | - width: 235px; | |
243 | - .task-card-wrap { | |
244 | - float: left; | |
245 | - width: 220px; | |
246 | - } | |
247 | - .task-footer { | |
248 | - text-align: center; | |
249 | - font-size: 0; | |
250 | - padding: 10px 0 5px; | |
251 | - width: 220px; | |
252 | - .btn-add-card { | |
253 | - .inline-block; | |
254 | - background-image: url('@{base-image-path}/assets/btn-add-card.png'); | |
255 | - font-size: 0; | |
256 | - width: 130px; | |
257 | - height: 20px; | |
258 | - margin: 5px 0; | |
259 | - } | |
260 | - } | |
261 | - } | |
262 | - } | |
263 | -} | |
264 | - | |
265 | -.card-wrap { | |
266 | - overflow-y: auto; | |
267 | - .cards { | |
268 | - list-style: none; | |
269 | - margin: 0; | |
270 | - padding: 10px 10px 0 10px; | |
271 | - .card { | |
272 | - &.open { | |
273 | - border: 1px solid #5495A1; | |
274 | - } | |
275 | - cursor: pointer; | |
276 | - background-color: @white; | |
277 | - border: 1px solid @gray-d4; | |
278 | - .border-radius(8px); | |
279 | - margin-bottom: 8px; | |
280 | - .box-shadow(0 1px 0 rgba(0,0,0, .15)); | |
281 | - overflow: hidden; | |
282 | - .card-body { | |
283 | - padding: 7px 10px 0; | |
284 | - .card-title { | |
285 | - color: #999; | |
286 | - } | |
287 | - .card-assignees { | |
288 | - margin: 10px 0 5px; | |
289 | - padding: 0; | |
290 | - list-style: none; | |
291 | - > li { | |
292 | - float: left; | |
293 | - margin: 0 5px 5px 0; | |
294 | - .img-rounded { | |
295 | - display: block; | |
296 | - } | |
297 | - } | |
298 | - } | |
299 | - } | |
300 | - .card-footer { | |
301 | - padding: 0 10px; | |
302 | - height: 25px; | |
303 | - line-height: 25px; | |
304 | - background-color: #F5F5F5; | |
305 | - text-align: right; | |
306 | - color: #4092A1; | |
307 | - } | |
308 | - } | |
309 | - } | |
310 | -} | |
311 | - | |
312 | -.card-labels { | |
313 | - font-size: 0; | |
314 | - line-height: 10px; | |
315 | - overflow: hidden; | |
316 | - margin-bottom: 20px; | |
317 | - .btn-labels { | |
318 | - border: 1px solid #4092A1; | |
319 | - .box-shadow(); | |
320 | - .ico-arrow-down-blue { | |
321 | - vertical-align: middle; | |
322 | - } | |
323 | - } | |
324 | -} | |
325 | - | |
326 | -.card-label { | |
327 | - .inline-block; | |
328 | - min-height: 2px; | |
329 | - min-width: 2px; | |
330 | - font-size: 10px; | |
331 | - line-height: 12px; | |
332 | - font-weight: bold; | |
333 | - padding: 4px 8px; | |
334 | - margin-right: 3px; | |
335 | - color: @white; | |
336 | - &.empty { | |
337 | - padding: 0 9px; | |
338 | - height: 20px; | |
339 | - line-height: 20px; | |
340 | - } | |
341 | - &.round { | |
342 | - .border-radius(3px); | |
343 | - .box-shadow(0 1px 2px rgba(0, 0, 0, 0.20)); | |
344 | - } | |
345 | - &.red { | |
346 | - background-color: #DA5454; | |
347 | - } | |
348 | - &.navy { | |
349 | - background-color: #4B68B1; | |
350 | - } | |
351 | - &.blue { | |
352 | - background-color: #22B4B9; | |
353 | - } | |
354 | - &.purple { | |
355 | - background-color: #9966CC; | |
356 | - } | |
357 | - &.green { | |
358 | - background-color: #99CA3C; | |
359 | - } | |
360 | - &.yellow { | |
361 | - background-color: #FFCC33; | |
362 | - } | |
363 | - &.orange { | |
364 | - background-color: #FF9933; | |
365 | - } | |
366 | - &.gray { | |
367 | - background-color: #999999; | |
368 | - } | |
369 | -} | |
370 | - | |
371 | -.task-card-detail-bg { | |
372 | - width: 440px; | |
373 | - float: right; | |
374 | - overflow-y: auto; | |
375 | - padding: 10px 20px 20px 15px; | |
376 | - background-color: #BEBEBE; | |
377 | - .box-shadow(0 0 5px 1px rgba(0, 0, 0, 0.10) inset); | |
378 | - .hr { | |
379 | - margin: 15px 0; | |
380 | - } | |
381 | - .card-detail-wrap { | |
382 | - width: 440px; | |
383 | - background-color: @white; | |
384 | - .border-radius(10px); | |
385 | - padding: 20px 0 0; | |
386 | - .card-detail { | |
387 | - position: relative; | |
388 | - .inner { | |
389 | - padding: 0 20px; | |
390 | - } | |
391 | - } | |
392 | - .card-close { | |
393 | - position: absolute; | |
394 | - top: 0; | |
395 | - right: 20px; | |
396 | - } | |
397 | - .edit-label-wrap { | |
398 | - background-color: #E7E7E7; | |
399 | - border-top: 1px solid #C4C4C4; | |
400 | - border-bottom: 1px solid #C4C4C4; | |
401 | - .dp-label-wrap { | |
402 | - font-size: 0; | |
403 | - border-top: 3px solid #DDD; | |
404 | - padding: 10px 20px; | |
405 | - .close-label{ | |
406 | - .inline-block; | |
407 | - margin-left: 5px; | |
408 | - } | |
409 | - } | |
410 | - .choose-label-wrap { | |
411 | - position: relative; | |
412 | - line-height: 1; | |
413 | - border-top: 1px solid #C1C1C1; | |
414 | - font-size: 0; | |
415 | - background-color: #D7D7D7; | |
416 | - padding: 10px 20px; | |
417 | - .top-arrow { | |
418 | - position: absolute; | |
419 | - border-left: 10px solid transparent; | |
420 | - border-right: 10px solid transparent; | |
421 | - border-bottom: 10px solid #C1C1C1; | |
422 | - top: -10px; | |
423 | - left: 50%; | |
424 | - width: 0; | |
425 | - height: 0; | |
426 | - margin-left: -10px; | |
427 | - .bg-arrow { | |
428 | - width: 0; | |
429 | - height: 0; | |
430 | - margin-left: -8px; | |
431 | - margin-top: 2px; | |
432 | - border-left: 8px solid transparent; | |
433 | - border-right: 8px solid transparent; | |
434 | - border-bottom: 8px solid #D7D7D7; | |
435 | - } | |
436 | - } | |
437 | - .label-name { | |
438 | - width: 129px; | |
439 | - height: 14px; | |
440 | - vertical-align: top; | |
441 | - padding: 3px 6px; | |
442 | - margin: 0 0 0 2px; | |
443 | - } | |
444 | - .add-label { | |
445 | - color: #4D4D4D; | |
446 | - font-weight: bold; | |
447 | - font-size: 11px; | |
448 | - text-decoration: none; | |
449 | - line-height: 22px; | |
450 | - margin-left: 40px; | |
451 | - } | |
452 | - } | |
453 | - } | |
454 | - .title { | |
455 | - font-size: 14px; | |
456 | - color: @black; | |
457 | - line-height: 16px; | |
458 | - margin: 0 0 20px; | |
459 | - | |
460 | - } | |
461 | - .members { | |
462 | - margin: 0 0 30px; | |
463 | - list-style: none; | |
464 | - overflow: hidden; | |
465 | - .member { | |
466 | - float: left; | |
467 | - margin-right: 3px; | |
468 | - .img-rounded { | |
469 | - display: block; | |
470 | - } | |
471 | - } | |
472 | - } | |
473 | - .header-label { | |
474 | - font-size: 14px; | |
475 | - margin: 28px 0 10px; | |
476 | - .num { | |
477 | - color: #51AACC; | |
478 | - } | |
479 | - } | |
480 | - .desc { | |
481 | - color: #666; | |
482 | - font-size: 12px; | |
483 | - margin-bottom: 20px; | |
484 | - } | |
485 | - .edit-btn { | |
486 | - color: #A2A2A2; | |
487 | - font-size: 10px; | |
488 | - text-decoration: none; | |
489 | - } | |
490 | - } | |
491 | - .card-activities { | |
492 | - margin-top: 30px; | |
493 | - padding: 0 20px; | |
494 | - background-color: #F5F5F5; | |
495 | - .border-radius(0 0 10px 10px); | |
496 | - .header { | |
497 | - overflow: hidden; | |
498 | - padding: 15px 0 0; | |
499 | - } | |
500 | - .title { | |
501 | - font-size: 14px; | |
502 | - margin: 0 0 10px 0; | |
503 | - line-height: 18px; | |
504 | - color: #222; | |
505 | - } | |
506 | - .num { | |
507 | - color: #51AACC; | |
508 | - font-size: 14px; | |
509 | - &.small { | |
510 | - font-size: 11px; | |
511 | - } | |
512 | - } | |
513 | - .card-state { | |
514 | - .ico { | |
515 | - margin-right: 3px; | |
516 | - vertical-align: middle; | |
517 | - &.ico-blue-dot { | |
518 | - margin-left: 3px; | |
519 | - } | |
520 | - } | |
521 | - } | |
522 | - .comment-wrap { | |
523 | - .media-body { | |
524 | - margin-left: 44px; | |
525 | - .comment { | |
526 | - width: 342px; | |
527 | - margin-bottom: 5px; | |
528 | - } | |
529 | - .btns { | |
530 | - font-size: 0; | |
531 | - .blue { | |
532 | - margin-right: 7px; | |
533 | - } | |
534 | - } | |
535 | - } | |
536 | - .comments { | |
537 | - margin-top: 20px; | |
538 | - overflow: hidden; | |
539 | - list-style: none; | |
540 | - margin: 0; | |
541 | - .comment{ | |
542 | - padding: 15px 0; | |
543 | - border-top: 1px solid #DCDCDC; | |
544 | - .comment-info { | |
545 | - margin-bottom: 10px; | |
546 | - font-size: 10px; | |
547 | - color: #646464; | |
548 | - .uname { | |
549 | - font-size: 11px; | |
550 | - font-weight: bold; | |
551 | - } | |
552 | - .date { | |
553 | - color: #BDBDBD; | |
554 | - } | |
555 | - } | |
556 | - .comment-body { | |
557 | - color: #666; | |
558 | - &.mentioned { | |
559 | - background-color: #DCDCDC; | |
560 | - .border-radius(10px); | |
561 | - border: 1px solid #D3D3D3; | |
562 | - padding: 10px 15px; | |
563 | - font-size: 11px; | |
564 | - .who { | |
565 | - margin-bottom: 5px; | |
566 | - } | |
567 | - } | |
568 | - } | |
569 | - } | |
570 | - } | |
571 | - } | |
572 | - } | |
573 | - .card-detail-footer { | |
574 | - height: 20px; | |
575 | - } | |
576 | -} |
--- app/assets/stylesheets/nforge.less
+++ app/assets/stylesheets/nforge.less
... | ... | @@ -4,4 +4,3 @@ |
4 | 4 |
@import "less/_sprites.less"; |
5 | 5 |
@import "less/_page.less"; |
6 | 6 |
@import "less/_buttons.less"; |
7 |
-@import "less/_task.less";(No newline at end of file) |
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -6,7 +6,6 @@ |
6 | 6 |
import models.enumeration.RoleType; |
7 | 7 |
import models.enumeration.Direction; |
8 | 8 |
import models.enumeration.Matching; |
9 |
-import models.task.CardAssignee; |
|
10 | 9 |
import models.support.*; |
11 | 10 |
import play.data.Form; |
12 | 11 |
import play.db.ebean.Transactional; |
... | ... | @@ -203,9 +202,6 @@ |
203 | 202 |
if (project.owner.equals((User.find.byId(userId).name).toLowerCase())) { |
204 | 203 |
flash(Constants.WARNING, "project.member.ownerCannotLeave"); |
205 | 204 |
return redirect(routes.ProjectApp.members(userName, projectName)); |
206 |
- } |
|
207 |
- for (CardAssignee cardAssignee : CardAssignee.findByAssignee(userId)) { |
|
208 |
- cardAssignee.delete(); |
|
209 | 205 |
} |
210 | 206 |
ProjectUser.delete(userId, project.id); |
211 | 207 |
return redirect(routes.ProjectApp.members(userName, projectName)); |
--- app/controllers/TaskApp.java
... | ... | @@ -1,109 +0,0 @@ |
1 | -package controllers; | |
2 | - | |
3 | -import java.util.Map; | |
4 | - | |
5 | -import models.Project; | |
6 | -import models.enumeration.Operation; | |
7 | -import models.task.Card; | |
8 | -import models.task.Line; | |
9 | -import models.task.TaskBoard; | |
10 | -import models.task.TaskComment; | |
11 | - | |
12 | -import org.codehaus.jackson.JsonNode; | |
13 | - | |
14 | -import play.mvc.BodyParser; | |
15 | -import play.mvc.Controller; | |
16 | -import play.mvc.Result; | |
17 | -import play.mvc.WebSocket; | |
18 | -import utils.AccessControl; | |
19 | -import views.html.task.cardView; | |
20 | -import views.html.task.taskView; | |
21 | -import controllers.webSocket.WebSocketServer; | |
22 | - | |
23 | -public class TaskApp extends Controller { | |
24 | - public static Result index(String userName, String projectName) { | |
25 | - Project project = ProjectApp.getProject(userName, projectName); | |
26 | - if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) { | |
27 | - return unauthorized(views.html.project.unauthorized.render(project)); | |
28 | - } | |
29 | - return ok(taskView.render(project)); | |
30 | - } | |
31 | - | |
32 | - public static Result card(String userName, String projectName, Long cardId) { | |
33 | - Project project = ProjectApp.getProject(userName, projectName); | |
34 | - if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) { | |
35 | - return unauthorized(views.html.project.unauthorized.render(project)); | |
36 | - } | |
37 | - | |
38 | - return ok(Card.findById(cardId).toJSON()); | |
39 | - } | |
40 | - | |
41 | - public static Result getLabels(String userName, String projectName) { | |
42 | - Project project = ProjectApp.getProject(userName, projectName); | |
43 | - if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) { | |
44 | - return unauthorized(views.html.project.unauthorized.render(project)); | |
45 | - } | |
46 | - TaskBoard taskBoard = TaskBoard.findByProject(project); | |
47 | - return ok(taskBoard.getLabel()); | |
48 | - } | |
49 | - | |
50 | - public static Result getMember(String userName, String projectName) { | |
51 | - Project project = ProjectApp.getProject(userName, projectName); | |
52 | - if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) { | |
53 | - return unauthorized(views.html.project.unauthorized.render(project)); | |
54 | - } | |
55 | - TaskBoard taskBoard = TaskBoard.findByProject(project); | |
56 | - return ok(taskBoard.getMember()); | |
57 | - } | |
58 | - | |
59 | - // TestCode 나중에 전부 웹소켓으로 바꾼다. 당연히 그걸 고려해서 짜야한다. | |
60 | - public static Result cardView(String userName, String projectName) { | |
61 | - Project project = ProjectApp.getProject(userName, projectName); | |
62 | - if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) { | |
63 | - return unauthorized(views.html.project.unauthorized.render(project)); | |
64 | - } | |
65 | - return ok(cardView.render(project)); | |
66 | - } | |
67 | - | |
68 | - @BodyParser.Of(BodyParser.Json.class) | |
69 | - public static Result newCard(String userName, String projectName) { | |
70 | - JsonNode json = request().body().asJson(); | |
71 | - Long line_id = json.findPath("line_id").asLong(); | |
72 | - Line line = Line.findById(line_id); | |
73 | - Card card = new Card(); | |
74 | - card.title = json.get("card_data").asText(); | |
75 | - line.addCard(card); | |
76 | - json = card.toJSON(); | |
77 | - return ok(json); | |
78 | - } | |
79 | - | |
80 | - @BodyParser.Of(BodyParser.Json.class) | |
81 | - public static Result saveCard(String userName, String projectName) { | |
82 | - JsonNode json = request().body().asJson(); | |
83 | - Long cardid = json.findPath("_id").asLong(); | |
84 | - Card.findById(cardid).accecptJSON(json); | |
85 | - return ok(); | |
86 | - } | |
87 | - | |
88 | - public static Result addComment(String userName, String projectName) { | |
89 | - Map<String, String[]> data = request().body().asFormUrlEncoded(); | |
90 | - Long cardid = Long.parseLong(data.get("_id")[0]); | |
91 | - String body = data.get("body")[0]; | |
92 | - Card card = Card.findById(cardid); | |
93 | - | |
94 | - TaskComment comment = new TaskComment(); | |
95 | - comment.body = body; | |
96 | - // ProjectUser 추가방법 생각할것. | |
97 | - | |
98 | - card.addComment(comment); | |
99 | - | |
100 | - return ok(); | |
101 | - } | |
102 | - | |
103 | - // TestCode End | |
104 | - | |
105 | - public static WebSocket<String> connect(String userName, String projectName) { | |
106 | - return WebSocketServer.handelWebSocket(userName, projectName); | |
107 | - } | |
108 | - | |
109 | -}(No newline at end of file) |
--- app/controllers/webSocket/WebSocketConnector.java
... | ... | @@ -1,57 +0,0 @@ |
1 | -package controllers.webSocket; | |
2 | - | |
3 | -import models.task.TaskBoard; | |
4 | -import play.Logger; | |
5 | -import play.libs.F.Callback; | |
6 | -import play.libs.F.Callback0; | |
7 | -import play.libs.Json; | |
8 | -import play.mvc.WebSocket; | |
9 | -import controllers.ProjectApp; | |
10 | - | |
11 | -public class WebSocketConnector extends WebSocket<String> implements Callback<String>, | |
12 | - Callback0 { | |
13 | - | |
14 | - private String userName; | |
15 | - private String projectName; | |
16 | - private play.mvc.WebSocket.Out<String> out; | |
17 | - private WebSocketServer server; | |
18 | - private TaskBoard taskBoard; | |
19 | - | |
20 | - public WebSocketConnector(String userName, String projectName, | |
21 | - WebSocketServer webSocketServer) { | |
22 | - this.userName = userName; | |
23 | - this.projectName = projectName; | |
24 | - this.server = webSocketServer; | |
25 | - } | |
26 | - | |
27 | - @Override | |
28 | - public void onReady(play.mvc.WebSocket.In<String> in, play.mvc.WebSocket.Out<String> out) { | |
29 | - // For each event received on the socket, | |
30 | - in.onMessage(this); | |
31 | - in.onClose(this); | |
32 | - | |
33 | - this.out = out; | |
34 | - | |
35 | - taskBoard = TaskBoard.findByProject(ProjectApp.getProject(userName, projectName)); | |
36 | - out.write(Json.stringify(taskBoard.toJSON())); | |
37 | - } | |
38 | - | |
39 | - public void sendMessage(String msg) { | |
40 | - out.write(msg); | |
41 | - } | |
42 | - | |
43 | - @Override | |
44 | - public void invoke(String event) throws Throwable { | |
45 | - // 클라이언트에서 모델을 보내올때 | |
46 | - this.server.sendNotify(this, event); | |
47 | - this.taskBoard.accecptJSON(Json.parse(event)); | |
48 | - } | |
49 | - | |
50 | - @Override | |
51 | - public void invoke() throws Throwable { | |
52 | - // 닫혔을떄. | |
53 | - this.server.removeWebSocket(this); | |
54 | - Logger.info("Disconnected"); | |
55 | - } | |
56 | - | |
57 | -} |
--- app/controllers/webSocket/WebSocketServer.java
... | ... | @@ -1,44 +0,0 @@ |
1 | -package controllers.webSocket; | |
2 | - | |
3 | -import java.util.ArrayList; | |
4 | -import java.util.HashMap; | |
5 | - | |
6 | -public class WebSocketServer { | |
7 | - | |
8 | - private static HashMap<String, WebSocketServer> serverList = new HashMap<String, WebSocketServer>(); | |
9 | - | |
10 | - public static WebSocketConnector handelWebSocket(String userName, String projectName) { | |
11 | - String key = userName + "/" + projectName; | |
12 | - WebSocketServer server = serverList.get(key); | |
13 | - if (server == null) { | |
14 | - server = new WebSocketServer(key); | |
15 | - } | |
16 | - WebSocketConnector webSocketConnector = new WebSocketConnector(userName, projectName, | |
17 | - server); | |
18 | - server.addWebSocket(webSocketConnector); | |
19 | - return webSocketConnector; | |
20 | - } | |
21 | - | |
22 | - public WebSocketServer(String key) { | |
23 | - serverList.put(key, this); | |
24 | - } | |
25 | - | |
26 | - private ArrayList<WebSocketConnector> sockets = new ArrayList<WebSocketConnector>(); | |
27 | - | |
28 | - private void addWebSocket(WebSocketConnector webSocket) { | |
29 | - sockets.add(webSocket); | |
30 | - } | |
31 | - | |
32 | - public void removeWebSocket(WebSocketConnector webSocket) { | |
33 | - sockets.remove(webSocket); | |
34 | - } | |
35 | - | |
36 | - public void sendNotify(WebSocketConnector that, String msg) { | |
37 | - for (int i = 0; i < sockets.size(); i++) { | |
38 | - WebSocketConnector socket = sockets.get(i); | |
39 | - if (socket != that) { | |
40 | - socket.sendMessage(msg); | |
41 | - } | |
42 | - } | |
43 | - } | |
44 | -} |
--- app/models/Project.java
+++ app/models/Project.java
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 |
import models.enumeration.ResourceType; |
15 | 15 |
import models.enumeration.RoleType; |
16 | 16 |
import models.resource.Resource; |
17 |
-import models.task.TaskBoard; |
|
18 | 17 |
|
19 | 18 |
import org.eclipse.jgit.api.errors.GitAPIException; |
20 | 19 |
import org.eclipse.jgit.api.errors.NoHeadException; |
... | ... | @@ -76,9 +75,6 @@ |
76 | 75 |
|
77 | 76 |
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL) |
78 | 77 |
public List<Milestone> milestones; |
79 |
- |
|
80 |
- @OneToOne(mappedBy = "project", cascade = CascadeType.ALL) |
|
81 |
- public TaskBoard taskBoard; |
|
82 | 78 |
|
83 | 79 |
public static Long create(Project newProject) { |
84 | 80 |
newProject.siteurl = "http://localhost:9000/" + newProject.name; |
--- app/models/task/Card.java
... | ... | @@ -1,162 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import java.util.Date; | |
4 | -import java.util.List; | |
5 | -import java.util.Set; | |
6 | - | |
7 | -import javax.persistence.CascadeType; | |
8 | -import javax.persistence.Entity; | |
9 | -import javax.persistence.Id; | |
10 | -import javax.persistence.ManyToOne; | |
11 | -import javax.persistence.OneToMany; | |
12 | -import javax.persistence.OneToOne; | |
13 | -import javax.persistence.Transient; | |
14 | - | |
15 | -import org.codehaus.jackson.JsonNode; | |
16 | -import org.codehaus.jackson.node.ArrayNode; | |
17 | -import org.codehaus.jackson.node.ObjectNode; | |
18 | - | |
19 | -import play.db.ebean.Model; | |
20 | -import play.libs.Json; | |
21 | - | |
22 | -@Entity | |
23 | -public class Card extends Model { | |
24 | - private static final long serialVersionUID = 1L; | |
25 | - | |
26 | - @Id | |
27 | - public Long id; | |
28 | - public String title; | |
29 | - | |
30 | - @OneToOne(cascade = CascadeType.ALL) | |
31 | - public Checklist checklist; | |
32 | - | |
33 | - @OneToMany(mappedBy = "card", cascade = CascadeType.ALL) | |
34 | - public List<TaskComment> comments; | |
35 | - | |
36 | - @ManyToOne | |
37 | - public Line line; | |
38 | - | |
39 | - @OneToMany(cascade = CascadeType.ALL) | |
40 | - public Set<CardAssignee> assignee; | |
41 | - | |
42 | - @OneToMany(cascade = CascadeType.ALL) | |
43 | - public Set<CardLabel> labels; | |
44 | - | |
45 | - public int storyPoint; // !주의 10배로 표현 | |
46 | - | |
47 | - public String body; | |
48 | - public Date dueDate; | |
49 | - | |
50 | - public static Finder<Long, Card> find = new Finder<Long, Card>(Long.class, | |
51 | - Card.class); | |
52 | - | |
53 | - public static Card findById(Long id) { | |
54 | - return find.byId(id); | |
55 | - } | |
56 | - | |
57 | - public static List<Card> findByAssignee(Long userId) { | |
58 | - return find.where().eq("assignee.id", userId).findList(); | |
59 | - } | |
60 | - | |
61 | - public void addComment(TaskComment comment) { | |
62 | - comments.add(comment); | |
63 | - comment.card = this; | |
64 | - comment.save(); | |
65 | - save(); | |
66 | - } | |
67 | - | |
68 | - public void removeComment(TaskComment comment) { | |
69 | - comments.remove(comment); | |
70 | - } | |
71 | - | |
72 | - /* | |
73 | - * public void addCheckList(CheckList checklist) { if(this.checkList != | |
74 | - * null){ this.checkList.delete(); } this.checkList = checklist; | |
75 | - * checklist.save(); } | |
76 | - */ | |
77 | - | |
78 | - @Transient | |
79 | - public JsonNode toJSON() { | |
80 | - | |
81 | - ObjectNode json = Json.newObject(); | |
82 | - json.put("_id", id); | |
83 | - json.put("title", title); | |
84 | - json.put("body", body); | |
85 | - json.put("storyPoint", storyPoint); | |
86 | - ArrayNode commentsJson = Json.newObject().arrayNode(); | |
87 | - for (TaskComment comment : comments) { | |
88 | - commentsJson.add(comment.toJSON()); | |
89 | - } | |
90 | - json.put("comments", commentsJson); | |
91 | - | |
92 | - ArrayNode assigneeJson = Json.newObject().arrayNode(); | |
93 | - for (CardAssignee cardAssignee : assignee) { | |
94 | - ObjectNode tmp = Json.newObject(); | |
95 | - tmp.put("_id", cardAssignee.projectUser.id); | |
96 | - tmp.put("loginId", cardAssignee.projectUser.user.loginId); | |
97 | - assigneeJson.add(tmp); | |
98 | - } | |
99 | - json.put("assignee", assigneeJson); | |
100 | - | |
101 | - ArrayNode labelsJson = Json.newObject().arrayNode(); | |
102 | - for (CardLabel label : labels) { | |
103 | - ObjectNode tmp = Json.newObject(); | |
104 | - tmp.put("_id", label.label.id); | |
105 | - tmp.put("name", label.label.name); | |
106 | - labelsJson.add(tmp); | |
107 | - } | |
108 | - json.put("labels", labelsJson); | |
109 | - | |
110 | - if (checklist != null) { | |
111 | - json.put("checklist", checklist.toJSON()); | |
112 | - } | |
113 | - | |
114 | - return json; | |
115 | - } | |
116 | - | |
117 | - public void accecptJSON(JsonNode json) { | |
118 | - title = json.get("title").asText(); | |
119 | - body = json.get("body").asText(); | |
120 | - storyPoint = json.get("storyPoint").asInt(); | |
121 | - JsonNode checklistJson = json.get("checklist"); | |
122 | - if (checklistJson != null) { | |
123 | - if (checklist == null) { | |
124 | - checklist = new Checklist(); | |
125 | - } | |
126 | - checklist.acceptJSON(checklistJson); | |
127 | - } else { | |
128 | - if(checklist != null){ | |
129 | - checklist.delete(); | |
130 | - } | |
131 | - checklist = null; | |
132 | - } | |
133 | - | |
134 | - JsonNode assigneeJson = json.get("assignee"); | |
135 | - for (CardAssignee tmp : assignee) { | |
136 | - tmp.delete(); | |
137 | - } | |
138 | - assignee.clear(); | |
139 | - | |
140 | - for (int i = 0; i < assigneeJson.size(); i++) { | |
141 | - JsonNode memberJson = assigneeJson.get(i); | |
142 | - Long projectUserId = memberJson.get("_id").asLong(); | |
143 | - CardAssignee cardAssignee = new CardAssignee(this, projectUserId); | |
144 | - assignee.add(cardAssignee); | |
145 | - } | |
146 | - | |
147 | - JsonNode labelsJson = json.get("labels"); | |
148 | - | |
149 | - for (CardLabel label : this.labels) { | |
150 | - label.delete(); | |
151 | - } | |
152 | - this.labels.clear(); | |
153 | - for (int i = 0; i < labelsJson.size(); i++) { | |
154 | - JsonNode labelJson = labelsJson.get(i); | |
155 | - Long labelId = labelJson.get("_id").asLong(); | |
156 | - labelJson.get("name"); | |
157 | - this.labels.add(new CardLabel(this, labelId)); | |
158 | - } | |
159 | - this.save(); | |
160 | - } | |
161 | - | |
162 | -} |
--- app/models/task/CardAssignee.java
... | ... | @@ -1,39 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import java.util.List; | |
4 | - | |
5 | -import javax.persistence.Entity; | |
6 | -import javax.persistence.Id; | |
7 | -import javax.persistence.ManyToOne; | |
8 | - | |
9 | -import models.ProjectUser; | |
10 | -import play.db.ebean.Model; | |
11 | - | |
12 | -@Entity | |
13 | -public class CardAssignee extends Model { | |
14 | - private static final long serialVersionUID = -4353337723141836877L; | |
15 | - | |
16 | - private static Finder<Long, CardAssignee> find = new Finder<Long, CardAssignee>(Long.class, | |
17 | - CardAssignee.class); | |
18 | - | |
19 | - public CardAssignee() { | |
20 | - | |
21 | - } | |
22 | - | |
23 | - public CardAssignee(Card card, Long projectUserId) { | |
24 | - projectUser = ProjectUser.findById(projectUserId); | |
25 | - } | |
26 | - | |
27 | - @Id | |
28 | - public Long id; | |
29 | - | |
30 | - @ManyToOne | |
31 | - public Card card; | |
32 | - | |
33 | - @ManyToOne | |
34 | - public ProjectUser projectUser; | |
35 | - | |
36 | - public static List<CardAssignee> findByAssignee(Long userId) { | |
37 | - return find.where().eq("projectUser.user.id", userId).findList(); | |
38 | - } | |
39 | -}(No newline at end of file) |
--- app/models/task/CardLabel.java
... | ... | @@ -1,31 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import javax.persistence.Entity; | |
4 | -import javax.persistence.Id; | |
5 | -import javax.persistence.ManyToOne; | |
6 | - | |
7 | -import play.db.ebean.Model; | |
8 | - | |
9 | -@Entity | |
10 | -public class CardLabel extends Model { | |
11 | - | |
12 | - private static final long serialVersionUID = -5436658861223275375L; | |
13 | - | |
14 | - public CardLabel() { | |
15 | - // TODO Auto-generated constructor stub | |
16 | - } | |
17 | - | |
18 | - public CardLabel(Card card, Long labelId) { | |
19 | - this.card = card; | |
20 | - this.label = Label.findById(labelId); | |
21 | - } | |
22 | - | |
23 | - @Id | |
24 | - public Long id; | |
25 | - | |
26 | - @ManyToOne | |
27 | - public Card card; | |
28 | - | |
29 | - @ManyToOne | |
30 | - public Label label; | |
31 | -} |
--- app/models/task/Checklist.java
... | ... | @@ -1,72 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import java.util.List; | |
4 | - | |
5 | -import javax.persistence.CascadeType; | |
6 | -import javax.persistence.Entity; | |
7 | -import javax.persistence.Id; | |
8 | -import javax.persistence.OneToMany; | |
9 | - | |
10 | -import org.codehaus.jackson.JsonNode; | |
11 | -import org.codehaus.jackson.node.ArrayNode; | |
12 | -import org.codehaus.jackson.node.ObjectNode; | |
13 | - | |
14 | -import play.db.ebean.Model; | |
15 | -import play.libs.Json; | |
16 | - | |
17 | -@Entity | |
18 | -public class Checklist extends Model { | |
19 | - private static final long serialVersionUID = 1L; | |
20 | - | |
21 | - @Id | |
22 | - public Long id; | |
23 | - public String title; | |
24 | - | |
25 | - @OneToMany(cascade = CascadeType.ALL, mappedBy = "checklist") | |
26 | - public List<Item> items; | |
27 | - | |
28 | - public static Finder<Long, Checklist> find = new Finder<Long, Checklist>( | |
29 | - Long.class, Checklist.class); | |
30 | - | |
31 | - public static Checklist findById(Long id) { | |
32 | - return find.byId(id); | |
33 | - } | |
34 | - | |
35 | - public void addItem(Item item) { | |
36 | - item.save(); | |
37 | - items.add(item); | |
38 | - } | |
39 | - | |
40 | - public void removeItem(Item item) { | |
41 | - items.remove(item); | |
42 | - item.delete(); | |
43 | - } | |
44 | - | |
45 | - public JsonNode toJSON() { | |
46 | - ObjectNode json = Json.newObject(); | |
47 | - json.put("title", title); | |
48 | - ArrayNode itemsJson = Json.newObject().arrayNode(); | |
49 | - for (Item item : items) { | |
50 | - itemsJson.add(item.toJSON()); | |
51 | - } | |
52 | - json.put("items", itemsJson); | |
53 | - return json; | |
54 | - } | |
55 | - | |
56 | - public void acceptJSON(JsonNode json) { | |
57 | - // TODO MAEKTEST | |
58 | - title = json.get("title").asText(); | |
59 | - JsonNode itemsJson = json.get("items"); | |
60 | - for (Item item : items) { | |
61 | - item.delete(); | |
62 | - } | |
63 | - items.clear(); | |
64 | - for (int i = 0; i < itemsJson.size(); i++) { | |
65 | - JsonNode itemJson = itemsJson.get(i); | |
66 | - Item item = new Item(); | |
67 | - item.acceptJSON(itemJson); | |
68 | - items.add(item); | |
69 | - } | |
70 | - save(); | |
71 | - } | |
72 | -} |
--- app/models/task/Item.java
... | ... | @@ -1,51 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import javax.persistence.Entity; | |
4 | -import javax.persistence.Id; | |
5 | -import javax.persistence.ManyToOne; | |
6 | - | |
7 | -import org.codehaus.jackson.JsonNode; | |
8 | -import org.codehaus.jackson.node.ObjectNode; | |
9 | - | |
10 | -import play.db.ebean.Model; | |
11 | -import play.libs.Json; | |
12 | - | |
13 | -@Entity | |
14 | -public class Item extends Model { | |
15 | - private static final long serialVersionUID = 1L; | |
16 | - | |
17 | - @Id | |
18 | - public Long id; | |
19 | - private boolean state;//체크 안체크 | |
20 | - public String body; | |
21 | - | |
22 | - @ManyToOne | |
23 | - public Checklist checklist; | |
24 | - | |
25 | - public boolean isDone(){ | |
26 | - return state; | |
27 | - } | |
28 | - public void check(){ | |
29 | - state = true; | |
30 | - } | |
31 | - public void uncheck(){ | |
32 | - state = false; | |
33 | - } | |
34 | - | |
35 | - public static Finder<Long, Item> find = new Finder<Long, Item>(Long.class, Item.class); | |
36 | - | |
37 | - public static Item findById(Long id) { | |
38 | - return find.byId(id); | |
39 | - } | |
40 | - public JsonNode toJSON() { | |
41 | - // TODO MAKETEST | |
42 | - ObjectNode json = Json.newObject(); | |
43 | - json.put("state", state); | |
44 | - json.put("body", body); | |
45 | - return json; | |
46 | - } | |
47 | - public void acceptJSON(JsonNode json){ | |
48 | - body = json.get("body").asText(); | |
49 | - state = json.get("state").asBoolean(); | |
50 | - } | |
51 | -} |
--- app/models/task/Label.java
... | ... | @@ -1,39 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import javax.persistence.Entity; | |
4 | -import javax.persistence.Id; | |
5 | -import javax.persistence.ManyToOne; | |
6 | - | |
7 | -import org.codehaus.jackson.JsonNode; | |
8 | -import org.codehaus.jackson.node.ObjectNode; | |
9 | - | |
10 | -import play.db.ebean.Model; | |
11 | -import play.libs.Json; | |
12 | - | |
13 | -@Entity | |
14 | -public class Label extends Model{ | |
15 | - private static final long serialVersionUID = 1L; | |
16 | - | |
17 | - @Id | |
18 | - public Long id; | |
19 | - public String name; | |
20 | - public String color;//#ffffff | |
21 | - | |
22 | - @ManyToOne | |
23 | - public TaskBoard taskBoard; | |
24 | - | |
25 | - private static Finder<Long, Label> find = new Finder<Long, Label>(Long.class, Label.class); | |
26 | - | |
27 | - public static Label findById(Long id) { | |
28 | - return find.byId(id);//TODO 테스트 코드 추가해야 함. | |
29 | - } | |
30 | - | |
31 | - public JsonNode toJSON() { | |
32 | - //TODO TESTCODE 작성 | |
33 | - ObjectNode json = Json.newObject(); | |
34 | - json.put("_id", id); | |
35 | - json.put("name", name); | |
36 | - json.put("color", color); | |
37 | - return json; | |
38 | - } | |
39 | -} |
--- app/models/task/Line.java
... | ... | @@ -1,77 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import java.util.List; | |
4 | - | |
5 | -import javax.persistence.CascadeType; | |
6 | -import javax.persistence.Entity; | |
7 | -import javax.persistence.Id; | |
8 | -import javax.persistence.ManyToOne; | |
9 | -import javax.persistence.OneToMany; | |
10 | - | |
11 | -import org.codehaus.jackson.JsonNode; | |
12 | -import org.codehaus.jackson.node.ArrayNode; | |
13 | -import org.codehaus.jackson.node.ObjectNode; | |
14 | - | |
15 | -import play.db.ebean.Model; | |
16 | -import play.libs.Json; | |
17 | - | |
18 | -@Entity | |
19 | -public class Line extends Model { | |
20 | - private static final long serialVersionUID = 1L; | |
21 | - | |
22 | - @Id | |
23 | - public Long id; | |
24 | - public String title; | |
25 | - | |
26 | - @OneToMany(mappedBy="line", cascade=CascadeType.ALL) | |
27 | - public List<Card> cards; | |
28 | - | |
29 | - @ManyToOne | |
30 | - public TaskBoard taskBoard; | |
31 | - | |
32 | - private static Finder<Long, Line> find = new Finder<Long, Line>(Long.class, Line.class); | |
33 | - | |
34 | - public JsonNode toJSON() { | |
35 | - ObjectNode json = Json.newObject(); | |
36 | - json.put("_id", id); | |
37 | - json.put("title", this.title); | |
38 | - ArrayNode arr = Json.newObject().arrayNode(); | |
39 | - for(Card card : cards){ | |
40 | - arr.add(card.toJSON()); | |
41 | - } | |
42 | - json.put("cards", arr); | |
43 | - return json; | |
44 | - } | |
45 | - | |
46 | - public static Line findById(Long id) { | |
47 | - return find.byId(id); | |
48 | - } | |
49 | - | |
50 | - public void accecptJSON(JsonNode json) { | |
51 | - // TODO 한 라인에 정보들을 저장하면 된다. | |
52 | - //존재하지 않는 카드는 더하고 없는 카드는 삭제한다. | |
53 | - title = json.get("title").asText(); | |
54 | - cards.clear(); | |
55 | - JsonNode cardsJson = json.get("cards"); | |
56 | - for(int i = 0; i < cardsJson.size(); i++) { | |
57 | - JsonNode cardJson = cardsJson.get(i); | |
58 | - Long cardId = cardJson.get("_id").asLong(); | |
59 | - Card card = Card.findById(cardId); | |
60 | - if(card == null){ | |
61 | - card = new Card(); | |
62 | - } | |
63 | - cards.add(card); | |
64 | - card.line = this; | |
65 | - card.accecptJSON(cardJson); | |
66 | - card.save(); | |
67 | - } | |
68 | - save();//왜 save가 안되는거야? | |
69 | - //아마 지워진걸 delete를 해줘야 할듯... 안하면 안되는듯... | |
70 | - } | |
71 | - | |
72 | - public void addCard(Card card) { | |
73 | - // TODO MAKETEST | |
74 | - cards.add(card); | |
75 | - save(); | |
76 | - } | |
77 | -} |
--- app/models/task/TaskBoard.java
... | ... | @@ -1,123 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import java.util.ArrayList; | |
4 | -import java.util.List; | |
5 | - | |
6 | -import javax.persistence.*; | |
7 | - | |
8 | -import models.Project; | |
9 | -import models.ProjectUser; | |
10 | - | |
11 | -import org.codehaus.jackson.JsonNode; | |
12 | -import org.codehaus.jackson.node.ArrayNode; | |
13 | -import org.codehaus.jackson.node.ObjectNode; | |
14 | - | |
15 | -import play.db.ebean.Model; | |
16 | -import play.libs.Json; | |
17 | - | |
18 | -@Entity | |
19 | -public class TaskBoard extends Model { | |
20 | - private static final long serialVersionUID = 1L; | |
21 | - | |
22 | - @Id | |
23 | - public Long id; | |
24 | - | |
25 | - @OneToMany(mappedBy = "taskBoard", cascade = CascadeType.ALL) | |
26 | - public List<Line> lines; | |
27 | - @OneToMany(mappedBy = "taskBoard", cascade = CascadeType.ALL) | |
28 | - public List<Label> labels; | |
29 | - | |
30 | - @OneToOne | |
31 | - public Project project; | |
32 | - | |
33 | - private static Finder<Long, TaskBoard> find = new Finder<Long, TaskBoard>( | |
34 | - Long.class, TaskBoard.class); | |
35 | - | |
36 | - public static TaskBoard create(Project project) { | |
37 | - TaskBoard taskBoard = new TaskBoard(); | |
38 | - // create default line | |
39 | - taskBoard.lines = new ArrayList<Line>(); | |
40 | - taskBoard.lines.add(createLine("Box")); | |
41 | - taskBoard.lines.add(createLine("Todo")); | |
42 | - taskBoard.lines.add(createLine("Doing")); | |
43 | - taskBoard.lines.add(createLine("Test")); | |
44 | - taskBoard.lines.add(createLine("Done")); | |
45 | - | |
46 | - // create default Label | |
47 | - taskBoard.labels = new ArrayList<Label>(); | |
48 | - for (int i = 0; i < 10; i++) { | |
49 | - Label label = new Label(); | |
50 | - | |
51 | - taskBoard.labels.add(label); | |
52 | - } | |
53 | - | |
54 | - taskBoard.project = project; | |
55 | - | |
56 | - taskBoard.save(); | |
57 | - | |
58 | - return taskBoard; | |
59 | - } | |
60 | - | |
61 | - private static Line createLine(String title) { | |
62 | - Line line = new Line(); | |
63 | - line.title = title; | |
64 | - line.save(); | |
65 | - return line; | |
66 | - } | |
67 | - | |
68 | - public static TaskBoard findByProject(Project project) { | |
69 | - return find.where().eq("project.id", project.id).findUnique(); | |
70 | - } | |
71 | - | |
72 | - public void accecptJSON(JsonNode json) { | |
73 | - // 이미 있는 목록을 지워버리고 온거로만 채운다. 지워지면 난 몰라! | |
74 | - // TODO delete를 고려할것. | |
75 | - lines.clear(); | |
76 | - | |
77 | - for (int i = 0; i < json.size(); i++) { | |
78 | - JsonNode lineJson = json.get(i); | |
79 | - Long lineId = lineJson.get("_id").asLong(); | |
80 | - Line line = Line.findById(lineId); | |
81 | - if (line == null) { | |
82 | - line = new Line(); | |
83 | - } | |
84 | - lines.add(line); | |
85 | - line.taskBoard = this; | |
86 | - line.accecptJSON(lineJson); | |
87 | - line.save(); | |
88 | - } | |
89 | - save(); | |
90 | - } | |
91 | - | |
92 | - @Transient | |
93 | - public JsonNode toJSON() { | |
94 | - // 라인중에서 넣을 것만 넣고 나머지는 다 위임한다. | |
95 | - ArrayNode json = Json.newObject().arrayNode(); | |
96 | - | |
97 | - for (Line line : lines) { | |
98 | - json.add(line.toJSON()); | |
99 | - } | |
100 | - return json; | |
101 | - } | |
102 | - | |
103 | - @Transient | |
104 | - public JsonNode getLabel() { | |
105 | - ArrayNode json = Json.newObject().arrayNode(); | |
106 | - for (Label label : labels) { | |
107 | - json.add(label.toJSON()); | |
108 | - } | |
109 | - return json; | |
110 | - } | |
111 | - | |
112 | - @Transient | |
113 | - public JsonNode getMember() { | |
114 | - ArrayNode json = Json.newObject().arrayNode(); | |
115 | - for (ProjectUser member : ProjectUser.findMemberListByProject(project.id)) { | |
116 | - ObjectNode tmp = Json.newObject(); | |
117 | - tmp.put("loginId", member.user.loginId); | |
118 | - tmp.put("_id", member.id); | |
119 | - json.add(tmp); | |
120 | - } | |
121 | - return json; | |
122 | - } | |
123 | -} |
--- app/models/task/TaskComment.java
... | ... | @@ -1,40 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import javax.persistence.Entity; | |
4 | -import javax.persistence.Id; | |
5 | -import javax.persistence.ManyToOne; | |
6 | - | |
7 | -import models.ProjectUser; | |
8 | - | |
9 | -import org.codehaus.jackson.JsonNode; | |
10 | -import org.codehaus.jackson.node.ObjectNode; | |
11 | - | |
12 | -import play.db.ebean.Model; | |
13 | -import play.libs.Json; | |
14 | - | |
15 | -@Entity | |
16 | -public class TaskComment extends Model { | |
17 | - private static final long serialVersionUID = 1L; | |
18 | - | |
19 | - @Id | |
20 | - public Long id; | |
21 | - public String body; | |
22 | - public ProjectUser author; | |
23 | - | |
24 | - @ManyToOne | |
25 | - public Card card; | |
26 | - | |
27 | - private static Finder<Long, TaskComment> find = new Finder<Long, TaskComment>(Long.class, TaskComment.class); | |
28 | - | |
29 | - public static TaskComment findById(Long id) { | |
30 | - return find.byId(id); | |
31 | - } | |
32 | - | |
33 | - public JsonNode toJSON() { | |
34 | - // TODO 테스트 추가 해야 함. | |
35 | - ObjectNode json = Json.newObject(); | |
36 | - json.put("_id", id); | |
37 | - json.put("body", body); | |
38 | - return json; | |
39 | - } | |
40 | -} |
--- app/views/index.scala.html
+++ app/views/index.scala.html
... | ... | @@ -8,7 +8,6 @@ |
8 | 8 |
<span>Open Source</span> Project. |
9 | 9 |
<span>Code</span> Repository. |
10 | 10 |
<span>Issue</span> Tracker. |
11 |
- <span>Task</span> Management |
|
12 | 11 |
</p> |
13 | 12 |
</div> |
14 | 13 |
<div class="fn-intro-wrap"> |
... | ... | @@ -32,13 +31,6 @@ |
32 | 31 |
팀이 함께 고민하고 |
33 | 32 |
처리해야 하는 내용들을 적고 |
34 | 33 |
거친 파도를 합심해 헤쳐나가듯 해결해 나갑니다. |
35 |
- </li> |
|
36 |
- <li class="tasks"> |
|
37 |
- <strong>태스크 관리</strong> |
|
38 |
- |
|
39 |
- 문서와 자료도 |
|
40 |
- 팀에서 개발하는 소프트웨어 만큼이나 |
|
41 |
- 함께 만들고 함께 성장해 갑니다 |
|
42 | 34 |
</li> |
43 | 35 |
</ul> |
44 | 36 |
|
--- app/views/task/cardView.scala.html
... | ... | @@ -1,75 +0,0 @@ |
1 | -@(project:Project) | |
2 | - | |
3 | -<!-- 실제로 이것들은 미리 로딩되어 있음 --> | |
4 | -<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
5 | -<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script> | |
6 | -<script type="text/javascript" src="http://underscorejs.org/underscore.js"></script> | |
7 | -<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script> | |
8 | -<script type="text/javascript" src="https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.min.js"></script> | |
9 | -<!-- preloading section end --> | |
10 | -<style> | |
11 | -input.card_title { | |
12 | - border: 0px; | |
13 | -} | |
14 | - | |
15 | -ul { | |
16 | - list-style: none; | |
17 | - padding: 0px; | |
18 | -} | |
19 | -</style> | |
20 | -<div ng-controller="CardCtrl"> | |
21 | - <section class="card"> | |
22 | - <!-- | |
23 | - //클릭하지 않았을때는 그냥 잘 보여주다 클릭하면 input으로 바꾸기. | |
24 | - // (아마 onclick에서 바꾸고 onBlur에서 다시 원상 복귀하면 될듯.)--> | |
25 | - <input type="text" ng-model="card.title" class="card_title" /> <input ng-model="card.storyPoint" | |
26 | - ui-event="{'blur':'saveCard()'}" type="number" min="0" max="500" /><br /> | |
27 | - <textarea ng-model="card.body"></textarea> | |
28 | - <button ng-click="saveCard()">save</button> | |
29 | - <div> | |
30 | - <fieldset> | |
31 | - <legend>assignee</legend> | |
32 | - <div ng-repeat="member in card.assignee"> | |
33 | - <span>{{member.loginId}}</span> | |
34 | - </div> | |
35 | - <button ng-click="showMemberList()">assign</button> | |
36 | - <div ng-show="input.assign" ng-repeat="member in board.members"> | |
37 | - <span><input type="checkbox" ng-model="member.assigned" ng-change="assign(member)" />{{member.loginId}}</span> | |
38 | - </div> | |
39 | - </fieldset> | |
40 | - </div> | |
41 | - <div ng-repeat="label in board.labels"> | |
42 | - <span><input type="checkbox" ng-model="label.state" ng-change="saveCard()" />{{label.name}}</span> | |
43 | - <!-- 색깔라벨 나오게 만들것! --> | |
44 | - </div> | |
45 | - <div> | |
46 | - DueDate : <input type="date" ng-model="card.dueDate" ui-event="{'blur':'saveCard()'}" /> | |
47 | - </div> | |
48 | - <button ng-hide="card.checklist" ng-click="makeCheckList()">makeCheckList</button> | |
49 | - <fieldset ng-show="card.checklist"> | |
50 | - <legend>{{card.checklist.title}}</legend> | |
51 | - <ul ng-repeat="item in card.checklist.items"> | |
52 | - <li><input type="checkbox" ng-model="item.state" ng-click="checkItem(item)" /> {{item.body}}</li> | |
53 | - </ul> | |
54 | - <input type="text" ng-model="input.checklist" /> | |
55 | - <button ng-click="addChecklist()">add</button> | |
56 | - </fieldset> | |
57 | - </section> | |
58 | - <section id="taskComments" ng-repeat="comment in card.comments"> | |
59 | - <article>{{comment.body}}</article> | |
60 | - </section> | |
61 | - <div> | |
62 | - <form ng-submit="addComment()"> | |
63 | - <textarea id="comment_input" ng-model="input.comment"></textarea> | |
64 | - <input type="submit" value="comment" /> | |
65 | - </form> | |
66 | - </div> | |
67 | -</div> | |
68 | -<script src="/assets/javascripts/CardView.js"></script> | |
69 | -<script> | |
70 | -$(document).ready(function(){ | |
71 | - initCardView("/@project.owner/@project.name/task/"); | |
72 | - cardLoad(1);// for TEST | |
73 | -}) | |
74 | -</script> | |
75 | - |
--- app/views/task/taskView.scala.html
... | ... | @@ -1,188 +0,0 @@ |
1 | -@(project:Project) | |
2 | -@import utils.TemplateHelper._ | |
3 | -@main("TaskManager", project, utils.MenuType.TASK){ | |
4 | -<div class="page"> | |
5 | -<style> | |
6 | - @@IMPORT url(@getCSSLink("taskboard")); | |
7 | -</style> | |
8 | -<h1>TaskManager</h1> | |
9 | -<div ng-controller="controller"> | |
10 | - <section ng-repeat="line in lines" class="line"> | |
11 | - <header>{{line.title}}</header> | |
12 | - <div class="cardlist" id="cardlist_{{line._id}}"> | |
13 | - <article class="blank"></article> | |
14 | - <div ng-repeat="card in line.cards"> | |
15 | - <article class="card" draggable="true" ui-event="{'dragstart': 'onDragStart(line, card)'}"> | |
16 | - {{card.title}}</article> | |
17 | - <article class="blank"></article> | |
18 | - </div> | |
19 | - </div> | |
20 | - <article> | |
21 | - <button ng-hide="newCard && newCard.targetLine == line" ng-click="showCardInput(line)">new Card</button> | |
22 | - <form ng-submit="addCard(line)" ng-show="newCard && newCard.targetLine == line"> | |
23 | - <textarea ng-model="newCard.title"></textarea> | |
24 | - <input type="submit" value="add" /> | |
25 | - </form> | |
26 | - </article> | |
27 | - </section> | |
28 | - <section style="float: right"> | |
29 | - <fieldset> | |
30 | - <legend>label List</legend> | |
31 | - <article id="lables" ng-repeat="label in labels"> | |
32 | - <span>{{label.name}}</span> | |
33 | - </article> | |
34 | - </fieldset> | |
35 | - <fieldset> | |
36 | - <legend>memberList</legend> | |
37 | - <aritcle ng-repeat="member in members"> <span>{{member.loginId}}</span> </aritcle> | |
38 | - </fieldset> | |
39 | - </section> | |
40 | -</div> | |
41 | -<script> | |
42 | - $(function() { | |
43 | - var myapp = angular.module('myapp', [ 'ui' ]); | |
44 | - var TaskCtrl = function($scope) { | |
45 | - var dragStart = {}; | |
46 | - var webSocket = new WebSocket("ws://" + location.host + location.pathname | |
47 | - + "/connect"); | |
48 | - webSocket.onmessage = function(e) { | |
49 | - $scope.lines = JSON.parse(e.data); | |
50 | - $scope.$apply(); | |
51 | - } | |
52 | - webSocket.onopen = function() { | |
53 | - console.log("socket Open!"); | |
54 | - } | |
55 | - webSocket.onclose = function() { | |
56 | - console.log("disconnected!"); | |
57 | - console.log("trying to reconnect..."); | |
58 | - console.log("unimplement"); | |
59 | - } | |
60 | - $scope.showCardInput = function(line) { | |
61 | - $scope.newCard = { | |
62 | - targetLine : line | |
63 | - }; | |
64 | - }; | |
65 | - $scope.addCard = function(line) { | |
66 | - $.ajax("task/newCard", { | |
67 | - success : function(data) { | |
68 | - $scope.newCard.title = ""; | |
69 | - line.cards.push(data); | |
70 | - $scope.$apply(); | |
71 | - }, | |
72 | - contentType : "text/json", | |
73 | - dataType : "json", | |
74 | - data : JSON.stringify({ | |
75 | - line_id : line._id, | |
76 | - card_data : $scope.newCard.title | |
77 | - }), | |
78 | - type : "POST" | |
79 | - }); | |
80 | - return false; | |
81 | - } | |
82 | - | |
83 | - $.ajax("task/labels", { | |
84 | - success : function(data) { | |
85 | - $scope.labels = data; | |
86 | - }, | |
87 | - dataType : "json" | |
88 | - }); | |
89 | - | |
90 | - $.ajax("task/member", { | |
91 | - success : function(data) { | |
92 | - $scope.members = data; | |
93 | - } | |
94 | - }); | |
95 | - //init end | |
96 | - $scope.onDragOver = function($event) { | |
97 | - $event.preventDefault(); | |
98 | - }; | |
99 | - $scope.onDragleave = function($event) { | |
100 | - $event.preventDefault(); | |
101 | - }; | |
102 | - $scope.onDrop = function($event, targetLine) { | |
103 | - if (dragStart === null) | |
104 | - return; | |
105 | - if (targetLine._id !== dragStart.line._id) { | |
106 | - if (dragStart !== null) { | |
107 | - targetLine.cards.push(dragStart.card); | |
108 | - dragStart.line.cards = _.without(dragStart.line.cards, | |
109 | - dragStart.card); | |
110 | - } | |
111 | - } | |
112 | - webSocket.send(JSON.stringify($scope.lines)); | |
113 | - }; | |
114 | - $scope.onDragStart = function(currentLine, currentCard) { | |
115 | - dragStart = { | |
116 | - line : currentLine, | |
117 | - card : currentCard, | |
118 | - idx : _.indexOf(currentLine.cards, currentCard) | |
119 | - }; | |
120 | - }; | |
121 | - | |
122 | - $scope.onDragOverBlank = function($event) { | |
123 | - $event.preventDefault(); | |
124 | - }; | |
125 | - $scope.onDragleaveBlank = function($event) { | |
126 | - $event.preventDefault(); | |
127 | - }; | |
128 | - $scope.onDropBlank = function($event, targetLine, targetCard) { | |
129 | - if (dragStart === null) | |
130 | - return; | |
131 | - var prvIdx = null; | |
132 | - if (targetLine._id == dragStart.line._id) { | |
133 | - targetLine.cards.splice(dragStart.idx, 1); | |
134 | - } else { | |
135 | - dragStart.line.cards = _ | |
136 | - .without(dragStart.line.cards, dragStart.card); | |
137 | - } | |
138 | - targetLine.cards.splice(_.indexOf(targetLine.cards, targetCard) + 1, 0, | |
139 | - dragStart.card); | |
140 | - dragStart = null; | |
141 | - webSocket.send(JSON.stringify($scope.lines)); | |
142 | - }; | |
143 | - }; | |
144 | - myapp.controller('controller', TaskCtrl); | |
145 | - angular.bootstrap(document, [ 'myapp' ]); | |
146 | - }); | |
147 | - (function() { | |
148 | - $(".cardlist").live("drop", function(e) { | |
149 | - if (e.stopPropagation) | |
150 | - e.stopPropagation(); | |
151 | - e.preventDefault(); | |
152 | - }); | |
153 | - | |
154 | - $(".cardlist").live("dragover", function(e) { | |
155 | - $(this).addClass("over"); | |
156 | - return e.preventDefault(); | |
157 | - }).live("drop dragleave", function(e) { | |
158 | - $(this).removeClass("over"); | |
159 | - }); | |
160 | - $(".card").live("dragstart", function(e) { | |
161 | - }); | |
162 | - | |
163 | - $(".blank").live("dragover", function(e) { | |
164 | - $(this).addClass("overBlank"); | |
165 | - return e.preventDefault(); | |
166 | - }).live("drop dragleave", function(e) { | |
167 | - $(this).removeClass("overBlank"); | |
168 | - }); | |
169 | - $(".cardlist") | |
170 | - .attr( | |
171 | - "ui-event", | |
172 | - "{dragover: 'onDragOver($event)', dragleave: 'onDragLeave($event)', drop: 'onDrop($event, line)'}"); | |
173 | - $(".blank") | |
174 | - .attr( | |
175 | - "ui-event", | |
176 | - "{dragover: 'onDragOverBlank($event)', dragleave: 'onDragLeaveBlank($event)', drop: 'onDropBlank($event, line, card)'}"); | |
177 | - })(); | |
178 | - | |
179 | - //=============================== | |
180 | - var URL_PREFIX = "/@project.owner/@project.name/task/"; | |
181 | -</script> | |
182 | -<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
183 | -<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script> | |
184 | -<script type="text/javascript" src="http://underscorejs.org/underscore.js"></script> | |
185 | -<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script> | |
186 | -<script type="text/javascript" src="https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.min.js"></script> | |
187 | -</div> | |
188 | -} |
--- conf/initial-data.yml
+++ conf/initial-data.yml
... | ... | @@ -384,93 +384,3 @@ |
384 | 384 |
id: 2 |
385 | 385 |
role: !!models.Role |
386 | 386 |
id: 1 |
387 |
- |
|
388 |
-#Task |
|
389 |
-taskBoards: |
|
390 |
- - !!models.task.TaskBoard |
|
391 |
- project: !!models.Project |
|
392 |
- id: 1 |
|
393 |
-lines: |
|
394 |
- - !!models.task.Line |
|
395 |
- title: Box |
|
396 |
- taskBoard: !!models.task.TaskBoard |
|
397 |
- id: 1 |
|
398 |
- |
|
399 |
- - !!models.task.Line |
|
400 |
- title: TODO |
|
401 |
- taskBoard: !!models.task.TaskBoard |
|
402 |
- id: 1 |
|
403 |
- - !!models.task.Line |
|
404 |
- title: Doing |
|
405 |
- taskBoard: !!models.task.TaskBoard |
|
406 |
- id: 1 |
|
407 |
- - !!models.task.Line |
|
408 |
- title: Test |
|
409 |
- taskBoard: !!models.task.TaskBoard |
|
410 |
- id: 1 |
|
411 |
- - !!models.task.Line |
|
412 |
- title: Done |
|
413 |
- taskBoard: !!models.task.TaskBoard |
|
414 |
- id: 1 |
|
415 |
- |
|
416 |
-cards: |
|
417 |
- - !!models.task.Card |
|
418 |
- title: test title |
|
419 |
- body: test card |
|
420 |
- storyPoint: 5 |
|
421 |
- checklist: !!models.task.Checklist |
|
422 |
- title: TODO |
|
423 |
- line: !!models.task.Line |
|
424 |
- id: 1 |
|
425 |
- |
|
426 |
- - !!models.task.Card |
|
427 |
- title: alpha |
|
428 |
- body: alpha |
|
429 |
- line: !!models.task.Line |
|
430 |
- id: 1 |
|
431 |
- - !!models.task.Card |
|
432 |
- title: Beta |
|
433 |
- body: beta |
|
434 |
- line: !!models.task.Line |
|
435 |
- id: 1 |
|
436 |
- |
|
437 |
- - !!models.task.TaskComment |
|
438 |
- body: test comment |
|
439 |
- author: !!models.ProjectUser |
|
440 |
- id: 1 |
|
441 |
- card: !!models.task.Card |
|
442 |
- id: 1 |
|
443 |
- - !!models.task.TaskComment |
|
444 |
- body: test comment2 |
|
445 |
- author: !!models.ProjectUser |
|
446 |
- id: 1 |
|
447 |
- card: !!models.task.Card |
|
448 |
- id: 1 |
|
449 |
- |
|
450 |
- - !!models.task.CardAssignee |
|
451 |
- card: !!models.task.Card |
|
452 |
- id: 1 |
|
453 |
- projectUser: !!models.ProjectUser |
|
454 |
- id: 4 |
|
455 |
- |
|
456 |
-labels: |
|
457 |
- - !!models.task.Label |
|
458 |
- name: HELP |
|
459 |
- taskBoard: !!models.task.TaskBoard |
|
460 |
- id: 1 |
|
461 |
- - !!models.task.Label |
|
462 |
- name: ISSUE |
|
463 |
- taskBoard: !!models.task.TaskBoard |
|
464 |
- id: 1 |
|
465 |
- |
|
466 |
-checkLists: |
|
467 |
- |
|
468 |
- - !!models.task.Item |
|
469 |
- body: test item |
|
470 |
- checklist : !!models.task.Checklist |
|
471 |
- id: 1 |
|
472 |
- |
|
473 |
- - !!models.task.Item |
|
474 |
- body: test item2 |
|
475 |
- checklist : !!models.task.Checklist |
|
476 |
- id: 1 |
--- conf/routes
+++ conf/routes
... | ... | @@ -130,17 +130,6 @@ |
130 | 130 |
# Search |
131 | 131 |
GET /:user/:project/search controllers.SearchApp.contentsSearch(user, project, page: Int ?= 0) |
132 | 132 |
|
133 |
-#task |
|
134 |
-GET /:user/:project/task controllers.TaskApp.index(user, project) |
|
135 |
-GET /:user/:project/task/labels controllers.TaskApp.getLabels(user, project) |
|
136 |
-GET /:user/:project/task/member controllers.TaskApp.getMember(user, project) |
|
137 |
-GET /:user/:project/task/connect controllers.TaskApp.connect(user, project) |
|
138 |
-GET /:user/:project/task/card/:cardId controllers.TaskApp.card(user, project, cardId:Long) |
|
139 |
-GET /:user/:project/task/card controllers.TaskApp.cardView(user, project) |
|
140 |
-POST /:user/:project/task/newCard controllers.TaskApp.newCard(user, project) |
|
141 |
-POST /:user/:project/task/card controllers.TaskApp.saveCard(user, project) |
|
142 |
-POST /:user/:project/task/comment controllers.TaskApp.addComment(user, project) |
|
143 |
- |
|
144 | 133 |
# Help |
145 | 134 |
GET /help controllers.HelpApp.help() |
146 | 135 |
|
--- public/javascripts/service/hive.Task.CardView.js
... | ... | @@ -1,141 +0,0 @@ |
1 | -var cardLoad; | |
2 | -(function() { | |
3 | - //angular! | |
4 | - var URL_PREFIX = ""; | |
5 | - var cardapp = angular.module('cardApp', [ 'ui' ]); | |
6 | - function CardCtrl($scope) { | |
7 | - $scope.card; //model | |
8 | - $scope.board = {}; | |
9 | - $scope.input = { | |
10 | - comment : "" | |
11 | - }; | |
12 | - cardLoad = function(id) { | |
13 | - $.ajax(URL_PREFIX + "c/" + id, { | |
14 | - dataType : "json", | |
15 | - success : function(data) { | |
16 | - $scope.card = data; | |
17 | - $scope.$apply(); | |
18 | - adjust(); | |
19 | - } | |
20 | - }); | |
21 | - } | |
22 | - $.ajax(URL_PREFIX + "member", { | |
23 | - success : function(data) { | |
24 | - $scope.board.members = data; | |
25 | - adjust(); | |
26 | - } | |
27 | - }); | |
28 | - $.ajax(URL_PREFIX + "labels", { | |
29 | - success : function(data) { | |
30 | - $scope.board.labels = data; | |
31 | - adjust(); | |
32 | - }, | |
33 | - dataType : "json" | |
34 | - }); | |
35 | - function adjust() { | |
36 | - if ($scope.card && $scope.board && $scope.board.members) { | |
37 | - var assignee = $scope.card.assignee; | |
38 | - var members = $scope.board.members; | |
39 | - for ( var i = 0; i < members.length; i++) { | |
40 | - members[i].assigned = false; | |
41 | - for ( var j = 0; j < assignee.length; j++) { | |
42 | - if (members[i]._id == assignee[j]._id) { | |
43 | - members[i].assigned = true; | |
44 | - assignee[j] = members[i]; | |
45 | - } | |
46 | - } | |
47 | - } | |
48 | - $scope.$apply(); | |
49 | - } | |
50 | - if ($scope.card && $scope.board && $scope.board.labels) { | |
51 | - var cardLabels = $scope.card.labels; | |
52 | - var boardLabels = $scope.board.labels; | |
53 | - for ( var i = 0; i < boardLabels.length; i++) { | |
54 | - boardLabels[i].state = false; | |
55 | - for ( var j = 0; j < cardLabels.length; j++) { | |
56 | - if (cardLabels[j]._id == boardLabels[i]._id) { | |
57 | - boardLabels[i].state = true; | |
58 | - } | |
59 | - } | |
60 | - } | |
61 | - } | |
62 | - $scope.$apply() | |
63 | - } | |
64 | - //inti function end | |
65 | - $scope.addComment = function() { | |
66 | - $scope.card.comments.push($scope.input.comment); | |
67 | - server.addComment($scope.card._id, $scope.input.comment); | |
68 | - $scope.input.comment = ""; | |
69 | - | |
70 | - } | |
71 | - $scope.saveCard = function() { | |
72 | - $scope.card.labels = []; | |
73 | - for ( var i = 0; i < $scope.board.labels.length; i++) { | |
74 | - if ($scope.board.labels[i].state == true) { | |
75 | - $scope.card.labels.push($scope.board.labels[i]); | |
76 | - } | |
77 | - } | |
78 | - server.saveCard($scope.card); | |
79 | - console.log($scope.card); | |
80 | - } | |
81 | - $scope.showMemberList = function() { | |
82 | - $scope.input.assign = !$scope.input.assign; | |
83 | - } | |
84 | - $scope.makeCheckList = function() { | |
85 | - $scope.card.checklist = { | |
86 | - items : [], | |
87 | - title : "TODO" | |
88 | - }; | |
89 | - } | |
90 | - $scope.addChecklist = function() { | |
91 | - $scope.card.checklist.items.push({ | |
92 | - body : $scope.input.checklist, | |
93 | - state : false | |
94 | - }); | |
95 | - $scope.input.checklist = ""; | |
96 | - $scope.saveCard(); | |
97 | - } | |
98 | - $scope.checkItem = function(item) { | |
99 | - $scope.saveCard(); | |
100 | - } | |
101 | - $scope.assign = function(member) { | |
102 | - if (member.assigned) { | |
103 | - $scope.card.assignee.push(member); | |
104 | - } else { | |
105 | - $scope.card.assignee = _.without($scope.card.assignee, member); | |
106 | - } | |
107 | - $scope.saveCard(); | |
108 | - } | |
109 | - } | |
110 | - | |
111 | - window.initCardView = function(url){ | |
112 | - URL_PREFIX = url; | |
113 | - cardapp.controller('CardCtrl', CardCtrl);//여기는 실제함수와 어트리뷰트간의 관계맺기 | |
114 | - angular.bootstrap(document, [ 'cardApp' ]); | |
115 | - } | |
116 | - var server = {}; | |
117 | - server.addComment = function(_id, str) { | |
118 | - $.ajax(URL_PREFIX + "comment", { | |
119 | - type : "POST", | |
120 | - data : { | |
121 | - body : str, | |
122 | - _id : _id | |
123 | - }, | |
124 | - success : function(data) { | |
125 | - cardLoad(_id); | |
126 | - } | |
127 | - }); | |
128 | - }; | |
129 | - server.saveCard = function(card, callback) { | |
130 | - //서버로 카드 전체를 보내서 저장합니다. | |
131 | - $.ajax(URL_PREFIX + "card", { | |
132 | - type : "post", | |
133 | - data : JSON.stringify(card), | |
134 | - contentType : "text/json", | |
135 | - success : function(data) { | |
136 | - if (callback) | |
137 | - callback(); | |
138 | - } | |
139 | - }); | |
140 | - } | |
141 | -})(); |
--- public/stylesheets/taskboard.css
... | ... | @@ -1,52 +0,0 @@ |
1 | -section.line { | |
2 | - width: 150px; | |
3 | - float: left; | |
4 | - border: 2px solid #666666; | |
5 | - background: #fafafa; | |
6 | - margin-right: 5px; | |
7 | - border-radius: 5px; | |
8 | - text-align: center; | |
9 | - cursor: move; | |
10 | -} | |
11 | - | |
12 | -section.line header { | |
13 | - padding: 5px; | |
14 | - background-color: #dadada; | |
15 | - border-top-left-radius: 5px; | |
16 | - border-top-right-radius: 5px; | |
17 | -} | |
18 | - | |
19 | -article.card { | |
20 | - background: #b9a; | |
21 | - margin: 4px; | |
22 | - border-radius: 3px; | |
23 | - border: 1px solid gray; | |
24 | - min-height: 20px; | |
25 | -} | |
26 | - | |
27 | -.cardlist { | |
28 | - border: 2px solid #f1f1f1; | |
29 | - background: #f1f1f1; | |
30 | -} | |
31 | - | |
32 | -.over { | |
33 | - border: 2px dashed #000; | |
34 | -} | |
35 | - | |
36 | -.dragTargetCard { | |
37 | - background-color: dadada; | |
38 | - color: dadada; | |
39 | -} | |
40 | - | |
41 | -.blank { | |
42 | - min-height: 3px; | |
43 | -} | |
44 | - | |
45 | -.overBlank { | |
46 | - min-height: 25px; | |
47 | - background-color: #ddd; | |
48 | -} | |
49 | - | |
50 | -.fade { | |
51 | - background: #333; | |
52 | -}(No newline at end of file) |
--- test/models/task/CardTest.java
... | ... | @@ -1,66 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import static org.fest.assertions.Assertions.assertThat; | |
4 | -import models.ModelTest; | |
5 | -import models.ProjectUser; | |
6 | - | |
7 | -import org.codehaus.jackson.JsonNode; | |
8 | -import org.junit.Test; | |
9 | - | |
10 | -public class CardTest extends ModelTest<Card> { | |
11 | - | |
12 | - @Test | |
13 | - public void findById() { | |
14 | - // Given | |
15 | - // When | |
16 | - Card card = Card.findById(1l); | |
17 | - // Then | |
18 | - assertThat(card).isNotNull(); | |
19 | - assertThat(card.body).isEqualTo("test card"); | |
20 | - } | |
21 | - | |
22 | - @Test | |
23 | - public void addComment() throws Exception { | |
24 | - // Given | |
25 | - Card card = Card.findById(1l); | |
26 | - TaskComment comment = new TaskComment(); | |
27 | - comment.body = "aaa"; | |
28 | - // When | |
29 | - card.addComment(comment); | |
30 | - // Then | |
31 | - assertThat(card.comments).contains(comment); | |
32 | - assertThat(comment.id).isNotNull(); | |
33 | - } | |
34 | - | |
35 | - @Test | |
36 | - public void removeComment() throws Exception { | |
37 | - // Given | |
38 | - Card card = Card.findById(1l); | |
39 | - // When | |
40 | - card.removeComment(TaskComment.findById(1l)); | |
41 | - // Then | |
42 | - assertThat(card.comments).excludes(TaskComment.findById(1l)); | |
43 | - } | |
44 | - | |
45 | - /* | |
46 | - * @Test public void addCheckList() throws Exception { // Given Card card = | |
47 | - * Card.findById(1l); CheckList checklist = new CheckList(); // When | |
48 | - * card.addCheckList(checklist); // Then | |
49 | - * assertThat(card.checkList).isNotNull(); | |
50 | - * assertThat(card.checkList).isEqualTo(checklist); | |
51 | - * assertThat(checklist.id).isNotNull(); } | |
52 | - */ | |
53 | - | |
54 | - @Test | |
55 | - public void toJSON() throws Exception { | |
56 | - // Given | |
57 | - Card card = Card.findById(1l); | |
58 | - // When | |
59 | - JsonNode json = card.toJSON(); | |
60 | - // Then | |
61 | - assertThat(json.get("title").asText()).isEqualTo("test title"); | |
62 | - assertThat(json.get("body").asText()).isEqualTo("test card"); | |
63 | - assertThat(json.get("comments").size()).isEqualTo(2); | |
64 | - assertThat(json.get("checklist")).isNotNull(); | |
65 | - } | |
66 | -} |
--- test/models/task/CheckListTest.java
... | ... | @@ -1,44 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import static org.fest.assertions.Assertions.assertThat; | |
4 | - | |
5 | -import org.codehaus.jackson.JsonNode; | |
6 | -import org.junit.Test; | |
7 | - | |
8 | -import models.ModelTest; | |
9 | - | |
10 | -public class CheckListTest extends ModelTest<Checklist> { | |
11 | - @Test | |
12 | - public void addItem() throws Exception { | |
13 | - // Given | |
14 | - Checklist checklist = Checklist.findById(1l); | |
15 | - Item item = new Item(); | |
16 | - // When | |
17 | - checklist.addItem(item); | |
18 | - // Then | |
19 | - assertThat(checklist.items).isNotEmpty(); | |
20 | - assertThat(checklist.items).contains(item); | |
21 | - } | |
22 | - | |
23 | - @Test | |
24 | - public void removeItem() throws Exception { | |
25 | - // Given | |
26 | - Checklist checklist = Checklist.findById(1l); | |
27 | - Item item = Item.findById(1l); | |
28 | - // When | |
29 | - checklist.removeItem(item); | |
30 | - // Then | |
31 | - assertThat(checklist.items).excludes(item); | |
32 | - } | |
33 | - | |
34 | - @Test | |
35 | - public void toJSON() throws Exception { | |
36 | - //Given | |
37 | - Checklist checklist = Checklist.findById(1l); | |
38 | - //When | |
39 | - JsonNode json = checklist.toJSON(); | |
40 | - //Then | |
41 | - assertThat(json.get("title").asText()).isEqualTo("TODO"); | |
42 | - assertThat(json.get("items").size()).isEqualTo(2); | |
43 | - } | |
44 | -} |
--- test/models/task/LineTest.java
... | ... | @@ -1,28 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import static org.fest.assertions.Assertions.assertThat; | |
4 | -import static play.test.Helpers.fakeApplication; | |
5 | -import static play.test.Helpers.running; | |
6 | - | |
7 | -import org.codehaus.jackson.JsonNode; | |
8 | -import org.junit.Ignore; | |
9 | -import org.junit.Test; | |
10 | - | |
11 | -public class LineTest { | |
12 | - | |
13 | - @Test | |
14 | - public void toJson() throws Exception { | |
15 | - running(fakeApplication(), new Runnable() { | |
16 | - @Override | |
17 | - public void run() { | |
18 | - // Given | |
19 | - Line line = Line.findById(1l); | |
20 | - // When | |
21 | - JsonNode json = line.toJSON(); | |
22 | - // Then | |
23 | - assertThat(json.findValue("title").asText()).isEqualTo("Box"); | |
24 | - assertThat(json.findValue("cards").size()).isEqualTo(3); | |
25 | - } | |
26 | - }); | |
27 | - } | |
28 | -} |
--- test/models/task/TaskBoardTest.java
... | ... | @@ -1,114 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import static org.fest.assertions.Assertions.assertThat; | |
4 | -import static play.test.Helpers.fakeApplication; | |
5 | -import static play.test.Helpers.running; | |
6 | -import models.Project; | |
7 | - | |
8 | -import org.codehaus.jackson.JsonNode; | |
9 | -import org.junit.Ignore; | |
10 | -import org.junit.Test; | |
11 | - | |
12 | -import play.libs.Json; | |
13 | -import controllers.ProjectApp; | |
14 | - | |
15 | -@Ignore | |
16 | -public class TaskBoardTest { | |
17 | - | |
18 | - @Test | |
19 | - public void create() throws Exception { | |
20 | - running(fakeApplication(), new Runnable() { | |
21 | - @Override | |
22 | - public void run() { | |
23 | - // Given | |
24 | - Project project = ProjectApp.getProject("hobi", "nForge4java"); | |
25 | - // When | |
26 | - TaskBoard taskboard = TaskBoard.create(project); | |
27 | - // Then | |
28 | - assertThat(taskboard.id).isNotNull(); | |
29 | - assertThat(taskboard.lines.size()).isEqualTo(5); | |
30 | - assertThat(taskboard.labels.size()).isEqualTo(10); | |
31 | - assertThat(taskboard.project).isEqualTo(project); | |
32 | - } | |
33 | - }); | |
34 | - } | |
35 | - | |
36 | - @Test | |
37 | - public void findByProject() throws Exception { | |
38 | - running(fakeApplication(), new Runnable() { | |
39 | - @Override | |
40 | - public void run() { | |
41 | - // Given | |
42 | - Project project = ProjectApp.getProject("hobi", "nForge4java"); | |
43 | - // When | |
44 | - TaskBoard taskboard = TaskBoard.findByProject(project); | |
45 | - System.out.println(taskboard.labels); | |
46 | - // Then | |
47 | - assertThat(taskboard).isNotNull(); | |
48 | - assertThat(taskboard.project).isEqualTo(project); | |
49 | - } | |
50 | - }); | |
51 | - } | |
52 | - | |
53 | - @Test | |
54 | - public void accecptJSON() throws Exception { | |
55 | - // Given | |
56 | - Project project = ProjectApp.getProject("hobi", "nForge4java"); | |
57 | - JsonNode data = Json | |
58 | - .parse("[{'_id':'1','title':'BOX','cards':[{'_id':'2','title':'bbb','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00G'},{'_id':'3','title':'ccc','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00I'}],'$$hashKey':'004'},{'_id':'2','title':'TODO','cards':[{'_id':'4','title':'alpha','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00K'},{'_id':'6','title':'chaile','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00O'},{'_id':'1','title':'aaa','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00E'},{'_id':'7','title':'delta','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00Q'}],'$$hashKey':'006'},{'_id':'3','title':'Doing','cards':[{'_id':'5','title':'bravo','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00M'}],'$$hashKey':'008'},{'_id':'4','title':'Test','cards':[{'_id':'8','title':'check','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00S'},{'_id':'9','title':'test','body':[],'comment':[],'assignee':[],'labels':[],'checkList':{},'dueDate':{},'storyPoint':-1,'$$hashKey':'00U'}],'$$hashKey':'00A'},{'_id':'5','title':'Done','cards':[],'$$hashKey':'00C'}]"); | |
59 | - // When | |
60 | - TaskBoard taskBoard = TaskBoard.findByProject(project); | |
61 | - taskBoard.accecptJSON(data); | |
62 | - // Then | |
63 | - assertThat(taskBoard.lines.size()).isEqualTo(5); | |
64 | - | |
65 | - } | |
66 | - | |
67 | - @Test | |
68 | - public void toJSON() throws Exception { | |
69 | - running(fakeApplication(), new Runnable() { | |
70 | - @Override | |
71 | - public void run() { | |
72 | - // Given | |
73 | - Project project = ProjectApp.getProject("hobi", "nForge4java"); | |
74 | - TaskBoard taskBoard = TaskBoard.findByProject(project); | |
75 | - // When | |
76 | - JsonNode json = taskBoard.toJSON(); | |
77 | - // Then | |
78 | - assertThat(json.size()).isEqualTo(5); | |
79 | - } | |
80 | - }); | |
81 | - } | |
82 | - | |
83 | - @Test | |
84 | - public void getLabel() throws Exception { | |
85 | - running(fakeApplication(), new Runnable() { | |
86 | - @Override | |
87 | - public void run() { | |
88 | - // Given | |
89 | - Project project = ProjectApp.getProject("hobi", "nForge4java"); | |
90 | - TaskBoard taskBoard = TaskBoard.findByProject(project); | |
91 | - // When | |
92 | - JsonNode json = taskBoard.getLabel(); | |
93 | - // Then | |
94 | - assertThat(json.size()).isEqualTo(2); | |
95 | - } | |
96 | - }); | |
97 | - } | |
98 | - | |
99 | - @Test | |
100 | - public void getMember() throws Exception { | |
101 | - running(fakeApplication(), new Runnable() { | |
102 | - @Override | |
103 | - public void run() { | |
104 | - // Given | |
105 | - Project project = ProjectApp.getProject("hobi", "nForge4java"); | |
106 | - TaskBoard taskBoard = TaskBoard.findByProject(project); | |
107 | - // When | |
108 | - JsonNode json = taskBoard.getMember(); | |
109 | - // Then | |
110 | - assertThat(json.size()).isEqualTo(2); | |
111 | - } | |
112 | - }); | |
113 | - } | |
114 | -}(No newline at end of file) |
--- test/models/task/TaskCommentTest.java
... | ... | @@ -1,32 +0,0 @@ |
1 | -package models.task; | |
2 | - | |
3 | -import static org.fest.assertions.Assertions.assertThat; | |
4 | -import static play.test.Helpers.fakeApplication; | |
5 | -import static play.test.Helpers.running; | |
6 | - | |
7 | -import models.ModelTest; | |
8 | - | |
9 | -import org.codehaus.jackson.JsonNode; | |
10 | -import org.junit.Test; | |
11 | - | |
12 | -public class TaskCommentTest extends ModelTest<TaskComment>{ | |
13 | - @Test | |
14 | - public void findById() throws Exception { | |
15 | - //Given | |
16 | - //When | |
17 | - TaskComment comment = TaskComment.findById(1l); | |
18 | - //Then | |
19 | - assertThat(comment).isNotNull(); | |
20 | - assertThat(comment.body).isEqualTo("test comment"); | |
21 | - } | |
22 | - @Test | |
23 | - public void toJSON() throws Exception { | |
24 | - //Given | |
25 | - TaskComment comment = TaskComment.findById(1l); | |
26 | - //When | |
27 | - JsonNode json = comment.toJSON(); | |
28 | - //Then | |
29 | - assertThat(json.get("body").asText()).isEqualTo("test comment"); | |
30 | - } | |
31 | - | |
32 | -} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?