Skip to content

Commit 6e75fe3

Browse files
committed
Settings: Progress definition: UI improvements
1 parent 4c9de9b commit 6e75fe3

10 files changed

Lines changed: 98 additions & 77 deletions

File tree

src/app/component/activity-description/activity-description.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ <h1>
1616
<b>UUID</b>
1717
</mat-panel-title>
1818
</mat-expansion-panel-header>
19-
<p id="uuid" [innerHTML]="currentActivity.uuid"></p>
19+
<p id="uuid">uuid: <span [innerHTML]="currentActivity.uuid"></span></p>
20+
<p id="level">Level: <span [innerHTML]="currentActivity.level"></span></p>
2021
</mat-expansion-panel>
2122

2223
<mat-expansion-panel *ngIf="currentActivity.description?.hasContent()">

src/app/model/progress-store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ProgressStore {
3232
// Sort the progress titles, from most completed, to not started
3333
this._progressDefinition = progressDefinition;
3434
this._progressTitles = Object.keys(progressDefinition).sort(
35-
(a, b) => progressDefinition[a].weight - progressDefinition[b].weight
35+
(a, b) => progressDefinition[a].score - progressDefinition[b].score
3636
);
3737
this._progressTitlesDescOrder = this._progressTitles.slice().reverse();
3838
}
@@ -255,7 +255,7 @@ export class ProgressStore {
255255

256256
for (const progressTitle of this._progressTitlesDescOrder || []) {
257257
if (teamProgress[progressTitle] !== undefined) {
258-
return this._progressDefinition[progressTitle].weight;
258+
return this._progressDefinition[progressTitle].score;
259259
}
260260
}
261261
return 0;

src/app/model/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface TeamProgressFile {
66
}
77

88
export interface ProgressDefinition {
9-
weight: number;
9+
score: number;
1010
definition: string;
1111
}
1212

src/app/pages/settings/settings.component.css

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,32 @@
22
margin-top: 1em;
33
}
44

5-
.progress-definition-row {
6-
display: grid;
7-
grid-template-columns: minmax(100px, 1fr) 100px minmax(200px, 2fr);
8-
gap: 1em;
9-
padding: 8px;
10-
border-bottom: 1px solid #eee;
11-
transition: background-color 0.2s;
12-
align-items: center;
13-
}
14-
155
.progress-definition-row:hover {
166
background-color: #f5f5f5;
177
}
188

19-
.progress-weight {
20-
text-align: center;
21-
}
22-
239
.progress-definitions-grid ::ng-deep .mat-form-field-wrapper {
2410
padding-bottom: 0;
2511
}
2612

2713
.date-format-container {
2814
display: flex;
2915
align-items: center;
30-
gap: 1em;
16+
gap: 0.2em;
3117
width: 25em;
3218
}
3319

34-
.mat-slider-horizontal {
35-
max-width: 100px;
36-
width: 100px;
37-
min-width: 80px;
38-
}
39-
4020
.progress-definitions-section {
4121
margin-top: 1em;
4222
}
4323

24+
25+
.progress-definitions-grid {
26+
display: grid;
27+
grid-template-columns: auto 5em minmax(200px, 2fr) auto;
28+
gap: 0.3em;
29+
}
30+
4431
.progress-definitions-grid ::ng-deep .mat-form-field-wrapper {
4532
padding-bottom: 0;
4633
}
@@ -49,17 +36,28 @@
4936
top: 0;
5037
}
5138

