Skip to content

Commit

Permalink
Merge pull request wso2#5018 from savindi7/improve-server-endpoints-s…
Browse files Browse the repository at this point in the history
…ection

Improve the server endpoints section in the Info tab of Applications
  • Loading branch information
savindi7 authored Dec 10, 2023
2 parents fd606d4 + 7c91943 commit 81b6521
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 76 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-cups-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/console": patch
---

Improve Server endpoints section in Applications' Info tab
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/

import { AsgardeoSPAClient, OIDCEndpoints } from "@asgardeo/auth-react";
import { AlertLevels, TestableComponentInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
Expand All @@ -27,6 +28,7 @@ import { Form, Grid } from "semantic-ui-react";
import { FeatureConfigInterface } from "../../../core";
import { AppState } from "../../../core/store";
import { getHelpPanelIcons } from "../../configs/ui";
import { ApplicationManagementConstants } from "../../constants";
import {
OIDCApplicationConfigurationInterface,
OIDCEndpointsInterface
Expand All @@ -43,6 +45,10 @@ const identityClient: AsgardeoSPAClient = AsgardeoSPAClient.getInstance();
*/
interface OIDCConfigurationsPropsInterface extends TestableComponentInterface {
oidcConfigurations: OIDCApplicationConfigurationInterface;
/**
* Application template ID.
*/
templateId?: string;
}

/**
Expand All @@ -64,6 +70,7 @@ export const OIDCConfigurations: FunctionComponent<OIDCConfigurationsPropsInterf

const {
oidcConfigurations,
templateId,
[ "data-testid" ]: testId
} = props;

Expand Down Expand Up @@ -343,78 +350,36 @@ export const OIDCConfigurations: FunctionComponent<OIDCConfigurationsPropsInterf
{
featureConfig?.server?.enabled && (
<>
<Grid.Row columns={ 2 }>
<Grid.Column mobile={ 8 } tablet={ 8 } computer={ 6 }>
<GenericIcon
icon={ getHelpPanelIcons().endpoints.sessionIframe }
size="micro"
square
transparent
inline
className="left-icon"
verticalAlign="middle"
spaced="right"
/>
<label data-testid={ `${ testId }-session-iframe-label` }>
{ t("console:develop.features.applications.helpPanel.tabs.start.content." +
"oidcConfigurations.labels.sessionIframe") }
</label>
</Grid.Column>
<Grid.Column mobile={ 8 } tablet={ 8 } computer={ 10 }>
<CopyInputField
value={ oidcConfigurations?.sessionIframeEndpoint }
data-testid={ `${ testId }-session-iframe-readonly-input` }
/>
</Grid.Column>
</Grid.Row>
<Grid.Row columns={ 2 }>
<Grid.Column mobile={ 8 } tablet={ 8 } computer={ 6 }>
<GenericIcon
icon={ getHelpPanelIcons().endpoints.webFinger }
size="micro"
square
transparent
inline
className="left-icon"
verticalAlign="middle"
spaced="right"
/>
<label data-testid={ `${ testId }-web-finger-label` }>
{ t("console:develop.features.applications.helpPanel.tabs.start.content." +
"oidcConfigurations.labels.webFinger") }
</label>
</Grid.Column>
<Grid.Column mobile={ 8 } tablet={ 8 } computer={ 10 }>
<CopyInputField
value={ oidcConfigurations?.webFingerEndpoint }
data-testid={ `${ testId }-web-finger-readonly-input` }
/>
</Grid.Column>
</Grid.Row>
<Grid.Row columns={ 2 }>
<Grid.Column mobile={ 8 } tablet={ 8 } computer={ 6 }>
<GenericIcon
icon={ getHelpPanelIcons().endpoints.userInfo }
size="micro"
square
transparent
inline
className="left-icon"
verticalAlign="middle"
spaced="right"
/>
<label data-testid={ `${ testId }-dynamic-client-registration-label` }>
{ t("console:develop.features.applications.helpPanel.tabs.start.content." +
"oidcConfigurations.labels.dynamicClientRegistration") }
</label>
</Grid.Column>
<Grid.Column mobile={ 8 } tablet={ 8 } computer={ 10 }>
<CopyInputField
value={ oidcConfigurations?.dynamicClientRegistrationEndpoint }
data-testid={ `${ testId }-dynamic-client-registration-readonly-input` }
/>
</Grid.Column>
</Grid.Row>
{ (
templateId === ApplicationManagementConstants.CUSTOM_APPLICATION_OIDC ||
templateId === ApplicationManagementConstants.TEMPLATE_IDS.get("oidcWeb") ||
templateId === ApplicationManagementConstants.TEMPLATE_IDS.get("spa")
) && (
<Grid.Row columns={ 2 }>
<Grid.Column mobile={ 8 } computer={ 6 }>
<GenericIcon
icon={ getHelpPanelIcons().endpoints.sessionIframe }
size="micro"
square
transparent
inline
className="left-icon"
verticalAlign="middle"
spaced="right"
/>
<label data-testid={ `${ testId }-session-iframe-label` }>
{ t("console:develop.features.applications.helpPanel.tabs.start.content." +
"oidcConfigurations.labels.sessionIframe") }
</label>
</Grid.Column>
<Grid.Column mobile={ 8 } computer={ 10 }>
<CopyInputField
value={ oidcConfigurations?.sessionIframeEndpoint }
data-testid={ `${ testId }-session-iframe-readonly-input` }
/>
</Grid.Column>
</Grid.Row>
) }
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const Info: FunctionComponent<InfoPropsInterface> = (
templateId,
[ "data-componentid" ]: componentId
} = props;

const oidcConfigurations: OIDCApplicationConfigurationInterface = useSelector(
(state: AppState) => state.application.oidcConfigurations);
const samlConfigurations: SAMLApplicationConfigurationInterface = useSelector(
Expand Down Expand Up @@ -115,7 +115,7 @@ export const Info: FunctionComponent<InfoPropsInterface> = (
useEffect(() => {
if (templateId === ApplicationManagementConstants.CUSTOM_APPLICATION_PASSIVE_STS) {
setIsWSFed(true);
}
}
}, [ templateId ]);

return (
Expand Down Expand Up @@ -147,7 +147,10 @@ export const Info: FunctionComponent<InfoPropsInterface> = (
</DocumentationLink>
</Heading>
<Divider hidden/>
<OIDCConfigurations oidcConfigurations={ oidcConfigurations }/>
<OIDCConfigurations
oidcConfigurations={ oidcConfigurations }
templateId={ templateId }
/>
</>
) }
{ isOIDC && isSAML ? (
Expand Down Expand Up @@ -200,7 +203,7 @@ export const Info: FunctionComponent<InfoPropsInterface> = (
</Grid.Column>
</Grid.Row>
</Grid>
</EmphasizedSegment>
</EmphasizedSegment>
) :
(
<EmphasizedSegment padded="very">
Expand Down

0 comments on commit 81b6521

Please sign in to comment.