From 268d13786fa1e293e03f15245b4190192e9ad91e Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Thu, 12 Feb 2026 19:04:36 +0000 Subject: [PATCH] refactor: Define types for connectWithSlack and workspace display name functions in SlackIntegration and WorkspaceNotificationRuleTable --- Dashboard/src/Components/Slack/SlackIntegration.tsx | 10 ++++++++-- .../Workspace/WorkspaceNotificationRulesTable.tsx | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Dashboard/src/Components/Slack/SlackIntegration.tsx b/Dashboard/src/Components/Slack/SlackIntegration.tsx index 12e8884230..7239803d7e 100644 --- a/Dashboard/src/Components/Slack/SlackIntegration.tsx +++ b/Dashboard/src/Components/Slack/SlackIntegration.tsx @@ -183,10 +183,16 @@ const SlackIntegration: FunctionComponent = ( return ; } - const connectWithSlack = (data: { + interface ConnectWithSlackData { mode: "workspace" | "user"; expectedWorkspaceProjectId?: string; - }): void => { + } + + type ConnectWithSlack = (data: ConnectWithSlackData) => void; + + const connectWithSlack: ConnectWithSlack = ( + data: ConnectWithSlackData, + ): void => { if (!SlackAppClientId) { setError(
diff --git a/Dashboard/src/Components/Workspace/WorkspaceNotificationRulesTable.tsx b/Dashboard/src/Components/Workspace/WorkspaceNotificationRulesTable.tsx index 71afe9350c..875d791e43 100644 --- a/Dashboard/src/Components/Workspace/WorkspaceNotificationRulesTable.tsx +++ b/Dashboard/src/Components/Workspace/WorkspaceNotificationRulesTable.tsx @@ -419,7 +419,11 @@ const WorkspaceNotificationRuleTable: FunctionComponent = ( return ; } - const getWorkspaceDisplayName = ( + type GetWorkspaceDisplayName = ( + workspace: WorkspaceProjectAuthToken, + ) => string; + + const getWorkspaceDisplayName: GetWorkspaceDisplayName = ( workspace: WorkspaceProjectAuthToken, ): string => { if (props.workspaceType === WorkspaceType.Slack) { @@ -458,7 +462,9 @@ const WorkspaceNotificationRuleTable: FunctionComponent = ( ? workspaceProjectAuthTokens[0]?.id?.toString() : undefined; - const getWorkspaceNameById = (id?: string): string => { + type GetWorkspaceNameById = (id?: string) => string; + + const getWorkspaceNameById: GetWorkspaceNameById = (id?: string): string => { if (!id) { return "-"; }