mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
refactor(console): connector setup warning (#2249)
This commit is contained in:
parent
b6a9d1a07e
commit
83e074a3c5
3 changed files with 12 additions and 21 deletions
|
@ -76,11 +76,9 @@ const SignUpForm = () => {
|
|||
/>
|
||||
)}
|
||||
/>
|
||||
{signUpIdentifier !== SignUpIdentifier.None && (
|
||||
<ConnectorSetupWarning
|
||||
requiredConnectors={signUpIdentifierToRequiredConnectorMapping[signUpIdentifier]}
|
||||
/>
|
||||
)}
|
||||
<ConnectorSetupWarning
|
||||
requiredConnectors={signUpIdentifierToRequiredConnectorMapping[signUpIdentifier]}
|
||||
/>
|
||||
</FormField>
|
||||
{signUpIdentifier !== SignUpIdentifier.None && (
|
||||
<FormField
|
||||
|
|
|
@ -18,9 +18,7 @@ const ConnectorSetupWarning = ({ requiredConnectors }: Props) => {
|
|||
return null;
|
||||
}
|
||||
|
||||
const missingConnectors = (
|
||||
requiredConnectors.length === 0 ? [ConnectorType.Social] : requiredConnectors
|
||||
).filter(
|
||||
const missingConnectors = requiredConnectors.filter(
|
||||
(connectorType) => !connectors.some(({ type, enabled }) => type === connectorType && enabled)
|
||||
);
|
||||
|
||||
|
|
|
@ -124,19 +124,14 @@ const SignInMethodEditBox = ({
|
|||
</DraggableItem>
|
||||
))}
|
||||
</DragDropProvider>
|
||||
{requiredSignInIdentifiers.length > 0 && (
|
||||
<ConnectorSetupWarning
|
||||
requiredConnectors={requiredSignInIdentifiers.reduce<ConnectorType[]>(
|
||||
(connectors, signInIdentifier) => {
|
||||
return [
|
||||
...connectors,
|
||||
...signInIdentifierToRequiredConnectorMapping[signInIdentifier],
|
||||
];
|
||||
},
|
||||
[]
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
<ConnectorSetupWarning
|
||||
requiredConnectors={value.reduce<ConnectorType[]>(
|
||||
(connectors, { identifier: signInIdentifier }) => {
|
||||
return [...connectors, ...signInIdentifierToRequiredConnectorMapping[signInIdentifier]];
|
||||
},
|
||||
[]
|
||||
)}
|
||||
/>
|
||||
<AddSignInMethodButton options={signInIdentifierOptions} onSelected={addSignInMethod} />
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue