mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
fix: add country/region selectbox in prompt page (#1022)
This commit is contained in:
@ -208,10 +208,18 @@ export function isProviderPrompted(providerItem) {
|
||||
return isProviderVisible(providerItem) && providerItem.prompted;
|
||||
}
|
||||
|
||||
export function isSignupItemPrompted(signupItem) {
|
||||
return signupItem.visible && signupItem.prompted;
|
||||
}
|
||||
|
||||
export function getAllPromptedProviderItems(application) {
|
||||
return application.providers.filter(providerItem => isProviderPrompted(providerItem));
|
||||
}
|
||||
|
||||
export function getAllPromptedSignupItems(application) {
|
||||
return application.signupItems.filter(signupItem => isSignupItemPrompted(signupItem));
|
||||
}
|
||||
|
||||
export function getSignupItem(application, itemName) {
|
||||
const signupItems = application.signupItems?.filter(signupItem => signupItem.name === itemName);
|
||||
if (signupItems.length === 0) {
|
||||
@ -283,6 +291,11 @@ export function hasPromptPage(application) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const signupItems = getAllPromptedSignupItems(application);
|
||||
if (signupItems.length !== 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return isAffiliationPrompted(application);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user