Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show error message when failing to integrate with Azure DevOps #10888

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const AzureDevOpsProviderRow = (props: Props) => {
viewerRef
)
const atmosphere = useAtmosphere()
const {submitting, submitMutation, onError, onCompleted} = useMutationProps()
const {submitting, submitMutation, error, onError, onCompleted} = useMutationProps()
const mutationProps = {submitting, submitMutation, onError, onCompleted} as MenuMutationProps
const {teamMember} = viewer
const {integrations} = teamMember!
Expand All @@ -78,6 +78,7 @@ const AzureDevOpsProviderRow = (props: Props) => {
providerName={Providers.AZUREDEVOPS_NAME}
providerDescription={Providers.AZUREDEVOPS_DESC}
providerLogo={<AzureDevOpsProviderLogo />}
error={error?.message}
/>
{menuPortal(
<AzureDevOpsConfigMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const GcalProviderRow = (props: Props) => {
const {viewerRef, teamId} = props
const atmosphere = useAtmosphere()
const mutationProps = useMutationProps()
const {submitting} = mutationProps
const {submitting, error} = mutationProps
const {togglePortal, originRef, menuPortal, menuProps} = useMenu(MenuPosition.UPPER_RIGHT)

const viewer = useFragment(
Expand Down Expand Up @@ -74,6 +74,7 @@ const GcalProviderRow = (props: Props) => {
providerName={Providers.GCAL_NAME}
providerDescription={Providers.GCAL_DESC}
providerLogo={<GcalProviderLogo />}
error={error?.message}
/>
{menuPortal(
<GcalConfigMenu menuProps={menuProps} mutationProps={mutationProps} teamId={teamId} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const GitHubProviderRow = (props: Props) => {
`,
viewerRef
)
const {submitting, submitMutation, onError, onCompleted} = useMutationProps()
const {submitting, submitMutation, error, onError, onCompleted} = useMutationProps()
const atmosphere = useAtmosphere()
const mutationProps = {submitting, submitMutation, onError, onCompleted} as MenuMutationProps
const {teamMember} = viewer
Expand All @@ -57,6 +57,7 @@ const GitHubProviderRow = (props: Props) => {
providerName={Providers.GITHUB_NAME}
providerDescription={Providers.GITHUB_DESC}
providerLogo={<GitHubProviderLogo />}
error={error?.message}
/>
{menuPortal(
<GitHubConfigMenu menuProps={menuProps} mutationProps={mutationProps} teamId={teamId} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GitLabProviderRow = (props: Props) => {
const {teamId, viewerRef} = props
const atmosphere = useAtmosphere()
const mutationProps = useMutationProps()
const {submitting} = mutationProps
const {submitting, error} = mutationProps
const openOAuth = (providerId: string, clientId: string, serverBaseUrl: string) => {
GitLabClientManager.openOAuth(
atmosphere,
Expand Down Expand Up @@ -111,6 +111,11 @@ const GitLabProviderRow = (props: Props) => {
? 'Use GitLab Issues from within Parabol.'
: 'Connect to your own GitLab server.'}
</RowInfoCopy>
{!!error?.message && (
<div className='text-sm text-tomato-500 [&_a]:font-semibold [&_a]:text-tomato-500 [&_a]:underline'>
{error.message}
</div>
)}
</RowInfo>
<ProviderActions>
{!connected && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const MSTeamsProviderRow = (props: Props) => {
)
const [isConnectClicked, setConnectClicked] = useState(false)
const {togglePortal, originRef, menuPortal, menuProps} = useMenu(MenuPosition.UPPER_RIGHT)
const {submitting, submitMutation, onError, onCompleted} = useMutationProps()
const {submitting, submitMutation, error, onError, onCompleted} = useMutationProps()
const mutationProps = {submitting, submitMutation, onError, onCompleted} as MenuMutationProps
const {teamMember} = viewer
const {integrations} = teamMember!
Expand All @@ -68,6 +68,7 @@ const MSTeamsProviderRow = (props: Props) => {
providerLogo={<MSTeamsProviderLogo />}
connectButtonText={!isConnectClicked ? 'Connect' : 'Cancel'}
connectButtonIcon={!isConnectClicked ? <AddIcon /> : <CloseIcon />}
error={error?.message}
>
{(auth || isConnectClicked) && <MSTeamsPanel teamId={teamId} viewerRef={viewer} />}
</ProviderRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const MattermostProviderRow = (props: Props) => {
)
const [isConnectClicked, setConnectClicked] = useState(false)
const {togglePortal, originRef, menuPortal, menuProps} = useMenu(MenuPosition.UPPER_RIGHT)
const {submitting, submitMutation, onError, onCompleted} = useMutationProps()
const {submitting, submitMutation, error, onError, onCompleted} = useMutationProps()
const mutationProps = {submitting, submitMutation, onError, onCompleted} as MenuMutationProps
const {teamMember} = viewer
const {integrations} = teamMember!
Expand All @@ -68,6 +68,7 @@ const MattermostProviderRow = (props: Props) => {
providerLogo={<MattermostProviderLogo />}
connectButtonText={!isConnectClicked ? 'Connect' : 'Cancel'}
connectButtonIcon={!isConnectClicked ? <AddIcon /> : <CloseIcon />}
error={error?.message}
>
{(auth || isConnectClicked) && <MattermostPanel teamId={teamId} viewerRef={viewer} />}
</ProviderRow>
Expand Down