52-
.progress-definitions-grid .progress-key {
39+
.grid-cell.progress-key {
5340
font-weight: 500;
5441
}
5542

56-
.progress-definitions-grid .progress-weight input {
57-
color: #f66;
58-
text-align: center;
43+
.grid-cell.progress-score {
44+
text-align: right;
45+
padding-right: 0.5em;
5946
}
6047

61-
.progress-definitions-grid .progress-definition {
62-
color: #333;
48+
.grid-cell.action-buttons,
49+
.grid-cell.progress-definition {
50+
margin-bottom: 0.8em;
51+
}
52+
53+
54+
.grid-cell.progress-score span,
55+
.grid-cell.action-buttons {
56+
color: #aaa;
57+
}
58+
.grid-cell.action-buttons {
59+
align-self: center;
60+
justify-self: center;
6361
}
6462

6563
.selectable-list {
@@ -78,12 +76,6 @@
7876
flex: 1;
7977
}
8078

81-
.progress-definitions-grid {
82-
display: grid;
83-
grid-template-columns: auto 5em minmax(200px, 2fr) auto;
84-
gap: 1em;
85-
}
86-
8779
.edit-hint {
8880
color: #666;
8981
font-size: 0.9em;
@@ -94,9 +86,24 @@ mat-icon.mandatory-icon {
9486
padding: 8px;
9587
}
9688

89+
.help-text {
90+
font-size: 0.75em;
91+
color: #666;
92+
margin-top: 0.5em;
93+
}
94+
9795

9896
@media screen and (max-width: 650px) {
9997
.progress-definitions-grid {
100-
grid-template-columns: auto;
98+
grid-template-columns: auto 5em;
10199
}
100+
101+
.grid-cell.action-buttons,
102+
.grid-cell.progress-definition {
103+
margin-bottom: 1.8em;
104+
}
105+
106+
.edit-hint {
107+
display: none;
108+
}
102109
}

src/app/pages/settings/settings.component.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ <h2>Progress Definitions</h2>
7272
<ng-template #displayProgress>
7373
<ng-container *ngFor="let definition of definitionsFormArray.controls; let i = index">
7474
<div class="grid-cell progress-key">{{ getFormGroupValue(definition, 'key') }}</div>
75-
<div class="grid-cell progress-weight">
76-
{{ getFormGroupValue(definition, 'weight') }}%
75+
<div class="grid-cell progress-score">
76+
{{ getFormGroupValue(definition, 'score') }}%
7777
</div>
7878
<div class="grid-cell progress-definition">
7979
{{ getFormGroupValue(definition, 'definition') }}
@@ -83,22 +83,22 @@ <h2>Progress Definitions</h2>
8383
</ng-template>
8484
<ng-template #editProgress>
8585
<ng-container *ngFor="let definition of definitionsFormArray.controls; let i = index">
86-
<mat-form-field appearance="outline">
86+
<mat-form-field appearance="outline" class="grid-cell progress-key edit">
8787
<mat-label>Name</mat-label>
8888
<input matInput [value]="getFormGroupValue(definition, 'key')" />
8989
</mat-form-field>
9090

91-
<mat-form-field appearance="outline">
91+
<mat-form-field appearance="outline" class="grid-cell progress-score edit">
9292
<mat-label>Score</mat-label>
9393
<input
9494
matInput
95-
class="progress-weight"
96-
[value]="getFormGroupValue(definition, 'weight')"
95+
class="progress-score"
96+
[value]="getFormGroupValue(definition, 'score')"
9797
[disabled]="getFormGroupValue(definition, 'mandatory')" />
9898
<span matSuffix>%</span>
9999
</mat-form-field>
100100

101-
<mat-form-field appearance="outline">
101+
<mat-form-field appearance="outline" class="grid-cell progress-definition edit">
102102
<mat-label>Definition</mat-label>
103103
<textarea
104104
matInput
@@ -108,13 +108,15 @@ <h2>Progress Definitions</h2>
108108
[value]="getFormGroupValue(definition, 'definition')"></textarea>
109109
</mat-form-field>
110110

111-
<div>
111+
<div class="grid-cell action-buttons edit">
112112
<mat-icon
113+
title="You cannot remove this definition"
113114
*ngIf="definition.get('mandatory')?.value"
114115
class="material-icons-outlined mandatory-icon"
115116
>lock</mat-icon
116117
>
117118
<button
119+
title="Delete"
118120
*ngIf="!definition.get('mandatory')?.value"
119121
mat-icon-button
120122
(click)="removeProgressDefinition(i)"
@@ -125,9 +127,15 @@ <h2>Progress Definitions</h2>
125127
</ng-container>
126128
</ng-template>
127129
</div>
130+
<div class="help-text" *ngIf="editingProgressDefinitions">
131+
<p>
132+
Customize progression steps for the activites. Some prefer a timewise progression, such as
133+
<em>Planned-In progress-Implemented</em>. Some prefer a maturity wise progression, such as
134+
<em>Low maturity-Medium maturity-High maturity</em>.
135+
</p>
136+
<p>Make sure to add a good definition, so that everyone aligns.</p>
137+
<p>A progress stage of 0% and 100% is mandatory. The rest is up to you.</p>
138+
</div>
128139
</div>
129-
<span *ngIf="editingProgressDefinitions">
130-
Changes will be lost if you navigate away without accepting.
131-
</span>
132140
</mat-card>
133141
</div>

src/app/pages/settings/settings.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ export class SettingsComponent implements OnInit {
123123
this.definitionsFormArray.push(
124124
this.formBuilder.group({
125125
key: [key],
126-
weight: [progDef.weight * 100],
126+
score: [progDef.score * 100],
127127
definition: [progDef.definition],
128-
mandatory: progDef.weight == 1 || progDef.weight == 0,
128+
mandatory: progDef.score == 1 || progDef.score == 0,
129129
})
130130
);
131131
});
@@ -135,7 +135,7 @@ export class SettingsComponent implements OnInit {
135135
this.definitionsFormArray.push(
136136
this.formBuilder.group({
137137
key: [''],
138-
weight: [0],
138+
score: [0],
139139
definition: [''],
140140
})
141141
);

src/app/service/loader/data-loader.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class LoaderService {
150150

151151
for (let state of Object.keys(meta.progressDefinition)) {
152152
let progressDef = meta.progressDefinition[state];
153-
let value: string | number = progressDef.weight;
153+
let value: string | number = progressDef.score;
154154

155155
if (typeof value === 'string') {
156156
let isPercentage: boolean = (value as string).includes('%');
@@ -162,11 +162,11 @@ export class LoaderService {
162162
errors.push(`The progress value for '${state}' must be between 0% and 100%`);
163163
continue;
164164
}
165-
progressDef.weight = value;
165+
progressDef.score = value;
166166
}
167167
}
168168

169-
const values = Object.values(meta.progressDefinition).map(def => def.weight);
169+
const values = Object.values(meta.progressDefinition).map(def => def.score);
170170
if (Math.min(...values) !== 0) {
171171
errors.push(`The meta.progressDefinition must specify a name for 0% completed`);
172172
}

src/app/service/sector-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SectorService {
2929
this.allProgress = progress;
3030
this.progressValues = progressStates;
3131
this.progressStates = Object.keys(progressStates).sort(
32-
(a, b) => progressStates[b].weight - progressStates[a].weight
32+
(a, b) => progressStates[b].score - progressStates[a].score
3333
);
3434
}
3535

src/assets/Markdown Files/TODO-v4.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@
44
- UI: Toggle: edit / view
55
- UI: 0% and 100%: No delete, no edit Weight
66
- UI: Edit
7-
-
7+
88
- UI: Add
99
- UI: Delete
1010
- Save / Accept
1111
- Revert
1212

13+
- Settings: Proper text under Progress
14+
1315
## Next
16+
- Heatmap: Add #uuid to URL, and allow navigation on clicks in dependencies
17+
- Heatmap: Add a "pinching" of heat map colors, to differenciate 0.00 an 0.01
18+
- Matrix: Search (incl descr search), based on Mapping
19+
- Reorder menu
20+
21+
### Align DSOMM-data and DSOMM
22+
- DSOMM-data: Sort linear list of activities (sorted by dim, level)
23+
- DSOMM-data: Update generated filename and data structure to adhere to this new DSOMM standard
24+
- DSOMM-data: Include version number in generated yaml file
25+
- DSOMM: Read latest "activities.yaml" from DSOMM-data's github repo, if missing locally
26+
- DSOMM: Read latest "activities.yaml" from DSOMM-data's github repo, to check for any new releases
27+
1428

1529
## ToDo
1630
### Settings
@@ -22,17 +36,14 @@
2236
### Matrix
2337
- Matrix: Add a Close/Back button
2438
- Matrix: Remember filters when returning to matrix page
25-
- Matrix: Search (incl descr search), based on Mapping
2639
- Matrix: Filter on Usefulness, and Difficulties
2740
### Teams
2841
- Teams: Allow user to re-order teams and groups
2942
- Teams: Bug: Editing name, pushes the item last
3043
- Teams: Allow editing dates for progress stages
3144
### Heatmap:
32-
- Heatmap: Add #uuid to URL, and allow navigation on clicks in dependencies
3345
- Heatmap: Fix: asterisk marks when modified
3446
- ViewController needs to know about changes vs temp storage
35-
- Heatmap: Bug: Clicking on grey sector leaves cursor on that sector
3647
- Heatmap: Bug: Selecting a team group does not always get deselected when flipping teams
3748
- Heatmap: meta-yaml: If progress definition is missing, default to 0% + 100%
3849
- Heatmap: Revert to boolean checkboxes, if definition is only 0% and 100%
@@ -52,17 +63,10 @@
5263
- Move About Us, last, renaming to About DSOMM
5364
- Move all getMetaString into MetaStore()
5465
- Add fallbacks for getMetaString in MetaStore()
55-
- Fix dependsOn that is uuid (e.g. 83057028-0b77-4d2e-8135-40969768ae88)
5666
- Refactor: Labels for knowledge, time, resources, and usefulness (used by both Matrix and Heatmap)
5767
- Move META_FILE constant from data service to main app
5868
- Check if loader can be optimized by load in yaml in parallel
59-
- Proxy Grafana Faro data: https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/instrument/data-proxy/
6069

61-
## Align DSOMM-data and DSOMM
62-
- DSOMM-data: Sort linear list of activities (sorted by dim, level)
63-
- DSOMM-data: Update generated filename and data structure to adhere to this new DSOMM standard
64-
- DSOMM-data: Include version number in generated yaml file
65-
- DSOMM: Read latest "generated.yaml" from DSOMM-data's github repo, to check for any new releases
6670

6771
# Later
6872
- App: Search activities, across title description etc
@@ -81,6 +85,7 @@
8185
- Meta.yaml: Allow admins to customize the terms 'Team' and 'Group' (e.g. to 'App' and 'Portfolio')
8286

8387
# Done
88+
- Fix dependsOn that is uuid (e.g. 83057028-0b77-4d2e-8135-40969768ae88)
8489
- Settings: Make settings page for Date format and Max maturity level
8590
- Dependency: Make connecting nodes clickable for navigation
8691
- Dependency: Handle dependsOn uuid, not just name

0 commit comments

Comments
 (0)