-
Notifications
You must be signed in to change notification settings - Fork 2
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
ONI-106: User HF status information. #14
Conversation
src/components/HomePageContainer.js
Outdated
@@ -53,6 +73,20 @@ const HomePageContainer = () => { | |||
return null; | |||
} | |||
|
|||
let dateToCheck = new Date(userHealthFacility.contractEndDate); |
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.
Change let to const.
src/components/HomePageContainer.js
Outdated
let dateToCheck = new Date(userHealthFacility.contractEndDate); | ||
const timeDelta = getTimeDifferenceInDaysFromToday(dateToCheck); | ||
const getHealthFacilityStatus = (timeDelta) => { | ||
if(timeDelta>180){ |
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.
I will create a separate const for this '180' and '30'. Btw. it might be good idea to create overall const like:
const DAYS = { DAY: 1, WEEK: 7, MONTH: 30, YEAR: 360, };
If you won't create it like this, consider creating at least constants with more precise name.
src/components/HomePageContainer.js
Outdated
if(timeDelta>180){ | ||
return classes.healthFacilityLongTimeActive; | ||
} | ||
else if(timeDelta>30){ |
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.
Refer to the comment above.
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.
@wzglinieckisoldevelo I left some comments.
Kudos, SonarCloud Quality Gate passed!
|
* ONI-106: User HF status information. (#14) * ONI-106: User HF status information. * ONI-106: HF status code review fixes. * ONI-106: HF status fixed if no HF assigned. (#16) * ONI-168: make a notice message larger (#18) * ONI-168: make a notice message larger * ONI-168: if user has no hf, show info about that instead of contract details * add-sonar-ci: add ci file (#19) Co-authored-by: Jan <j.dolkowski@soldevelo.com> --------- Co-authored-by: wzglinieckisoldevelo <98958634+wzglinieckisoldevelo@users.noreply.github.com> Co-authored-by: olewandowski1 <109145288+olewandowski1@users.noreply.github.com> Co-authored-by: Jan <jdolkowski@soldevelo.com> Co-authored-by: Jan <j.dolkowski@soldevelo.com>
Ticket: https://openimis.atlassian.net/browse/ONI-106
Required PR: openimis/openimis-fe-location_js#74
Changes: