-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1101 from bcgov/feat/SSOTEAM-1084
feat: removed dependency on terraform batch jobs to apply integrations to keycloak
- Loading branch information
Showing
45 changed files
with
1,467 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
export const workflowStatusOptions = [ | ||
{ value: 'draft', label: 'Draft' }, | ||
{ value: 'submitted', label: 'Submitted' }, | ||
{ value: 'pr', label: 'PR' }, | ||
{ value: 'prFailed', label: 'PR Failed' }, | ||
{ value: 'planned', label: 'Planned' }, | ||
{ value: 'planFailed', label: 'Plan Failed' }, | ||
{ value: 'applied', label: 'Applied' }, | ||
{ value: 'applyFailed', label: 'Apply Failed' }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ import GithubStatusPanel from './GithubStatusPanel'; | |
import ServiceAccountRoles from 'page-partials/my-dashboard/ServiceAccountRoles'; | ||
import DigitalCredentialPanel from './DigitalCredentialPanel'; | ||
import MetricsPanel from './MetricsPanel'; | ||
import { ErrorMessage } from '@app/components/MessageBox'; | ||
|
||
const TabWrapper = styled.div<{ short?: boolean }>` | ||
padding-left: 1rem; | ||
|
@@ -77,6 +78,25 @@ const IntegrationWrapper = ({ integration, children }: { integration: Integratio | |
); | ||
}; | ||
|
||
const getIntegrationErrorTab = () => { | ||
return ( | ||
<Tab key={TAB_DETAILS} tab="Technical Details"> | ||
<TabWrapper short={false}> | ||
<div style={{ display: 'inline-flex', margin: '20px 0 20px 0', background: '#FFCCCB', borderRadius: '5px' }}> | ||
<div style={{ padding: 5 }}> | ||
<ErrorMessage> | ||
Your request for an integration could not be completed. Please{' '} | ||
<Link external href="mailto:[email protected]"> | ||
contact the Pathfinder SSO Team | ||
</Link> | ||
</ErrorMessage> | ||
</div> | ||
</div> | ||
</TabWrapper> | ||
</Tab> | ||
); | ||
}; | ||
|
||
const getInstallationTab = ({ | ||
integration, | ||
approvalContext, | ||
|
@@ -304,17 +324,21 @@ function IntegrationInfoTabs({ integration }: Props) { | |
integration.devIdps?.length && integration.devIdps?.every((idp) => idp === 'digitalcredential'); | ||
|
||
if (displayStatus === 'Submitted') { | ||
if (bceidProdApplying || githubProdApplying || digitalCredentialProdApplying) { | ||
tabs.push(getApprovalProgressTab({ integration, approvalContext })); | ||
if (['planFailed', 'applyFailed'].includes(integration.status as string)) { | ||
tabs.push(getIntegrationErrorTab()); | ||
allowedTabs.push(TAB_DETAILS); | ||
} else { | ||
tabs.push(getProgressTab({ integration, approvalContext })); | ||
allowedTabs.push(TAB_DETAILS); | ||
if (bceidProdApplying || githubProdApplying || digitalCredentialProdApplying) { | ||
tabs.push(getApprovalProgressTab({ integration, approvalContext })); | ||
allowedTabs.push(TAB_DETAILS); | ||
} else { | ||
tabs.push(getProgressTab({ integration, approvalContext })); | ||
allowedTabs.push(TAB_DETAILS); | ||
} | ||
} | ||
} else if (displayStatus === 'Completed') { | ||
tabs.push(getInstallationTab({ integration, approvalContext })); | ||
allowedTabs.push(TAB_DETAILS); | ||
|
||
// Exclude role management from integrations with only DC | ||
if (!digitalCredentialOnly) { | ||
tabs.push(getRoleManagementTab({ integration })); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,85 @@ | ||
import React, { useState } from 'react'; | ||
import React, { useEffect, useState } from 'react'; | ||
import IntegrationInfoTabs from 'page-partials/my-dashboard/IntegrationInfoTabs'; | ||
import IntegrationList from 'page-partials/my-dashboard/IntegrationList'; | ||
import VerticalLayout from 'page-partials/my-dashboard/VerticalLayout'; | ||
import { Integration } from 'interfaces/Request'; | ||
import { PageProps } from 'interfaces/props'; | ||
import CenteredModal from '@app/components/CenteredModal'; | ||
import { useRouter } from 'next/router'; | ||
import { faCommentDots, faEnvelope, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; | ||
import styled from 'styled-components'; | ||
import { Link } from '@button-inc/bcgov-theme'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
const Column = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
flex-basis: 100%; | ||
flex: 1; | ||
`; | ||
|
||
function MyIntegrations({ session }: PageProps) { | ||
const router = useRouter(); | ||
const [integration, setIntegration] = useState<Integration | null>(null); | ||
const [integrationCount, setIntegrationCount] = useState(1); | ||
const [showModal, setShowModal] = useState(false); | ||
const integrationFailedMessageModalId = 'integration-failed-modal'; | ||
const handleModalFailedMessageModal = async () => (window.location.hash = integrationFailedMessageModalId); | ||
const [processedRequestId, setProcessedRequestId] = useState(''); | ||
|
||
useEffect(() => { | ||
setProcessedRequestId(router.query.requestId as string); | ||
if (router?.query?.integrationFailedMessageModal === 'true') { | ||
setShowModal(true); | ||
handleModalFailedMessageModal(); | ||
} | ||
}, [router.query.showModal]); | ||
|
||
return ( | ||
<VerticalLayout | ||
tab="integrations" | ||
leftPanel={() => <IntegrationList setIntegration={setIntegration} setIntegrationCount={setIntegrationCount} />} | ||
rightPanel={() => integration && <IntegrationInfoTabs integration={integration} />} | ||
showResizable={integrationCount > 0} | ||
/> | ||
<> | ||
<VerticalLayout | ||
tab="integrations" | ||
leftPanel={() => <IntegrationList setIntegration={setIntegration} setIntegrationCount={setIntegrationCount} />} | ||
rightPanel={() => integration && <IntegrationInfoTabs integration={integration} />} | ||
showResizable={integrationCount > 0} | ||
/> | ||
<CenteredModal | ||
title={`${processedRequestId} - Integration request failed`} | ||
icon={faExclamationTriangle} | ||
id={integrationFailedMessageModalId} | ||
content={ | ||
<div> | ||
<div> | ||
<p>The integration request could not be completed. Please contact the Pathfinder SSO Team.</p> | ||
</div> | ||
<div style={{ display: 'flex', flexDirection: 'row', flexWrap: 'wrap', width: '100%' }}> | ||
<Column> | ||
<div> | ||
<a | ||
href="https://chat.developer.gov.bc.ca/channel/sso" | ||
target="_blank" | ||
title="Rocket Chat" | ||
style={{ color: '#0d6efd' }} | ||
> | ||
<FontAwesomeIcon size="1x" icon={faCommentDots} color="#0d6efd" /> Rocketchat | ||
</a> | ||
</div> | ||
</Column> | ||
<Column> | ||
<div> | ||
<a href="mailto:[email protected]" title="Pathfinder SSO" style={{ color: '#0d6efd' }}> | ||
<FontAwesomeIcon size="1x" icon={faEnvelope} color="#0d6efd" /> Email | ||
</a> | ||
</div> | ||
</Column> | ||
</div> | ||
</div> | ||
} | ||
showCancel={false} | ||
showConfirm={false} | ||
closable | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.