forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
42 lines (36 loc) · 1.54 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles';
import {Permissions} from 'mattermost-redux/constants';
import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general';
import AnnouncementBar from './announcement_bar.jsx';
function mapStateToProps(state) {
const canViewSystemErrors = haveISystemPermission(state, {permission: Permissions.MANAGE_SYSTEM});
const license = getLicense(state);
const config = getConfig(state);
const licenseId = license.Id;
const siteURL = config.SiteURL;
const sendEmailNotifications = config.SendEmailNotifications === 'true';
const bannerText = config.BannerText;
const allowBannerDismissal = config.AllowBannerDismissal === 'true';
const enableBanner = config.EnableBanner === 'true';
const bannerColor = config.BannerColor;
const bannerTextColor = config.BannerTextColor;
const enableSignUpWithGitLab = config.EnableSignUpWithGitLab === 'true';
return {
isLoggedIn: Boolean(getCurrentUserId(state)),
canViewSystemErrors,
licenseId,
siteURL,
sendEmailNotifications,
bannerText,
allowBannerDismissal,
enableBanner,
bannerColor,
bannerTextColor,
enableSignUpWithGitLab
};
}
export default connect(mapStateToProps)(AnnouncementBar);