-
Notifications
You must be signed in to change notification settings - Fork 7
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
🗺️ #2724 Remove Regions #2753
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ const PROGRAM_VALUES_QUERY = gql` | |
cancerTypes | ||
primarySites | ||
institutions | ||
regions | ||
countries | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,14 @@ export const asEnum = (obj, { name = 'enum' } = {}) => | |
|
||
const dateFormat = 'yyyy-MM-dd'; | ||
export const displayDate = (date: string | Date) => { | ||
const jsDate = typeof date === 'string' ? new Date(date) : date; | ||
// Dates stored as UTC need to be converted to milliseconds; breaks on localhost | ||
const jsDate = | ||
typeof date === 'string' | ||
? parseInt(date) | ||
? new Date(parseInt(date) * 1000) | ||
: new Date(date) | ||
: date; | ||
|
||
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. This seems unrelated to the removal of I don't quite understand why this change is needed. Is there a bug or ticket we're addressing with it? If keeping this functionality I think it's more clear as an 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. This came about as a result of testing the Manage Program page. 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 In fact many of the programs that work on locahost display an 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 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. Reverted in 4c3f167a188d39eff09b30a2dc1148876bad07d8 |
||
return formatDate(jsDate, dateFormat); | ||
}; | ||
|
||
|
@@ -84,7 +91,7 @@ export const exportToTsv = <Data extends { [k: string]: string | number }>( | |
include: includeKeys = allKeys, | ||
order = allKeys, | ||
fileName = 'data.tsv', | ||
headerDisplays = allKeys.reduce<typeof options['headerDisplays']>( | ||
headerDisplays = allKeys.reduce<(typeof options)['headerDisplays']>( | ||
(acc, key) => ({ | ||
...acc, | ||
[key]: options.headerDisplays ? options.headerDisplays[key] : key, | ||
|
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.
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
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.
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