-
-
Notifications
You must be signed in to change notification settings - Fork 343
feat(#10240): hide target counts past goal #10772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
35e80e2
da8c6a3
13d2919
5b305d3
95e1d0f
e2ef816
8247ce0
123bb09
9c6aa21
b0347ca
fc76773
588de79
a0c6c04
470c115
e7a8831
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,7 +126,7 @@ | |
| "chai-shallow-deep-equal": "^1.4.6", | ||
| "chai-things": "^0.2.0", | ||
| "chokidar": "^4.0.3", | ||
| "cht-conf": "^6.0.2", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder that this needs to be changed before merging. |
||
| "cht-conf": "github:cliftonmcintosh/cht-conf#feat/10240-hide-target-counts-past-goal", | ||
| "cht-conf-test-harness": "^5.0.3", | ||
| "clean-css-cli": "^5.6.2", | ||
| "couchdb-compile": "^1.11.2", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| module.exports = [ | ||
| { | ||
| id: 'active-pregnancies', | ||
| translation_key: 'targets.anc.active_pregnancies.title', | ||
| type: 'count', | ||
| goal: 1, | ||
| limit_count_to_goal: true, | ||
| appliesTo: 'contacts', | ||
| appliesToType: ['person'], | ||
| date: 'now', | ||
| }, | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,9 @@ | |
| position: relative; | ||
| } | ||
| .count { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
|
Comment on lines
+72
to
+74
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Centering the goal seems cleaner than trying to pad it in an absolute position in the top right corner. See my question about this in the PR description. |
||
| text-align: center; | ||
| .number { | ||
| text-align: center; | ||
|
|
@@ -78,11 +81,7 @@ | |
| padding-bottom: 0; | ||
| } | ||
| .goal { | ||
| position: absolute; | ||
| right: 0; | ||
| padding-right: 20px; | ||
| color: @label-color; | ||
| top: 15px; | ||
| p { | ||
| font-size: @font-small; | ||
| font-weight: 400; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,4 +133,11 @@ export class AnalyticsTargetsComponent implements OnInit, OnDestroy { | |
| }); | ||
| }); | ||
| } | ||
|
|
||
| getDisplayCount(target: any): number { | ||
| if (target.limit_count_to_goal && target.goal >= 0 && target.value?.pass >= target.goal) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awww, negative goals are out? is the goal positive check necessary?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah I see, it's in case someone creates a target without a goal and then sets limit_count_to_goal to true?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes! |
||
| return target.goal; | ||
| } | ||
| return target.value?.pass; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file are because of the temporary change to the cht-conf dependency. They should be reverted when we update that dependency again.