Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

adding a event listener to capture messages posted by the app #1002

Conversation

pieterlukasse
Copy link
Contributor

@pieterlukasse pieterlukasse commented Jun 2, 2022

This generic solution allows for any future app to use postMessage to
keep user session alive.

See also uc-cdis/cloud-automation#1927, which uses this feature for Atlas app.

Jira Ticket: PXP-9641

New Features

  • New generic event listener to capture messages posted by the app

This generic solution allows for any future app to use postMessage to
keep user session alive
@pieterlukasse pieterlukasse requested a review from alilahrime June 2, 2022 20:11
src/Analysis/AnalysisApp.jsx Outdated Show resolved Hide resolved
src/Analysis/AnalysisApp.jsx Outdated Show resolved Hide resolved
@pieterlukasse pieterlukasse merged commit 9ae4845 into feat/gwas-ui-demo Jun 7, 2022
@pieterlukasse pieterlukasse deleted the solution_for_keeping_session_alive_in_iframed_apps branch June 7, 2022 19:46
UchicagoZchen138 pushed a commit that referenced this pull request Aug 3, 2022
* adding a event listener to capture messages posted by the app

This generic solution allows for any future app to use postMessage to
keep user session alive
m0nhawk pushed a commit that referenced this pull request Aug 3, 2022
* adding a event listener to capture messages posted by the app

This generic solution allows for any future app to use postMessage to
keep user session alive
alilahrime added a commit that referenced this pull request Aug 18, 2022
* feat(gwas-ui-demo): integrate middleware endpts, add status list and modal template

* add manifest object

* feat(gwas-ui-demo): move filter to prev step & change dispay of statuses

* feat(gwas-ui-demo): form submit conditions

* fix: naming of GWAS app

* fix: change correct naming

* feat(gwas-ui-demo): refactor workflow list & add prefixed id

* feat(gwas-ui-demo): refactor covar delete & edit btn layout

* feat(gwas-ui-demo): change source id hot fix

* feat(gwas-ui-demo): change step description & template

* feat(gwas-ui-demo): refactor queries for cohort definitions and concepts, add loading status

* feat(gwas-ui-demo): add loading fetch logic and submission and cancel for gwas workflows

* fix: update packages-lock.json

* feat(gwas-ui-demo): filter empty cohort defs & default page size

* feat(gwas-ui-demo): redirect to wts login if no creds

* feat(gwas-ui-demo): fetch sources after wts & fix covariate removal

* feat(gwas-ui-demo): comment cohort concept filter

* feat(gwas-ui-demo): resolve eslint errors

* fix(stylelint): remove !important

* feat(gwas-ui-demo): remove comment, cancel status

* feat(gwas-ui-demo): remove comments and unneeded declarations

* feat(gwas-ui-demo): update gwas template version

* feat(gwas-ui-demo): add conservative querying config

* feat(gwas-ui-demo): delete old gwas app

* feat(gwas-ui-demo): linter changes

* feat(gwas-ui-demo): refetch workflow status list every minute

* feat(gwas-ui-demo): fix interval

* feat(gwas-ui-demo): uninstall react-is

* feat(gwas-ui-demo): add job status refetch interval

* feat(gwas-ui-demo): run eslint

* feat(dev): add atlas icram content security to dev html

* feat(PXP-9868): change gwas description, add spinners

* feat(gwas-ui-demo): add quantitative vs case control selection

* feat(PXP-9943): add hare dropdown to quant gwas

* patch extra exception handling part

missing part from PR  #994

* feat(gwas-ui-demo): add gwas type descriptions

* feat(gwas-ui-demo): add reset btn for gwas type

* feat(gwas-ui-demo): add first 4 steps for case control

* feat(gwas-ui-demo): add separate hare dropdowns, update req bodies

