refactor: Define types for connectWithSlack and workspace display name functions in SlackIntegration and WorkspaceNotificationRuleTable

This commit is contained in:
Nawaz Dhandala
2026-02-12 19:04:36 +00:00
parent 79ab00bc29
commit 268d13786f
2 changed files with 16 additions and 4 deletions

View File

@@ -183,10 +183,16 @@ const SlackIntegration: FunctionComponent<ComponentProps> = (
return <ErrorMessage message={error} />;
}
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(
<div>

View File

@@ -419,7 +419,11 @@ const WorkspaceNotificationRuleTable: FunctionComponent<ComponentProps> = (
return <ErrorMessage message={error} />;
}
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<ComponentProps> = (
? workspaceProjectAuthTokens[0]?.id?.toString()
: undefined;
const getWorkspaceNameById = (id?: string): string => {
type GetWorkspaceNameById = (id?: string) => string;
const getWorkspaceNameById: GetWorkspaceNameById = (id?: string): string => {
if (!id) {
return "-";
}