mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
[WEB-4293] fix: redirections for connections page #3370
This commit is contained in:
@@ -406,7 +406,7 @@ export default class GithubController {
|
||||
let redirectUri = `${env.APP_BASE_URL}/${authState.workspace_slug}/settings/integrations/github/`;
|
||||
|
||||
if (authState.profile_redirect) {
|
||||
redirectUri = `${env.APP_BASE_URL}/profile/connections/?workspaceId=${authState.workspace_id}`;
|
||||
redirectUri = `${env.APP_BASE_URL}/${authState.workspace_slug}/settings/account/connections/?workspaceId=${authState.workspace_id}`;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -521,7 +521,7 @@ export default class GithubController {
|
||||
|
||||
try {
|
||||
if (authState.profile_redirect) {
|
||||
redirectUri = `${env.APP_BASE_URL}/profile/connections/?workspaceId=${authState.workspace_id}`;
|
||||
redirectUri = `${env.APP_BASE_URL}/${authState.workspace_slug}/settings/account/connections/?workspaceId=${authState.workspace_id}`;
|
||||
}
|
||||
|
||||
const githubState: GithubPlaneOAuthState = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from "express";
|
||||
import { validate as uuidValidate } from 'uuid';
|
||||
import { validate as uuidValidate } from "uuid";
|
||||
import { E_ENTITY_CONNECTION_KEYS, E_INTEGRATION_KEYS, E_SILO_ERROR_CODES } from "@plane/etl/core";
|
||||
import {
|
||||
E_SLACK_ENTITY_TYPE,
|
||||
@@ -9,7 +9,13 @@ import {
|
||||
TSlackCommandPayload,
|
||||
TSlackPayload,
|
||||
} from "@plane/etl/slack";
|
||||
import { E_PLANE_WEBHOOK_ACTION, E_PLANE_WEBHOOK_EVENT, ExIssue, PlaneWebhookData, PlaneWebhookPayloadBase } from "@plane/sdk";
|
||||
import {
|
||||
E_PLANE_WEBHOOK_ACTION,
|
||||
E_PLANE_WEBHOOK_EVENT,
|
||||
ExIssue,
|
||||
PlaneWebhookData,
|
||||
PlaneWebhookPayloadBase,
|
||||
} from "@plane/sdk";
|
||||
import { env } from "@/env";
|
||||
import { responseHandler } from "@/helpers/response-handler";
|
||||
import { Controller, Delete, EnsureEnabled, Get, Post, Put, useValidateUserAuthentication } from "@/lib";
|
||||
@@ -234,7 +240,7 @@ export default class SlackController {
|
||||
|
||||
let redirectUri = `${env.APP_BASE_URL}/${authState.workspaceSlug}/settings/integrations/slack/`;
|
||||
if (authState.profileRedirect) {
|
||||
redirectUri = `${env.APP_BASE_URL}/profile/connections/?workspaceId=${authState.workspaceId}`;
|
||||
redirectUri = `${env.APP_BASE_URL}/${authState.workspaceSlug}/settings/account/connections/?workspaceId=${authState.workspaceId}`;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -257,7 +263,6 @@ export default class SlackController {
|
||||
return res.redirect(`${redirectUri}?error=${E_SILO_ERROR_CODES.CONNECTION_NOT_FOUND}`);
|
||||
}
|
||||
|
||||
|
||||
if (!response.authed_user) {
|
||||
return res.redirect(`${redirectUri}?error=${E_SILO_ERROR_CODES.ERROR_FETCHING_TOKEN}`);
|
||||
}
|
||||
@@ -601,7 +606,7 @@ export default class SlackController {
|
||||
payload: payload,
|
||||
});
|
||||
|
||||
const isUUID = (id: string | null) => id && uuidValidate(id)
|
||||
const isUUID = (id: string | null) => id && uuidValidate(id);
|
||||
|
||||
if (payload.event === E_PLANE_WEBHOOK_EVENT.ISSUE_COMMENT) {
|
||||
integrationTaskManager.registerTask(
|
||||
@@ -661,7 +666,12 @@ export default class SlackController {
|
||||
},
|
||||
Number(env.DEDUP_INTERVAL)
|
||||
);
|
||||
} else if (payload.activity.field && !payload.activity.field.includes("_id") && !isUUID(payload.activity.old_value) && !isUUID(payload.activity.new_value)) {
|
||||
} else if (
|
||||
payload.activity.field &&
|
||||
!payload.activity.field.includes("_id") &&
|
||||
!isUUID(payload.activity.old_value) &&
|
||||
!isUUID(payload.activity.new_value)
|
||||
) {
|
||||
const [entityConnection] = await apiClient.workspaceEntityConnection.listWorkspaceEntityConnections({
|
||||
workspace_id: workspace,
|
||||
project_id: project,
|
||||
|
||||
@@ -22,7 +22,7 @@ export const getAccountConnectionBlocks = (details: TSlackConnectionDetails) =>
|
||||
emoji: true,
|
||||
},
|
||||
style: "primary",
|
||||
url: `${env.APP_BASE_URL}/profile/connections?workspaceId=${details.workspaceConnection.workspace_id}`,
|
||||
url: `${env.APP_BASE_URL}/${details.workspaceConnection.workspace_slug}/settings/account/connections?workspaceId=${details.workspaceConnection.workspace_id}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -118,7 +118,7 @@ export class OAuthController {
|
||||
let redirectUri = `${env.APP_BASE_URL}/${authState.workspace_slug}/settings/integrations/${provider.toLowerCase()}/`;
|
||||
|
||||
if (authState.profile_redirect) {
|
||||
redirectUri = `${env.APP_BASE_URL}/profile/connections/?workspaceId=${authState.workspace_id}`;
|
||||
redirectUri = `${env.APP_BASE_URL}/${authState.workspace_slug}/settings/account/connections/?workspaceId=${authState.workspace_id}`;
|
||||
}
|
||||
|
||||
if (userRedirectUri) {
|
||||
|
||||
@@ -48,18 +48,20 @@ const WORKSPACE_ACTION_LINKS = [
|
||||
},
|
||||
];
|
||||
|
||||
export const ProjectActionIcons = ({ type, size, className }: { type: string; size?: number; className?: string }) => {
|
||||
const ProjectActionIcons = ({ type, size, className = "" }: { type: string; size?: number; className?: string }) => {
|
||||
const icons = {
|
||||
profile: CircleUser,
|
||||
security: KeyRound,
|
||||
activity: Activity,
|
||||
appearance: Settings2,
|
||||
preferences: Settings2,
|
||||
notifications: Bell,
|
||||
connections: Blocks,
|
||||
"api-tokens": KeyRound,
|
||||
};
|
||||
|
||||
if (type === undefined) return null;
|
||||
const Icon = icons[type as keyof typeof icons];
|
||||
if (!Icon) return null;
|
||||
return <Icon size={size} className={className} />;
|
||||
};
|
||||
export const ProfileLayoutSidebar = observer(() => {
|
||||
|
||||
Reference in New Issue
Block a user