From ca244b3a4069687503654bd421936197ebe89d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20V=C3=A9lez?= Date: Fri, 15 Nov 2024 12:44:03 +0100 Subject: [PATCH] MM-61536 - enable schmsgs feature on license upgrade (#29274) --- webapp/channels/src/components/drafts/drafts.scss | 1 - .../src/selectors/entities/scheduled_posts.ts | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/webapp/channels/src/components/drafts/drafts.scss b/webapp/channels/src/components/drafts/drafts.scss index 07c8c6ff3e..672faa174b 100644 --- a/webapp/channels/src/components/drafts/drafts.scss +++ b/webapp/channels/src/components/drafts/drafts.scss @@ -13,7 +13,6 @@ } &__main { - position: absolute; display: flex; overflow: auto; width: 100%; diff --git a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/scheduled_posts.ts b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/scheduled_posts.ts index 594642394a..3da5b8797b 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/scheduled_posts.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/scheduled_posts.ts @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ClientLicense, ClientConfig} from '@mattermost/types/config'; import type {ScheduledPost, ScheduledPostsState} from '@mattermost/types/schedule_post'; import type {GlobalState} from '@mattermost/types/store'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; -import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; const emptyList: string[] = []; @@ -77,6 +78,11 @@ export function showChannelOrThreadScheduledPostIndicator(state: GlobalState, ch return data; } -export function isScheduledPostsEnabled(state: GlobalState) { - return getConfig(state).ScheduledPosts === 'true'; -} +export const isScheduledPostsEnabled: (a: GlobalState) => boolean = createSelector( + 'isScheduledPostsEnabled', + getConfig, + getLicense, + (config: Partial, license: ClientLicense): boolean => { + return config.ScheduledPosts === 'true' && license.IsLicensed === 'true'; + }, +);