mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Add renderAffiliation().
This commit is contained in:
@ -74,6 +74,10 @@ export function isProviderVisibleForSignIn(providerItem) {
|
|||||||
return isProviderVisible(providerItem);
|
return isProviderVisible(providerItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isProviderPrompted(providerItem) {
|
||||||
|
return isProviderVisible(providerItem) && providerItem.prompted;
|
||||||
|
}
|
||||||
|
|
||||||
export function parseJson(s) {
|
export function parseJson(s) {
|
||||||
if (s === "") {
|
if (s === "") {
|
||||||
return null;
|
return null;
|
||||||
|
@ -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 (
|
||||||
|
<AffiliationSelect labelSpan={6} application={application} user={this.state.user} onUpdateUserField={(key, value) => { return this.updateUserField(key, value)}} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
renderContent(application) {
|
renderContent(application) {
|
||||||
return (
|
return (
|
||||||
<div style={{width: '400px'}}>
|
<div style={{width: '400px'}}>
|
||||||
{
|
{
|
||||||
(application === null || this.state.user === null) ? null : (
|
this.renderAffiliation(application)
|
||||||
<AffiliationSelect labelSpan={6} application={application} user={this.state.user} onUpdateUserField={(key, value) => { return this.updateUserField(key, value)}} />
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user