* adding extra stats review step to case-control flow (#999)

* feat(gwas-ui-demo): add details and notification to quant final step, refactor hare fetches in case/control

* feat(gwas-ui-demo): remove isBinary from forms

* feat(gwas-ui-demo): add info button placeholders

* feat(gwas-ui-demo): make review header smaller

* fix(gwas-ui-demo): fix covariate delete in case control

* feat(gwas-ui-demo): add job name to quant req

* filtering concepts to allow only continuous ones to be selected (#1000)

* fix(gwas-ui-demo): feedback step changes, add cohort button, remove delete

* feat(gwas-ui-demo): add info button text to most of quant

* adding a event listener to capture messages posted by the app (#1002)

* adding a event listener to capture messages posted by the app

This generic solution allows for any future app to use postMessage to
keep user session alive

* adjust HARE concept id (#1004)

* Fix/case control hare (#1005)

* fix(casecontrol): hare concept ID and boolean function

* fix(requests): add queryConfig to stop spurious requests from being triggered

* adjust concept type filter to reflect new type (#1006)

* feat add workflow name (#1008)

* adding overlap check (#1009)

* Chore/update text workflow steps (#1010)

* change text/styling in pipeline wizard

* update text and style for GWASUIApp

Co-authored-by: Craig Barnes <craigrbarnes@uchicago.edu>

* using new cohort-middleware endpoint for fetching covariates by concept type (#1011)

* Fix/gwas submission params (#1013)

* chore(template): update template name

* fix(hare): pass hare population parameter

* fix(casecontrol): lots of bug fixing for submission (#1014)

* Fix/gwas state issues (#1015)

* fix(reset): reset more state vars

* fix(nextButton): add next button disabled logic for case-control

* fix(quant-ui): persist current table page after selection, start filter functionality

* separating value from description in hare dropdown & merging case-control dropdowns  (#1018)

* separating value from description in hare dropdown

* change to ensure dropdown description is updated when the data is refreshed

* merge case and control HARE dropdowns into a single selection

...showing the cohort sizes in the dropdown. Also aligned both wizards to use similar code, e.g. calling a
function for the description

* fix dropdown width issue

...and better naming

* fix(PXP-10058): widen jobs submitted on pipeline selection page

* Add HARE concept id in submit & make HARE selection mandatory (#1022)

* add HARE concept id to submit workflow call

* making HARE selection mandatory for 1st wizard

* making HARE selection mandatory for 2nd wizard

* fix(gwas-ui): remove extra workflow lists, add cohort btn reposition

* refactor(gwas-ui): remove comments, add prop type

* Fix warnings (#1023)

* solutions to get rid of warnings

-  "useForm" warning in dev mode
- Cannot update a component (`CaseControlGWAS`) while rendering a
different component (`ConceptsStatsByHare`).

..."useForm" warning happened because the `form.setFieldsValue` was called in the wrong step of the wizard,
when no form was rendered yet

...the other warning happened because previous code was trying to update a state item of the outer component while its
own rendering was still taking place...

ALSO: improved some naming, fixed some typos.

* fix issue where fetchConceptStatsByHare was not being called after changing cohort

* fix(hare): pass concept value name (#1024)

* fix(hare): pass concept value name

* fix(typo): add missing brackets

* refactor(gwas-ui): add first step to quant & case control, move fetches

* fix covariates in submit request by using the selectedCovariates state variable (#1025)

* refactor(casecontrol): add control cohort & covariate step

* fix(gwas-ui): add separate file for static jsx labels

* View logs for failed jobs (#1026)

* add view logs option for failed status

* let's not use var but let

* feat(gwas-ui): add props and imports to cov select component

* fix(VADC-29): delete covariate mutation from step handler

* fix(VADC-29): remove handleNext, resolve quant cov selection bug

* refactor(gwas-ui): add gwas type select, delete handleNext

* refactor(gwas-ui-cc): break up cohortSelect, add custom dichotomous template

* fix(gwas-ui-cc): disable other cohort table in cd select

* feat(gwas-ui): add reusable search, reformat covariates, add more hare select logic

* feat(gwas-ui): add hare select in cc, misc styling

* fix(gwas-ui-cc): resolve most eslint errors in refactor

* feat(gwas-ui): parametrize hare select in workflow params

* fix(gwas-ui): comment out refactor

* simplified CustomDichotomousSelect by removing edit option

and added 1st storybook example

* Revert "fix(gwas-ui): comment out refactor"

This reverts commit 1b456d0.

* putting back react-is

was removed by mistake??

* revert styling change

* update storybook and add MSW

https://mswjs.io/

* fix Covariates.jsx and respective storybook test

* basic storybook test for CustomDichotomousSelect

* (WIP) new storybook for WorkflowParameters

* downgrade storybook

this helped fix webpack issues. Now both webpack AND storybook
work (even at the same time!).
The storybook version I now get when running is 6.4.19 instead of 6.5.9

* added init values for WorkflowParameters test/story

* feat(gwas-refactor): add case control submission progress

* feat(gwas-refactor): display success w/ status

* test for GWASFormSubmit

* feat(gwas-ui-demo): add outcome selection review to quant

* feat read argo template version from config (#1037)

* feat(gwas-refactor): add quant to final step & workflow params

* feat(gwas-refactor): complete quant submission

* fix harebreakdown description

* add validation for numPCs and HARE selection in Case-control flow

* add/fix validation for numPCs and HARE selection in Quantitative flow

* feat(gwas-refactor): update submit req body for selected concepts

* fix use gwasTemplate for template_version

* feat add react tour (#1042)

* feat(gwas-refactor): eslint changes, update req body

* fix(gwas-refactor): typo

* Revert "feat add react tour (#1042)"

This reverts commit 351b55c.

* feat add react tour (#1044)

* fix(gwas-submission): use concept value name (#1045)

* feat(text): slight changes to user facing text in case-control (#1047)

* fix add space for parameter name and input, add missing tour button (#1049)

* fix gwas ui eslint errors (#1050)

* fix(eslint): delete previous case control and quantitative

* fix(eslint): import/prop validation, camelcase, consistent returns

* fix(eslint): custom dichotomous removal

* fix(eslint): fix all current eslint errors, include cd removal

* fix(eslint): escape quotes

* fix(gwas-ui): remove babel-eslint, sync plugins

* fix(eslint): eslint resolved after syncing babel

* fix(gwas-ui): revert dev html w/ clinical trials

* fix(package): updated lock

* chore(dep): update trim newlines

* fix(deps): rebuild lock

* fix(dep): remove trimlines dep

* fix(deps): handle trim newlines issue within default-browser-id deps

* fix(dep): meow

* Fix/gwas id bug (#1056)

* fix(typo): uiid vs uuid oof

* refactor(cleanup): move & rename files, remove comments, cov delete

* fix(eslint): defaultProps > defaultPropTypes

* fix(gwas-ui): fix bugs & pr feedback (#1058)

Co-authored-by: Andrew Prokhorenkov <aprokh@uchicago.edu>
Co-authored-by: Kyle Hernandez <kmhernan84@gmail.com>
Co-authored-by: pieterlukasse <pieterlukasse@gmail.com>
Co-authored-by: UchicagoZchen138 <86243966+UchicagoZchen138@users.noreply.github.com>
Co-authored-by: craigrbarnes <craig.barnes@intelligentlight.com>
Co-authored-by: Craig Barnes <craigrbarnes@uchicago.edu>
Co-authored-by: UchicagoZchen138 <zchen138@uchicago.edu>
cmlsn pushed a commit that referenced this pull request Nov 29, 2022
* feat(gwas-ui-demo): integrate middleware endpts, add status list and modal template

* add manifest object

* feat(gwas-ui-demo): move filter to prev step & change dispay of statuses

* feat(gwas-ui-demo): form submit conditions

* fix: naming of GWAS app

* fix: change correct naming

* feat(gwas-ui-demo): refactor workflow list & add prefixed id

* feat(gwas-ui-demo): refactor covar delete & edit btn layout

* feat(gwas-ui-demo): change source id hot fix

* feat(gwas-ui-demo): change step description & template

* feat(gwas-ui-demo): refactor queries for cohort definitions and concepts, add loading status

* feat(gwas-ui-demo): add loading fetch logic and submission and cancel for gwas workflows

* fix: update packages-lock.json

* feat(gwas-ui-demo): filter empty cohort defs & default page size

* feat(gwas-ui-demo): redirect to wts login if no creds

* feat(gwas-ui-demo): fetch sources after wts & fix covariate removal

* feat(gwas-ui-demo): comment cohort concept filter

* feat(gwas-ui-demo): resolve eslint errors

* fix(stylelint): remove !important

* feat(gwas-ui-demo): remove comment, cancel status

* feat(gwas-ui-demo): remove comments and unneeded declarations

* feat(gwas-ui-demo): update gwas template version

* feat(gwas-ui-demo): add conservative querying config

* feat(gwas-ui-demo): delete old gwas app

* feat(gwas-ui-demo): linter changes

* feat(gwas-ui-demo): refetch workflow status list every minute

* feat(gwas-ui-demo): fix interval

* feat(gwas-ui-demo): uninstall react-is

* feat(gwas-ui-demo): add job status refetch interval

* feat(gwas-ui-demo): run eslint

* feat(dev): add atlas icram content security to dev html

* feat(PXP-9868): change gwas description, add spinners

* feat(gwas-ui-demo): add quantitative vs case control selection

* feat(PXP-9943): add hare dropdown to quant gwas

* patch extra exception handling part

missing part from PR  #994

* feat(gwas-ui-demo): add gwas type descriptions

* feat(gwas-ui-demo): add reset btn for gwas type

* feat(gwas-ui-demo): add first 4 steps for case control

* feat(gwas-ui-demo): add separate hare dropdowns, update req bodies

* adding extra stats review step to case-control flow (#999)

* feat(gwas-ui-demo): add details and notification to quant final step, refactor hare fetches in case/control

* feat(gwas-ui-demo): remove isBinary from forms

* feat(gwas-ui-demo): add info button placeholders

* feat(gwas-ui-demo): make review header smaller

* fix(gwas-ui-demo): fix covariate delete in case control

* feat(gwas-ui-demo): add job name to quant req

* filtering concepts to allow only continuous ones to be selected (#1000)

* fix(gwas-ui-demo): feedback step changes, add cohort button, remove delete

* feat(gwas-ui-demo): add info button text to most of quant

* adding a event listener to capture messages posted by the app (#1002)

* adding a event listener to capture messages posted by the app

This generic solution allows for any future app to use postMessage to
keep user session alive

* adjust HARE concept id (#1004)

* Fix/case control hare (#1005)

* fix(casecontrol): hare concept ID and boolean function

* fix(requests): add queryConfig to stop spurious requests from being triggered

* adjust concept type filter to reflect new type (#1006)

* feat add workflow name (#1008)

* adding overlap check (#1009)

* Chore/update text workflow steps (#1010)

* change text/styling in pipeline wizard

* update text and style for GWASUIApp

Co-authored-by: Craig Barnes <craigrbarnes@uchicago.edu>

* using new cohort-middleware endpoint for fetching covariates by concept type (#1011)

* Fix/gwas submission params (#1013)

* chore(template): update template name

* fix(hare): pass hare population parameter

* fix(casecontrol): lots of bug fixing for submission (#1014)

* Fix/gwas state issues (#1015)

* fix(reset): reset more state vars

* fix(nextButton): add next button disabled logic for case-control

* fix(quant-ui): persist current table page after selection, start filter functionality

* separating value from description in hare dropdown & merging case-control dropdowns  (#1018)

* separating value from description in hare dropdown

* change to ensure dropdown description is updated when the data is refreshed

* merge case and control HARE dropdowns into a single selection

...showing the cohort sizes in the dropdown. Also aligned both wizards to use similar code, e.g. calling a
function for the description

* fix dropdown width issue

...and better naming

* fix(PXP-10058): widen jobs submitted on pipeline selection page

* Add HARE concept id in submit & make HARE selection mandatory (#1022)

* add HARE concept id to submit workflow call

* making HARE selection mandatory for 1st wizard

* making HARE selection mandatory for 2nd wizard

* fix(gwas-ui): remove extra workflow lists, add cohort btn reposition

* refactor(gwas-ui): remove comments, add prop type

* Fix warnings (#1023)

* solutions to get rid of warnings

-  "useForm" warning in dev mode
- Cannot update a component (`CaseControlGWAS`) while rendering a
different component (`ConceptsStatsByHare`).

..."useForm" warning happened because the `form.setFieldsValue` was called in the wrong step of the wizard,
when no form was rendered yet

...the other warning happened because previous code was trying to update a state item of the outer component while its
own rendering was still taking place...

ALSO: improved some naming, fixed some typos.

* fix issue where fetchConceptStatsByHare was not being called after changing cohort

* fix(hare): pass concept value name (#1024)

* fix(hare): pass concept value name

* fix(typo): add missing brackets

* refactor(gwas-ui): add first step to quant & case control, move fetches

* fix covariates in submit request by using the selectedCovariates state variable (#1025)

* refactor(casecontrol): add control cohort & covariate step

* fix(gwas-ui): add separate file for static jsx labels

* View logs for failed jobs (#1026)

* add view logs option for failed status

* let's not use var but let

* feat(gwas-ui): add props and imports to cov select component

* fix(VADC-29): delete covariate mutation from step handler

* fix(VADC-29): remove handleNext, resolve quant cov selection bug

* refactor(gwas-ui): add gwas type select, delete handleNext

* refactor(gwas-ui-cc): break up cohortSelect, add custom dichotomous template

* fix(gwas-ui-cc): disable other cohort table in cd select

* feat(gwas-ui): add reusable search, reformat covariates, add more hare select logic

* feat(gwas-ui): add hare select in cc, misc styling

* fix(gwas-ui-cc): resolve most eslint errors in refactor

* feat(gwas-ui): parametrize hare select in workflow params

* fix(gwas-ui): comment out refactor

* simplified CustomDichotomousSelect by removing edit option

and added 1st storybook example

* Revert "fix(gwas-ui): comment out refactor"

This reverts commit 1b456d0.

* putting back react-is

was removed by mistake??

* revert styling change

* update storybook and add MSW

https://mswjs.io/

* fix Covariates.jsx and respective storybook test

* basic storybook test for CustomDichotomousSelect

* (WIP) new storybook for WorkflowParameters

* downgrade storybook

this helped fix webpack issues. Now both webpack AND storybook
work (even at the same time!).
The storybook version I now get when running is 6.4.19 instead of 6.5.9

* added init values for WorkflowParameters test/story

* feat(gwas-refactor): add case control submission progress

* feat(gwas-refactor): display success w/ status

* test for GWASFormSubmit

* feat(gwas-ui-demo): add outcome selection review to quant

* feat read argo template version from config (#1037)

* feat(gwas-refactor): add quant to final step & workflow params

* feat(gwas-refactor): complete quant submission

* fix harebreakdown description

* add validation for numPCs and HARE selection in Case-control flow

* add/fix validation for numPCs and HARE selection in Quantitative flow

* feat(gwas-refactor): update submit req body for selected concepts

* fix use gwasTemplate for template_version

* feat add react tour (#1042)

* feat(gwas-refactor): eslint changes, update req body

* fix(gwas-refactor): typo

* Revert "feat add react tour (#1042)"

This reverts commit 351b55c.

* feat add react tour (#1044)

* fix(gwas-submission): use concept value name (#1045)

* feat(text): slight changes to user facing text in case-control (#1047)

* fix add space for parameter name and input, add missing tour button (#1049)

* fix gwas ui eslint errors (#1050)

* fix(eslint): delete previous case control and quantitative

* fix(eslint): import/prop validation, camelcase, consistent returns

* fix(eslint): custom dichotomous removal

* fix(eslint): fix all current eslint errors, include cd removal

* fix(eslint): escape quotes

* fix(gwas-ui): remove babel-eslint, sync plugins

* fix(eslint): eslint resolved after syncing babel

* fix(gwas-ui): revert dev html w/ clinical trials

* fix(package): updated lock

* chore(dep): update trim newlines

* fix(deps): rebuild lock

* fix(dep): remove trimlines dep

* fix(deps): handle trim newlines issue within default-browser-id deps

* fix(dep): meow

* Fix/gwas id bug (#1056)

* fix(typo): uiid vs uuid oof

* refactor(cleanup): move & rename files, remove comments, cov delete

* fix(eslint): defaultProps > defaultPropTypes

* fix(gwas-ui): fix bugs & pr feedback (#1058)

Co-authored-by: Andrew Prokhorenkov <aprokh@uchicago.edu>
Co-authored-by: Kyle Hernandez <kmhernan84@gmail.com>
Co-authored-by: pieterlukasse <pieterlukasse@gmail.com>
Co-authored-by: UchicagoZchen138 <86243966+UchicagoZchen138@users.noreply.github.com>
Co-authored-by: craigrbarnes <craig.barnes@intelligentlight.com>
Co-authored-by: Craig Barnes <craigrbarnes@uchicago.edu>
Co-authored-by: UchicagoZchen138 <zchen138@uchicago.edu>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants