MM-61536 - enable schmsgs feature on license upgrade (#29274)

Этот коммит содержится в:
Pablo Vélez
2024-11-15 12:44:03 +01:00
коммит произвёл GitHub
родитель ee1d6eb887
Коммит ca244b3a40
2 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@@ -13,7 +13,6 @@
} }
&__main { &__main {
position: absolute;
display: flex; display: flex;
overflow: auto; overflow: auto;
width: 100%; width: 100%;

Просмотреть файл

@@ -1,11 +1,12 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information. // 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 {ScheduledPost, ScheduledPostsState} from '@mattermost/types/schedule_post';
import type {GlobalState} from '@mattermost/types/store'; import type {GlobalState} from '@mattermost/types/store';
import {createSelector} from 'mattermost-redux/selectors/create_selector'; 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[] = []; const emptyList: string[] = [];
@@ -77,6 +78,11 @@ export function showChannelOrThreadScheduledPostIndicator(state: GlobalState, ch
return data; return data;
} }
export function isScheduledPostsEnabled(state: GlobalState) { export const isScheduledPostsEnabled: (a: GlobalState) => boolean = createSelector(
return getConfig(state).ScheduledPosts === 'true'; 'isScheduledPostsEnabled',
} getConfig,
getLicense,
(config: Partial<ClientConfig>, license: ClientLicense): boolean => {
return config.ScheduledPosts === 'true' && license.IsLicensed === 'true';
},
);