Skip to content
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

Merged
merged 2 commits into from
Sep 19, 2023
Merged

Conversation

ghost
Copy link

@ghost ghost commented Sep 19, 2023

Ticket: https://openimis.atlassian.net/browse/ONI-106

Required PR: openimis/openimis-fe-location_js#74

Changes:

  • Added HF status information with contract end date
  • Days till the end of the contract are displayed as well

@ghost ghost requested a review from olewandowski1 September 19, 2023 00:37
@@ -53,6 +73,20 @@ const HomePageContainer = () => {
return null;
}

let dateToCheck = new Date(userHealthFacility.contractEndDate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change let to const.

let dateToCheck = new Date(userHealthFacility.contractEndDate);
const timeDelta = getTimeDifferenceInDaysFromToday(dateToCheck);
const getHealthFacilityStatus = (timeDelta) => {
if(timeDelta>180){
Copy link
Contributor

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.

if(timeDelta>180){
return classes.healthFacilityLongTimeActive;
}
else if(timeDelta>30){
Copy link
Contributor

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.

Copy link
Contributor

@olewandowski1 olewandowski1 left a 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.

@ghost ghost requested a review from olewandowski1 September 19, 2023 10:52
@sonarcloud
Copy link

sonarcloud bot commented Sep 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ghost ghost marked this pull request as ready for review September 19, 2023 10:58
@dborowiecki dborowiecki merged commit 4ab0db6 into develop Sep 19, 2023
3 checks passed
@dborowiecki dborowiecki deleted the feature/ONI-106 branch September 19, 2023 11:23
dragos-dobre added a commit that referenced this pull request Oct 18, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants