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

🗺️ #2724 Remove Regions #2753

Merged
merged 4 commits into from
Feb 13, 2024
Merged

Conversation

demariadaniel
Copy link
Contributor

@demariadaniel demariadaniel commented Feb 9, 2024

Description of changes

Removes all references to Region field for programs

  • Create Program is not working yet, requires dataCenters added to Query
  • Update program showed a success message, but on 2nd login data was unchanged, so this likely requires Program Service updates

Adds handling for Date formatting which is breaking on localhost

Link to Issue

#2724

Link to Gateway PR:

icgc-argo/platform-api#716

Type of Change

  • Bug
  • Dependency updates
  • Feature
  • Refactoring
  • Release candidate
  • Styling
  • Testing
  • Other (please describe)

Checklist before requesting review

  • Design (select one):
    • Matches design:
      • component sizes, spacing, and styles
      • font size, weight, colour
      • spelling has been double checked
    • No design provided, screenshot of changes included in PR
    • No changes to UI
  • Back-end (select one):
    • Back-end PRs merged, tested on develop, and linked in this PR
    • No back-end changes
  • Manually tested changes
  • Added copyrights to new files
  • Connected ticket to PR

Copy link
Contributor

@ciaranschutte ciaranschutte left a comment

Choose a reason for hiding this comment

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

Unclear about the change to displayDate global util

? new Date(parseInt(date) * 1000)
: new Date(date)
: date;

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unrelated to the removal of regions code throughout. An isolated PR might be good?

I don't quite understand why this change is needed. Is there a bug or ticket we're addressing with it?
GraphQL DateTime seems to be in use for our data ref: https://the-guild.dev/graphql/scalars/docs/scalars/date-time
DateTime is a UTC string eg. 2007-12-03T10:15:30Z
passing this through parseInt is going to terminate at the dash so we'll end up with 2007 and then create a Date object with 200700 which is Wed Dec 31 1969 19:33:27 GMT-0500 (Eastern Standard Time) as a Date

If keeping this functionality I think it's more clear as an if/else. Nested ternary with multiple parseInt and Date constructors is confusing to read for a straightforward displayDate util func

Copy link
Contributor Author

@demariadaniel demariadaniel Feb 9, 2024

Choose a reason for hiding this comment

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

This came about as a result of testing the Manage Program page.
Could certainly be moved to it's own PR.

Testing local Platform UI against local Gateway, pointing at Clinical service Dev, programs ALEXIS-CA, DATA-CA and several others (not all) crash when you open the Manage Program page
The error is RangeError: Invalid time value and the values passed in as the date argument are numeric string values such as 1696946508681 or 1705346233163

In fact many of the programs that work on locahost display an invitationAccepted date value of 0 which doesn't seem right either. So there are data issues.

To complicate matters more this bug appears on localhost, but Dev seems to be working fine... so maybe it's just some implementation detail I'm not familiar with that's causing things.

Suffice to say, another ticket is a good idea, given the ambiguity

I used nested ternary b/c we're declaring a variable. Using var declaration with if/else would require let so it seemed like, half a dozen of one issue, six of the other.
If/else would definitely be easier to read if each block returns the expected value, hadn't considered that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@ciaranschutte ciaranschutte left a comment

Choose a reason for hiding this comment

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

looks good! just a note about generated gql. no changes needed necessarily

@@ -667,7 +667,7 @@ export type Mutation = {
createJiraTicketWithReCaptcha: TicketCreationResponse;
/**
* Create new program
* For lists (Cancer Type, Primary Site, Institution, Regions, Countries) the entire new value must be provided, not just values being added.
* For lists (Cancer Type, Primary Site, Institution, Countries) the entire new value must be provided, not just values being added.
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is generated gql from the api - I think the regions have been removed there already? If they haven't this will regenerate with region code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah sorry this was just find-and-replace carpet bombing, will be updated properly once API is updated

Separate API PR pending review: icgc-argo/platform-api#716

@demariadaniel demariadaniel merged commit 1b5220d into develop Feb 13, 2024
2 checks passed
@demariadaniel demariadaniel deleted the chore/2724-remove-regions branch February 13, 2024 16:02
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.

2 participants