-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
835 lines (727 loc) · 42.9 KB
/
index.html
File metadata and controls
835 lines (727 loc) · 42.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scrum</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="scrum.svg">
<style>
html { height:100%; }
body { min-height: 100%; display: flex; flex-direction: column; }
main { flex-grow: 1; background-color: #eee;}
html, body {
font-family: 'Inter', sans-serif;
}
.container {
max-width: 1160px;
}
.fw-black {
font-weight: 900;
}
.output > * {
font-family: Calibri, sans-serif!important;
font-size: 10pt !important;
background-color: transparent!important;
}
main, main > * {
transition: all ease-in-out 250ms;
}
.darkMode {
background-color: #121212;
color: #eee;
}
.btn-link {
color: black;
}
.alert-sm {
padding: 0.25rem 0.5rem;
font-size: 14px;
}
.darkMode input, .darkMode .modal-content, .darkMode input:focus, .darkMode textarea, .darkMode textarea:focus, .darkMode select, .darkMode .card {
background-color: #444;
color: #eee;
}
.darkMode .input-group-text {
background-color: #5e5e5e;
}
.darkMode h2, .darkMode .text-muted, .darkMode a, .darkMode .btn-link, .darkMode label, .darkMode .handle, .darkMode svg:not(.ignore-dark-mode) {
color: #eee!important;
}
.darkMode .darker {
color: #9d9d9d!important;
}
[v-cloak] {
display: none!important;
}
.cursor-pointer {
cursor: pointer;
}
.fs-small {
font-size: 14px;
}
.lh-0 {
line-height: 0;
}
.text-shadow {
text-shadow: 0 0 7px #000;
}
code {
background-color: #f520733d;
border: 1px solid #f52073;
}
.spinner {
animation: 1.5s ease-in-out infinite spinner;
}
@keyframes spinner {
from { transform: rotate(-10deg) scale(1); }
50% { transform: rotate(15deg) scale(1.1); }
to { transform: rotate(-10deg) scale(1); }
}
.colour-red { color: #fd6262; }
.colour-orange { color: #df9000; }
.btn-warning {
background-color: #df9000;
color: white;
}
.swal2-html-container {
text-align: left!important;
font-size: 16px!important;
}
.darkMode ~ .swal2-container .swal2-popup, .darkMode ~ .swal2-container .swal2-title, .darkMode ~ .swal2-container .swal2-html-container, .darkMode ~ .swal2-container .swal2-html-container * {
background: #2f2f2f!important;
background-color: #2f2f2f!important;
color: #eee!important;
}
.bg-darken {
background-color: #eee;
}
.darkMode .bg-darken {
background-color: #2f2f2f
}
.btn-primary, .btn-primary:focus, .btn-primary:active {
background-color: #1f97d5;
border: 0;
}
.form-check-input:checked, .form-check-input:checked:focus, .form-check-input:checked:active {
background-color: #1f97d5!important;
}
</style>
</head>
<body>
<noscript>
You are using an unsupported browser, please enable Javascript to use this application.
</noscript>
<main v-cloak id="app" class="h-100" :class="{ darkMode: !settings.lightMode }" >
<div class="border mb-3 output visually-hidden" ref="taskNotes" style="font-family: Calibri, sans-serif;font-size: 10pt;">
<strong>{{settings.name}}</strong><br />
<strong>{{todaysDate}}</strong>
<template v-for="task in tasksWithDetails">
<br /><br />
<strong>Task: {{task.name}} <template v-if="task.link">[<a :href="task.link" target="_blank">Task Link</a>]</template></strong><br />
<span v-if="(task.techStatus && task.techStatus.length) || task.status.length">
Status:
<span v-if="task.techStatus && task.techStatus.length"> [{{task.techStatus}}]</span>
<span v-if="task.status.length">{{task.status}}</span><br />
<span v-if="task.dueDate && task.dueDate.length">Due Date: {{task.dueDate}}<br /></span>
</span>
<span v-if="task.hours" class="text-capitalize">
Expected Hours Today: {{task.hours}}<br />
</span>
<span v-if="task.priority" class="text-capitalize">
Priority: {{task.priority}}<br />
</span>
<i>Blocked: {{(task.blocked) ? 'Yes' : 'No'}} <template v-if="task.blocked && task.blocked_reason">- Reason: {{task.blocked_reason}}</template></i>
</template>
<template v-if="blockedTasks.length || settings.capacity">
<br />
<template v-if="blockedTasks.length">
<br /><strong>Blocked on {{blockedTasks.length}} task<span v-if="blockedTasks.length > 1">s</span></strong>
</template>
<template v-if="settings.capacity">
<br /><u><strong>Capacity: <span style="text-transform:capitalize">{{settings.capacity}}</span></strong></u>
</template>
</template>
</div>
<div class="container position-relative">
<div class="position-absolute end-0 py-3 me-2">
<div v-if="settings.lightMode">
<svg @click="useLightMode(false)" class="text-dark cursor-pointer spinner" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="30px" viewBox="0 0 24 24" width="30px" fill="currentColor"><rect fill="none" height="24" width="24"/><path d="M11.01,3.05C6.51,3.54,3,7.36,3,12c0,4.97,4.03,9,9,9c4.63,0,8.45-3.5,8.95-8c0.09-0.79-0.78-1.42-1.54-0.95 c-0.84,0.54-1.84,0.85-2.91,0.85c-2.98,0-5.4-2.42-5.4-5.4c0-1.06,0.31-2.06,0.84-2.89C12.39,3.94,11.9,2.98,11.01,3.05z"/></svg>
</div>
<div v-if="!settings.lightMode">
<svg @click="useLightMode(true)" class="cursor-pointer ignore-dark-mode text-warning spinner" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="30px" viewBox="0 0 24 24" width="30px" fill="currentColor"><rect fill="none" height="24" width="24"/><path d="M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg>
</div>
</div>
<div class="py-5">
<div class="mb-5">
<div class="mb-3 d-flex align-items-center justify-content-start">
<svg class="ignore-dark-mode me-3" xmlns="http://www.w3.org/2000/svg" height="72" viewBox="0 0 24 24" width="72" fill="#1f97d5"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 14H6v-2h2v2zm0-3H6V9h2v2zm0-3H6V6h2v2zm6 6h-3c-.55 0-1-.45-1-1s.45-1 1-1h3c.55 0 1 .45 1 1s-.45 1-1 1zm3-3h-6c-.55 0-1-.45-1-1s.45-1 1-1h6c.55 0 1 .45 1 1s-.45 1-1 1zm0-3h-6c-.55 0-1-.45-1-1s.45-1 1-1h6c.55 0 1 .45 1 1s-.45 1-1 1z"/></svg>
<h1 class="fw-black">Scrum</h1>
</div>
</div>
<div class="mb-5">
<h2 class="text-muted fw-bold mb-3">Your Status</h2>
<div class="row">
<div class="col-md-6 mb-3 mb-sm-0">
<label for="personName" class="form-label">Your Name</label>
<input @change="sync" type="text" v-model="settings.name" class="form-control" id="personName" placeholder="Joe Bloggs">
</div>
<div class="col-md-6">
<label for="capcity" class="form-label">Your Capacity</label>
<select @change="sync" v-model="settings.capacity" class="form-select">
<option value="" selected disabled>Select Capacity</option>
<option value="light" selected="">Light (< 50% Capacity - > 3 hours available)</option>
<option value="medium">Medium (50-85% Capacity - 1-3 hours available)</option>
<option value="busy">Busy (85-95% Capacity - < 1 hours)</option>
<option value="full">Full (100% Capacity - No free capacity)</option>
<option value="overloaded">Overloaded (100% Capacity - Cannot meet current deadlines)</option>
</select>
</div>
</div>
</div>
<div>
<div class="mb-3 d-flex align-items-center justify-content-between flex-column flex-sm-row">
<h2 class="text-muted fw-bold mb-3 mb-sm-0">Your Tasks</h2>
<div>
<div class="btn-group mb-3 mb-sm-0" role="group" aria-label="Basic example">
<button class="btn btn-sm btn-secondary" disabled>
Sort
</button>
<button @click="sort('blocked')" class="btn btn-sm btn-secondary">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/></svg>
Blocked Status
</button>
<button @click="sort('priority')" class="btn btn-sm btn-secondary">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/></svg>
Priority
</button>
</div>
<button @click="create" class="btn btn-sm btn-success">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><g><rect fill="none" height="24" width="24"/></g><g><g/><g><path d="M17,19.22H5V7h7V5H5C3.9,5,3,5.9,3,7v12c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-7h-2V19.22z"/><path d="M19,2h-2v3h-3c0.01,0.01,0,2,0,2h3v2.99c0.01,0.01,2,0,2,0V7h3V5h-3V2z"/><rect height="2" width="8" x="7" y="9"/><polygon points="7,12 7,14 15,14 15,12 12,12"/><rect height="2" width="8" x="7" y="15"/></g></g></svg>
Add New Task
</button>
</div>
</div>
<div>
<div v-if="tasksWithDetails.length" class="mb-3">
<div class="alert alert-secondary d-flex align-items-center justify-content-between" role="alert">
<div>
You've got <strong>{{tasksWithDetails.length}} tasks</strong> recorded, you can now copy the notes to use in Microsoft Teams.<br />
<small v-if="taskTotalHours > 0">Estimating <strong>{{taskTotalHours}} hours</strong> of work, your recommended capacity today is <strong>{{taskEstimatedCapacity}}</strong>.</small>
</div>
<div>
<button @click="copy" class="btn btn-secondary">Copy Notes</button>
</div>
</div>
</div>
<div v-if="!tasks.length" class="border p-3">
You have no tasks, create a new one to get started.
</div>
<draggable v-if="tasks.length" v-model="tasks" handle=".handle" class="mb-3" animation="200">
<div v-for="(task, index) in tasks" :key="task.uid" class="card" :class="{ 'mb-3': settings.view === 'full' }">
<div v-if="task.isEditing" class="p-3">
<div>
<h2 class="text-muted fw-bold">Edit Task</h2>
</div>
<p class="text-muted small">Tasks need to have at least a name specified to be included in the scrum notes.</p>
<div>
<div class="mb-3">
<label for="taskName" class="form-label fw-bold">Task Name</label>
<input type="text" v-model="task.name" class="form-control" id="taskName" placeholder="Example Project">
</div>
<div class="mb-3">
<label for="taskLink" class="form-label fw-bold">Task Link</label>
<input type="text" v-model="task.link" class="form-control" id="taskLink" placeholder="https://eu1.clarizen.com/Clarizen/Task/.....">
</div>
<div class="mb-3">
<label for="taskStatus" class="form-label fw-bold">Task Status</label>
<textarea class="form-control" v-model="task.status" id="taskStatus" rows="2"></textarea>
</div>
<div class="row gx-3 align-items-start mb-3 justify-content-between">
<div class="col-6">
<label for="techStatus" class="form-label fw-bold">Tech Status</label>
<select id="techStatus" v-model="task.techStatus" class="form-select">
<option value="" selected disabled>Select Tech Status</option>
<option value="Client Meeting">Client Meeting</option>
<option value="Internal Meeting">Internal Meeting</option>
<option value="Awaiting Content">Awaiting Content</option>
<option value="Awaiting Brief">Awaiting Brief</option>
<option value="Ready to start">Ready to start</option>
<option value="Pre-Build Checks">Pre-Build Checks</option>
<option value="Blocked">Blocked</option>
<option value="On Hold">On Hold</option>
<option value="Queued">Queued</option>
<option value="At Risk">At Risk</option>
<option value="In Progress">In Progress</option>
<option value="Ready for QA">Ready for QA</option>
<option value="Post QA - development">Post QA - development</option>
<option value="With Client">With Client</option>
<option value="With Client Team">With Client Team</option>
<option value="Signed Off">Signed Off</option>
<option value="Complete">Complete</option>
</select>
</div>
<div class="col-6">
<div>
<label for="dueDate" class="form-label fw-bold">Task Due Date</label>
<input type="date" class="form-control" v-model="task.dueDate" id="dueDate" />
</div>
</div>
</div>
<div class="row gx-3 align-items-start mb-3 justify-content-between">
<div class="col-6">
<div>
<label for="priority" class="form-label fw-bold">Task Priority</label>
</div>
<div class="form-check form-check-inline">
<input v-model="task.priority" class="form-check-input" type="radio" name="priority" id="none" value="">
<label class="form-check-label" for="none">Not a Priority</label>
</div>
<div class="form-check form-check-inline">
<input v-model="task.priority" class="form-check-input" type="radio" name="priority" id="low" value="low">
<label class="form-check-label" for="low">Low</label>
</div>
<div class="form-check form-check-inline">
<input v-model="task.priority" class="form-check-input" type="radio" name="priority" id="medium" value="medium">
<label class="form-check-label" for="medium">Medium</label>
</div>
<div class="form-check form-check-inline">
<input v-model="task.priority" class="form-check-input" type="radio" name="priority" id="high" value="high">
<label class="form-check-label" for="high">High</label>
</div>
</div>
<div class="col-6">
<div>
<label for="hours" class="form-label fw-bold">Expected Hours Today</label>
<input type="number" class="form-control" v-model="task.hours" id="hours" />
</div>
</div>
</div>
<div>
<div>
<div class="mb-3">
<label for="taskBlocked" class="form-label fw-bold">Is this task blocked?</label>
<div class="form-check form-switch">
<input class="form-check-input" v-model="task.blocked" type="checkbox" role="switch" id="taskBlocked">
<label class="form-check-label" for="taskBlocked">
{{(task.blocked) ? 'Task is blocked' : 'Task is not blocked'}}
</label>
</div>
</div>
</div>
<div v-if="task.blocked">
<div class="mb-3">
<label for="blocked_reason" class="form-label fw-bold">Blocked Reason</label>
<input type="text" placeholder="Why is this task blocked?" class="form-control" v-model="task.blocked_reason" id="blocked_reason" />
</div>
</div>
</div>
<details id="taskBreakdown" class="mb-3" :open="task.breakdown && task.breakdown.length !== 0">
<summary>
<label for="taskBreakdown" class="form-label fw-bold">Task Breakdown</label>
<div class="fs-small" v-if="!task.breakdown || !task.breakdown.length">Break this task down into smaller, more managable subtasks to make it clearer where you need to go next - these do not get included in the daily notes.</div>
</summary>
<div class="mt-3">
<div>
<div v-for="(breakdown, index) in task.breakdown" class="input-group d-flex mb-2">
<div class="input-group-text flex-grow-1">
<input class="form-check-input mt-0 ms-1 me-3" type="checkbox" v-model="breakdown.done">
<input type="text" class="fs-small form-control" @change="sync" v-model="breakdown.note" :class="{ 'text-decoration-line-through': breakdown.done }">
</div>
<span class="input-group-text">
<svg @click="removeBreakdown(task, index)" class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1z"/></svg>
</span>
</div>
</div>
<button @click="addBreakdown(task)" type="button" class="btn btn-primary btn-sm">Add Breakdown</button>
</div>
</details>
</div>
<div>
<button @click="remove(task)" class="btn btn-danger btn-sm">Delete Task</button>
<button @click="close(task)" class="btn btn-success btn-sm">Save & Close Task</button>
</div>
</div>
<div v-if="!task.isEditing" class="d-flex justify-content-start align-items-stretch">
<div class="p-3 d-flex align-items-center handle cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 9H5c-.55 0-1 .45-1 1s.45 1 1 1h14c.55 0 1-.45 1-1s-.45-1-1-1zM5 15h14c.55 0 1-.45 1-1s-.45-1-1-1H5c-.55 0-1 .45-1 1s.45 1 1 1z"/></svg>
</div>
<div class="card-body d-flex align-items-center justify-content-between lh-sm">
<div class="w-100">
<div v-if="task.updatedDate && (new Date(task.updatedDate).setHours(0,0,0) < new Date(new Date().setHours(0,0,0)).setDate(new Date().getDate() - 2))" class="alert alert-warning alert-sm d-flex align-items-center justify-content-between w-100">
This task has not been updated for 2 days, is it up to date?
<button @click="task.updatedDate = Date.now()" class="btn btn-warning btn-sm">Dismiss</button>
</div>
<h6 class="mt-0 mb-0 fw-bold">{{task.name || "Set a Task Name"}}</h6>
<div v-if="task.status" class="fs-small mt-2 whitespace-pre-line">{{task.status}}</div>
<div v-if="task.breakdown && task.breakdown.length" class="fs-small mt-2">
<div v-for="breakdown in task.breakdown" >
<span v-if="breakdown.done">
<svg @click="markBreakdown(breakdown, false)" class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 0 24 24" width="18px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>
</span>
<span v-if="!breakdown.done">
<svg @click="markBreakdown(breakdown, true)" class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 0 24 24" width="18px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>
</span>
<span :class="{ 'text-decoration-line-through': breakdown.done }">{{breakdown.note}}</span>
</div>
</div>
<div v-if="settings.view === 'full'" class="darker mt-2 fs-small d-flex align-items-start flex-sm-row align-items-sm-center flex-column justify-content-start">
<span v-if="task.priority" content="Task Priority" v-tippy="{ arrow: true }">
<span v-if="task.priority === 'high'" class="me-4 colour-red">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><g><rect fill="none" height="24" width="24"/></g><g><g><polygon points="6,17.59 7.41,19 12,14.42 16.59,19 18,17.59 12,11.59"/><polygon points="6,11 7.41,12.41 12,7.83 16.59,12.41 18,11 12,5"/></g></g></svg>
High Priority
</span>
<span v-if="task.priority === 'medium'" class="me-4 colour-orange">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14l-6-6z"/></svg>
Medium Priority
</span>
<span v-if="task.priority === 'low'" class="me-4">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><g><rect fill="none" fill-rule="evenodd" height="24" width="24"/><g><rect fill-rule="evenodd" height="2" width="16" x="4" y="11"/></g></g></svg>
Low Priority
</span>
</span>
<span class="me-4" content="Tech Status" v-tippy="{ arrow: true }">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><g><rect fill="none" height="24" width="24" x="0"/></g><g><g><polygon points="7.41,13.41 6,12 2,16 6,20 7.41,18.59 5.83,17 21,17 21,15 5.83,15"/><polygon points="16.59,10.59 18,12 22,8 18,4 16.59,5.41 18.17,7 3,7 3,9 18.17,9"/></g></g></svg>
{{task.techStatus || "No Tech Status"}}
</span>
<span class="me-4" v-if="!task.blocked" content="Blocked Status" v-tippy="{ arrow: true }">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11H7v-2h10v2z"/></svg>
Not Blocked
</span>
<span class="me-4 colour-red" v-if="task.blocked" :content="'Blocked' + (task.blocked_reason ? ' with reason: '+ task.blocked_reason : '')" v-tippy="{ arrow: true }">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>
Blocked
</span>
<span class="me-4" v-if="task.dueDate" content="Due Date" v-tippy="{ arrow: true }">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><path d="M0 0h24v24H0z" fill="none"/><path d="M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>
{{new Date(task.dueDate).toLocaleDateString()}}
</span>
<span class="me-4" v-if="task.hours" content="Hours Expected Today" v-tippy="{ arrow: true }">
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor" class="ignore-dark-mode"><path d="M0 0h24v24H0z" fill="none"/><path d="M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/></svg>
{{task.hours}} hours
</span>
<span v-if="task.isHidden" content="Hidden from notes" v-tippy="{ arrow: true }">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>
Hidden
</span>
</div>
</div>
</div>
<div class="px-3 py-2 d-flex align-items-center bg-darken">
<div class="d-flex flex-column justify-content-center h-100 flex-grow-1">
<a v-if="task.link" content="Task Link" v-tippy="{ arrow: true }" :href="task.link" target="_blank" class="mb-1 btn-link lh-0">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>
</a>
<div @click="hide(task)" content="Set Task Note Visibility" v-tippy="{ arrow: true }" class="mb-1">
<span v-if="task.isHidden">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>
</span>
<span v-if="!task.isHidden">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
</span>
</div>
<div @click="edit(task)" content="Edit Task" v-tippy="{ arrow: true }" class="mb-1">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1c-.1.1-.15.22-.15.36zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
</div>
<div @click="remove(task)" content="Archive Task" v-tippy="{ arrow: true }">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 24 24" width="16px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1z"/></svg>
</div>
</div>
</div>
</div>
</div>
</draggable>
</div>
</div>
<div v-if="archivedTasks.length || settings.showArchivedTasks" class="mt-3">
<button @click="toggleArchivedTasks" class="btn btn-sm btn-secondary">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z"/></svg>
<span v-if="!settings.showArchivedTasks">View</span><span v-else>Hide</span> Archived Tasks
</button>
</div>
<div v-if="settings.showArchivedTasks">
<div class="mt-5 mb-3">
<h2 class="text-muted fw-bold mb-0">Your Archived Tasks</h2>
<p class="fs-small">You are able to restore tasks that were deleted within the past 7 days. Tasks are automatically removed when you visit on the 8th day.</p>
</div>
<div>
<div v-if="!archivedTasks.length" class="border p-3">
You have no archived tasks.
</div>
<div v-if="archivedTasks.length" class="mb-3">
<div v-for="(task, index) in archivedTasks" :key="task.uid" class="card" :class="{ 'mb-3': settings.view === 'full' }">
<div class="d-flex justify-content-start align-items-stretch">
<div class="p-3 d-flex align-items-center handle cursor-pointer">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 9H5c-.55 0-1 .45-1 1s.45 1 1 1h14c.55 0 1-.45 1-1s-.45-1-1-1zM5 15h14c.55 0 1-.45 1-1s-.45-1-1-1H5c-.55 0-1 .45-1 1s.45 1 1 1z"/></svg>
</div>
<div class="card-body d-flex align-items-center justify-content-between lh-sm">
<div>
<h6 class="mt-0 mb-0 fw-bold">{{task.name || "Set a Task Name"}}</h6>
<div v-if="task.status" class="fs-small mt-2 whitespace-pre-line">{{task.status}}</div>
</div>
</div>
<div class="flex-shrink-0 align-self-center me-3">
<div class="d-flex align-items-center flex-grow-1">
<div @click="restore(task)" class="cursor-pointer me-2" content="Restore" v-tippy="{ arrow: true }">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>
</div>
<div @click="remove(task, true)" class="">
<svg class="cursor-pointer" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1z"/></svg>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="my-5 text-center fs-small">
<p class="mb-2">Created with <span class="text-danger">♥</span> by Stuart - version {{appVersion}} - <a href="https://github.com/stuartajd/scrum" target="_blank">open source on GitHub</a></p>
<div class="d-flex align-items-center justify-content-center flex-column flex-sm-row">
<button @click="setView('minified')" v-if="settings.view === 'full'" class="btn btn-dark btn-sm me-2 mb-3 mb-sm-0">View mode: Full</button>
<button @click="setView('full')" v-if="settings.view === 'minified'" class="btn btn-dark btn-sm me-2 mb-3 mb-sm-0">View mode: Minified</button>
<button @click="clearAllTasks" class="btn btn-dark btn-sm me-2 mb-3 mb-sm-0">Clear Tasks</button>
<button @click="clearAll" class="btn btn-dark btn-sm me-2 mb-3 mb-sm-0">Reset Everything</button>
</div>
</div>
</div>
</div>
<a href="https://github.com/stuartajd/scrum">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg>
</a>
</main>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.20.0/vuedraggable.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-tippy/dist/vue-tippy.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
const APP_VERSION = "1.9";
var app = new Vue({
el: '#app',
components: {
draggable: window['vuedraggable'],
tippy: window['tippy'],
Swal: window['sweetalert2']
},
data: {
tasks: [],
archivedTasks: [],
todaysDate: null,
settings: {
name: '',
capacity: '',
lightMode: true,
view: 'full',
showArchivedTasks: false
},
appVersion: APP_VERSION
},
mounted: function(){
var version = this.fetchFromStorage("scrumVersion", "1.0");
if(APP_VERSION !== version){
Swal.fire({
title: 'Welcome to Scrum!',
html: '<strong>Version '+ APP_VERSION +' - Changelog</strong><br /><br /><ul>' +
'<li>Added in alert for tasks that have not been updated in the last 2 days to encourage the latest updates, clicking dismiss will reset this timer.</li>' +
'<li>Fixed an issue where blocked message would still appear in the notes when a task is no longer blocked - thanks <a href="https://github.com/stuartajd/scrum/issues/8" target="_blank">@GlennHS</a>.</li>' +
'</ul><p>Suggestion? Question? Problem? View the project on <a href="https://www.github.com/stuartajd/scrum" target="_blank">GitHub</a>',
confirmButtonText: "Close",
customClass: {
confirmButton: "btn btn-secondary"
},
allowOutsideClick: false,
buttonsStyling: false,
timer: 20000,
timerProgressBar: true,
});
}
var tasks = this.fetchFromStorage("scrumTasks", JSON.stringify([]));
this.tasks = JSON.parse(tasks);
var archivedTasks = this.fetchFromStorage("scrumArchivedTasks", JSON.stringify([]));
this.archivedTasks = JSON.parse(archivedTasks);
this.settings.lightMode = !(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
var settings = this.fetchFromStorage("scrumSettings", JSON.stringify({}));
this.settings = Object.assign(this.settings, JSON.parse(settings));
// Delete all from archived where the date is today.
var deleteBefore = new Date();
deleteBefore.setDate(deleteBefore.getDate() - 8);
this.archivedTasks = this.archivedTasks.filter(function(task){
return new Date(task.deletedDate) >= deleteBefore;
});
// Go through all tasks and apply latest updates.
this.tasks.forEach(function(task){
if(!task.updatedDate){
// 1.9 - Added in updatedDate to each task.
task.updatedDate = Date.now();
}
});
// Update the date on launch & then continue to update 30 minutes.
this.setTodaysDate();
this.sync();
},
watch: {
tasks: function(){
this.sync();
},
archivedTasks: function(){
this.sync();
}
},
computed: {
taskTotalHours: function(){
// Total time for all unblocked tasks
return this.tasks
.filter(function(task) { return !task.blocked; })
.reduce(function(acc, task) { return acc + parseFloat(task.hours || 0) }, 0);
},
taskEstimatedCapacity: function() {
if(this.taskTotalHours <= 3) return 'Light';
if(this.taskTotalHours <= 5) return 'Medium';
if(this.taskTotalHours < 7.5) return 'Busy';
if(this.taskTotalHours == 7.5) return 'Full';
return 'Overloaded';
},
tasksWithDetails: function(){
return this.tasks.filter(function(task) { return !task.isHidden && task.name.trim().length });
},
blockedTasks: function(){
return this.tasks.filter(function(task) { return task.blocked });
}
},
methods: {
toggleArchivedTasks: function() {
this.settings.showArchivedTasks = !this.settings.showArchivedTasks;
this.sync();
},
setTodaysDate: function(){
var date = new Date();
this.todaysDate = ('0' + date.getDate()).slice(-2) + '/'
+ ('0' + (date.getMonth()+1)).slice(-2) + '/'
+ date.getFullYear();
},
setView: function(viewMode) {
this.settings.view = viewMode;
this.sync();
},
fetchFromStorage: function(key, defaultValue){
var item = localStorage.getItem(key);
return item || defaultValue;
},
useLightMode: function(status){
this.settings.lightMode = status;
this.sync();
},
sort: function(sortField){
this.tasks = this.tasks.sort(function(a, b){
var sortFlags = {
priority: ['high', 'medium', 'low', ''],
blocked: [false, true]
}
if(typeof a[sortField] === "undefined") return 1;
if(typeof b[sortField] === "undefined") return -1;
return sortFlags[sortField].indexOf(a[sortField]) - sortFlags[sortField].indexOf(b[sortField]);
});
this.sync();
},
sync: function() {
localStorage.setItem('scrumTasks', JSON.stringify(this.tasks));
localStorage.setItem('scrumArchivedTasks', JSON.stringify(this.archivedTasks));
localStorage.setItem('scrumSettings', JSON.stringify(this.settings));
localStorage.setItem('scrumVersion', APP_VERSION);
},
copy: function() {
this.setTodaysDate();
this.$nextTick(function () {
var range = document.createRange();
range.selectNode(this.$refs.taskNotes);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
window.getSelection().removeAllRanges();
});
},
create: function() {
var task = {
uid: Date.now().toString(36) + Math.random().toString(36).substr(2),
name: '',
link: '',
status: '',
techStatus: '',
priority: '',
dueDate: '',
hours: 0,
createdDate: Date.now(),
updatedDate: Date.now(),
breakdown: [],
blocked: false,
blocked_reason: null,
isEditing: true,
isHidden: false
};
this.tasks.unshift(task);
this.edit(task);
},
edit: function(task){
this.$set(task, 'isEditing', true);
},
hide: function(task){
this.$set(task, 'isHidden', !task.isHidden);
this.$set(task, 'updatedDate', Date.now());
this.sync();
},
addBreakdown: function(task){
var breakdown = task.breakdown || [];
breakdown.push({ done: false, note: "" });
this.$set(task, 'breakdown', breakdown);
this.$set(task, 'updatedDate', Date.now());
this.sync();
},
removeBreakdown: function(task, index){
task.breakdown.splice(index, 1);
this.$set(task, 'updatedDate', Date.now());
this.sync();
},
markBreakdown: function(breakdown, status){
breakdown.done = status;
this.sync();
},
close: function(task){
this.$set(task, 'isEditing', false);
this.$set(task, 'updatedDate', Date.now());
this.sync();
},
remove: function(task, force){
if(!force){
task.deletedDate = Date.now();
this.$set(task, 'updatedDate', Date.now());
this.archivedTasks.push(task);
}
if(force){
this.archivedTasks = this.archivedTasks.filter(function(t) { return t.uid !== task.uid });
}
this.tasks = this.tasks.filter(function(t) { return t.uid !== task.uid });
},
restore: function(task){
this.tasks.push(task);
this.$set(task, 'updatedDate', Date.now());
this.archivedTasks = this.archivedTasks.filter(function(t) { return t.uid !== task.uid });
},
clearAllTasks: function(){
this.tasks = [];
this.archivedTasks = [];
this.sync();
},
clearAll: function(){
this.settings.name = "";
this.settings.capacity = "";
this.clearAllTasks();
}
}
})
</script>
</body>
</html>