diff --git a/web/src/Setting.js b/web/src/Setting.js index 8bf73078..7e34f2d8 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -74,6 +74,10 @@ export function isProviderVisibleForSignIn(providerItem) { return isProviderVisible(providerItem); } +export function isProviderPrompted(providerItem) { + return isProviderVisible(providerItem) && providerItem.prompted; +} + export function parseJson(s) { if (s === "") { return null; diff --git a/web/src/auth/PromptPage.js b/web/src/auth/PromptPage.js index 7f158a9b..1c5df31a 100644 --- a/web/src/auth/PromptPage.js +++ b/web/src/auth/PromptPage.js @@ -74,13 +74,26 @@ class PromptPage extends React.Component { }); } + renderAffiliation(application) { + const signupItems = application.signupItems.filter(signupItem => signupItem.name === "Affiliation"); + if (signupItems.length === 0) { + return null; + } + + if (!signupItems[0].prompted) { + return null; + } + + return ( + { return this.updateUserField(key, value)}} /> + ) + } + renderContent(application) { return (
{ - (application === null || this.state.user === null) ? null : ( - { return this.updateUserField(key, value)}} /> - ) + this.renderAffiliation(application) }
)