Skip to content

Commit bf99d54

Browse files
committed
Reset implemented button added
1 parent 26d47d1 commit bf99d54

3 files changed

Lines changed: 42 additions & 20 deletions

File tree

src/app/component/circular-heatmap/circular-heatmap.component.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ button{
2222
margin:5%;
2323
padding: 20px;
2424
}
25-
.buttonClass{
25+
.downloadButtonClass{
2626
position: absolute;
2727
padding: 10px;
28-
bottom: 12%;
28+
bottom: 5%;
2929
right: 5%;
30+
}
31+
.resetButtonClass{
32+
position: absolute;
33+
padding: 10px;
34+
bottom: 5%;
35+
right: 18%;
3036
}

src/app/component/circular-heatmap/circular-heatmap.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@
4242
</mat-card>
4343
<button
4444
mat-raised-button
45-
class="buttonClass"
45+
class="downloadButtonClass"
4646
(click)="SaveEditedYAMLfile()">
4747
Download edited YAML file
4848
</button>
49+
<button
50+
mat-raised-button
51+
class="resetButtonClass"
52+
(click)="ResetIsImplemented()">
53+
Reset Implemented
54+
</button>
4955
</div>
5056
</div>
5157
<div class="col-md-3"></div>

src/app/component/circular-heatmap/circular-heatmap.component.ts

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ export class CircularHeatmapComponent implements OnInit {
186186
.domain([0, 1])
187187
.range(['white', 'green']);
188188

189-
this.loadCircularHeatMap(
190-
this.ALL_CARD_DATA,
191-
'#chart',
192-
this.radial_labels,
193-
this.segment_labels
194-
);
195189
d3.selectAll(
196190
'#segment-' +
197191
this.ALL_CARD_DATA[index]['SubDimension'].replace(/ /g, '-') +
@@ -202,17 +196,6 @@ export class CircularHeatmapComponent implements OnInit {
202196
});
203197
}
204198

205-
SaveEditedYAMLfile() {
206-
console.log(this.YamlObject);
207-
let yamlStr = yaml.dump(this.YamlObject);
208-
let file = new Blob([yamlStr], { type: 'text/csv;charset=utf-8' });
209-
var link = document.createElement('a');
210-
link.href = window.URL.createObjectURL(file);
211-
link.download = 'generated.yaml';
212-
link.click();
213-
link.remove();
214-
}
215-
216199
loadCircularHeatMap(
217200
dataset: any,
218201
dom_element_to_append_to: string,
@@ -584,4 +567,31 @@ export class CircularHeatmapComponent implements OnInit {
584567
//console.log(this.ALL_CARD_DATA);
585568
this.router.navigate([this.Routing], navigationExtras);
586569
}
570+
SaveEditedYAMLfile() {
571+
//console.log(this.YamlObject);
572+
let yamlStr = yaml.dump(this.YamlObject);
573+
let file = new Blob([yamlStr], { type: 'text/csv;charset=utf-8' });
574+
var link = document.createElement('a');
575+
link.href = window.URL.createObjectURL(file);
576+
link.download = 'generated.yaml';
577+
link.click();
578+
link.remove();
579+
}
580+
581+
ResetIsImplemented() {
582+
for (var x = 0; x < this.ALL_CARD_DATA.length; x++) {
583+
if (this.ALL_CARD_DATA[x]['Done%'] > 0) {
584+
this.ALL_CARD_DATA[x]['Done%'] = 0;
585+
for (var y = 0; y < this.ALL_CARD_DATA[x]['Task'].length; y++) {
586+
this.ALL_CARD_DATA[x]['Task'][y]['ifTaskDone'] = false;
587+
}
588+
d3.selectAll(
589+
'#segment-' +
590+
this.ALL_CARD_DATA[x]['SubDimension'].replace(/ /g, '-') +
591+
'-' +
592+
this.ALL_CARD_DATA[x]['Level'].replace(' ', '-')
593+
).attr('fill', 'white');
594+
}
595+
}
596+
}
587597
}

0 commit comments

Comments
 (0)