live settings availability check has been added

This commit is contained in:
Yulia Shanyrova 2022-11-02 10:30:00 +01:00
parent ca6f7ef691
commit fd55acfea4
3 changed files with 15 additions and 7 deletions

View file

@ -2,10 +2,12 @@ import React from 'react';
import PluginLink from 'components/PluginLink/PluginLink';
import { Team } from 'models/team/team.types';
import { RootStore } from 'state';
import { AppFeature } from 'state/features';
import { SlackError } from './DefaultPageLayout.types';
export function getSlackMessage(slackError: SlackError, team: Team) {
export function getSlackMessage(slackError: SlackError, team: Team, store: RootStore) {
if (slackError === SlackError.WRONG_WORKSPACE) {
return (
<>
@ -30,8 +32,12 @@ export function getSlackMessage(slackError: SlackError, team: Team) {
return (
<>
An error has occurred with Slack authentication.{' '}
<PluginLink query={{ page: 'live-settings' }}>Check ENV variables</PluginLink> related to Slack and try again
please.
{store.hasFeature(AppFeature.LiveSettings) && (
<>
<PluginLink query={{ page: 'live-settings' }}>Check ENV variables</PluginLink> related to Slack and try
again please.
</>
)}
</>
);
}

View file

@ -79,7 +79,7 @@ const DefaultPageLayout: FC<DefaultPageLayoutProps> = observer((props) => {
// @ts-ignore
title="Slack integration warning"
>
{getSlackMessage(showSlackInstallAlert, store.teamStore.currentTeam)}
{getSlackMessage(showSlackInstallAlert, store.teamStore.currentTeam, store)}
</Alert>
)}
{currentTeam?.banner.title != null && !getItem(currentTeam?.banner.title) && (

View file

@ -95,9 +95,11 @@ const TelegramInfo = observer((_props: TelegramInfoProps) => {
</Text>
</VerticalGroup>
</Block>
<PluginLink query={{ page: 'live-settings' }}>
<Button variant="primary">Setup ENV Variables</Button>
</PluginLink>
{store.hasFeature(AppFeature.LiveSettings) && (
<PluginLink query={{ page: 'live-settings' }}>
<Button variant="primary">Setup ENV Variables</Button>
</PluginLink>
)}
</VerticalGroup>
)}
</>