Skip to content

Commit

Permalink
Merge pull request #6127 from DonOmalVindula/login-flow-console-setti…
Browse files Browse the repository at this point in the history
…ngs-npe-fix

Add AILoginFlowProvider in console settings login flow component
  • Loading branch information
DonOmalVindula authored May 2, 2024
2 parents 6e3a3b8 + d67f3d6 commit f538d7b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
6 changes: 6 additions & 0 deletions .changeset/stale-starfishes-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/features": patch
"@wso2is/console": patch
---

Add AILoginFlowProvider console settings login flow
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
* under the License.
*/

import useUIConfig from "../../../admin.core.v1/hooks/use-ui-configs";
import { hasRequiredScopes } from "@wso2is/core/helpers";
import { FeatureAccessConfigInterface, IdentifiableComponentInterface } from "@wso2is/core/models";
import React, { FunctionComponent, ReactElement, useMemo } from "react";
import { useSelector } from "react-redux";
import { SignOnMethods } from "../../../admin.applications.v1/components/settings/sign-on-methods/sign-on-methods";
import useUIConfig from "../../../admin.core.v1/hooks/use-ui-configs";
import { AppState } from "../../../admin.core.v1/store";
import { IdentityProviderManagementConstants } from "../../../admin.identity-providers.v1/constants";
import useConsoleSettings from "../../hooks/use-console-settings";
import "./console-login-flow.scss";
import AILoginFlowProvider from "../../../admin.login-flow.ai.v1/providers/ai-login-flow-provider";
import useConsoleSettings from "../../hooks/use-console-settings";

/**
* Props interface of {@link ConsoleLoginFlow}
Expand Down Expand Up @@ -66,22 +67,24 @@ const ConsoleLoginFlow: FunctionComponent<ConsoleLoginFlowPropsInterface> = (
}, [ featureConfig ]);

return (
<div className="console-login-flow" data-componentid={ componentId }>
<SignOnMethods
application={ consoleConfigurations }
appId={ consoleConfigurations?.id }
authenticationSequence={ consoleConfigurations?.authenticationSequence }
clientId={ consoleConfigurations?.clientId }
isLoading={ isConsoleConfigurationsFetchRequestLoading }
onUpdate={ () => {
mutateConsoleConfigurations();
} }
readOnly={ isReadOnly }
isSystemApplication={ true }
hiddenAuthenticators={ hiddenAuthenticators }
data-componentid={ `${componentId}-sign-on-methods` }
/>
</div>
<AILoginFlowProvider>
<div className="console-login-flow" data-componentid={ componentId }>
<SignOnMethods
application={ consoleConfigurations }
appId={ consoleConfigurations?.id }
authenticationSequence={ consoleConfigurations?.authenticationSequence }
clientId={ consoleConfigurations?.clientId }
isLoading={ isConsoleConfigurationsFetchRequestLoading }
onUpdate={ () => {
mutateConsoleConfigurations();
} }
readOnly={ isReadOnly }
isSystemApplication={ true }
hiddenAuthenticators={ hiddenAuthenticators }
data-componentid={ `${componentId}-sign-on-methods` }
/>
</div>
</AILoginFlowProvider>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ const AILoginFlowProvider = (props: PropsWithChildren<AILoginFlowProviderProps>)
{
!applicationDisabledFeatures?.includes(LOGIN_FLOW_AI_FEATURE_TAG) &&
!isSubOrganization() && (
<LoginFlowAIBanner/>
<div className="mb-2">
<LoginFlowAIBanner/>
</div>
)
}
{ children }
Expand Down

0 comments on commit f538d7b

Please sign in to comment.