diff --git a/app/routes/settings.js b/app/routes/settings.js index b03a8bf0..967c98b8 100644 --- a/app/routes/settings.js +++ b/app/routes/settings.js @@ -30,9 +30,7 @@ export default function SettingsRoutes() { - {env.SLACK_KEY && ( - - )} + {isHosted && ( )} diff --git a/app/scenes/Settings/Slack.js b/app/scenes/Settings/Slack.js index 24b7b319..bc0941b0 100644 --- a/app/scenes/Settings/Slack.js +++ b/app/scenes/Settings/Slack.js @@ -39,6 +39,7 @@ function Slack() { return ( }> Slack + {error === "access_denied" && ( @@ -62,72 +63,87 @@ function Slack() { components={{ em: }} /> - - {commandIntegration ? ( - {t("Disconnect")} - ) : ( - - )} - - - - {t("Collections")} - - - Connect Outline collections to Slack channels and messages will be - automatically posted to Slack when documents are published or updated. - - - - - {collections.orderedData.map((collection) => { - const integration = find(integrations.slackIntegrations, { - collectionId: collection.id, - }); - - if (integration) { - return ( - } - subtitle={ - {{ channelName }} channel`} - values={{ channelName: integration.settings.channel }} - components={{ em: }} - /> - } - actions={ - - {t("Disconnect")} - - } + {env.SLACK_KEY ? ( + <> + + {commandIntegration ? ( + + {t("Disconnect")} + + ) : ( + - ); - } + )} + + - return ( - } - actions={ - + {t("Collections")} + + + Connect Outline collections to Slack channels and messages will be + automatically posted to Slack when documents are published or + updated. + + + + + {collections.orderedData.map((collection) => { + const integration = find(integrations.slackIntegrations, { + collectionId: collection.id, + }); + + if (integration) { + return ( + } + subtitle={ + {{ channelName }} channel`} + values={{ channelName: integration.settings.channel }} + components={{ em: }} + /> + } + actions={ + + {t("Disconnect")} + + } + /> + ); } - /> - ); - })} - + + return ( + } + actions={ + + } + /> + ); + })} + + > + ) : ( + + + The Slack integration is currently disabled. Please set the + associated environment variables and restart the server to enable + the integration. + + + )} ); }
- {commandIntegration ? ( - {t("Disconnect")} - ) : ( - - )} -
+ {commandIntegration ? ( + + {t("Disconnect")} + + ) : ( + - ); - } + )} +