mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Define types for connectWithSlack and workspace display name functions in SlackIntegration and WorkspaceNotificationRuleTable
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 "-";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user