Skip to content

Commit

Permalink
Merge pull request wso2#4903 from savindi7/move-elk-analytics-to-adap…
Browse files Browse the repository at this point in the history
…tive-auth

Move ELK Analytics configuration to ELK-Risk-Based conditional login flow configuration
  • Loading branch information
brionmario authored Dec 4, 2023
2 parents 6d951ac + 6bc38c4 commit f649b6d
Show file tree
Hide file tree
Showing 14 changed files with 742 additions and 62 deletions.
8 changes: 8 additions & 0 deletions .changeset/thick-lies-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@wso2is/theme": patch
"@wso2is/console": patch
"@wso2is/i18n": patch
"@wso2is/myaccount": patch
---

Support to configure ELK Analytics from the Sign in methods of an App
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* under the License.
*/

import { GearIcon } from "@oxygen-ui/react-icons";
import Chip from "@oxygen-ui/react/Chip";
import { FeatureStatus, FeatureTags, useCheckFeatureStatus, useCheckFeatureTags } from "@wso2is/access-control";
import { UIConstants } from "@wso2is/core/constants";
Expand All @@ -31,6 +32,7 @@ import {
DocumentationLink,
GenericIcon,
Heading,
Link,
Popup,
SegmentedAccordion,
Text,
Expand Down Expand Up @@ -61,6 +63,7 @@ import { Dispatch } from "redux";
import { Checkbox, Dropdown, Header, Icon, Input, Menu, Sidebar } from "semantic-ui-react";
import { stripSlashes } from "slashes";
import { ScriptTemplatesSidePanel, ScriptTemplatesSidePanelRefInterface } from "./script-templates-side-panel";
import { ELK_RISK_BASED_TEMPLATE_NAME } from "../../../../../authentication-flow-builder/constants/template-constants";
import useAuthenticationFlow from "../../../../../authentication-flow-builder/hooks/use-authentication-flow";
import { AppUtils, EventPublisher, getOperationIcons } from "../../../../../core";
import { OrganizationType } from "../../../../../organizations/constants";
Expand Down Expand Up @@ -172,6 +175,7 @@ export const ScriptBasedFlow: FunctionComponent<AdaptiveScriptsPropsInterface> =
const adaptiveFeatureStatus : FeatureStatus = useCheckFeatureStatus("console.application.signIn.adaptiveAuth");
const adaptiveFeatureTags: string[] = useCheckFeatureTags("console.application.signIn.adaptiveAuth");
const [ isPremiumFeature, setIsPremiumFeature ] = useState<boolean>(false);
const [ isELKConfigureClicked, setIsELKConfigureClicked ] = useState<boolean>(false);

/**
* List of secrets for the selected `secretType`. It can hold secrets of
Expand Down Expand Up @@ -1142,6 +1146,38 @@ export const ScriptBasedFlow: FunctionComponent<AdaptiveScriptsPropsInterface> =
"sections.scriptBased.editor.resetConfirmation.message") }
</ConfirmationModal.Message>
<ConfirmationModal.Content data-componentid={ `${ componentId }-reset-confirmation-modal-content` }>
{
selectedAdaptiveAuthTemplate.name === ELK_RISK_BASED_TEMPLATE_NAME && (
<>
<Text>
<Trans
i18nKey={
"console:manage.features.governanceConnectors.connectorCategories." +
"otherSettings.connectors.elasticAnalyticsEngine.warningModal.configure"
}
>
(<Link
onClick={ () => setIsELKConfigureClicked(true) }
external={ false }
>
Configure
</Link>
ELK Analytics settings for proper functionality.)
</Trans>
</Text>
<Text>
<Trans
i18nKey={
"console:manage.features.governanceConnectors.connectorCategories." +
"otherSettings.connectors.elasticAnalyticsEngine.warningModal.reassure"
}
>
You can update your settings anytime.
</Trans> (<Code><GearIcon size={ 14 } /></Code>)
</Text>
</>
)
}
<Trans
i18nKey={
"console:develop.features.applications.edit.sections.signOnMethod.sections" +
Expand Down Expand Up @@ -1275,6 +1311,8 @@ export const ScriptBasedFlow: FunctionComponent<AdaptiveScriptsPropsInterface> =
<Sidebar.Pushable className="script-editor-with-template-panel no-border">
{ !readOnly && (
<ScriptTemplatesSidePanel
onELKModalClose={ () => setIsELKConfigureClicked(false) }
isELKConfigureClicked={ isELKConfigureClicked }
title={
t("console:develop.features.applications.edit.sections" +
".signOnMethod.sections" +
Expand Down
Loading

0 comments on commit f649b6d

Please sign in to comment.