Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function mapStateToProps(state, ownProps) {
const license = getLicense(state);
const config = getConfig(state);
const isLicensed = license && license.IsLicensed === 'true';
const enableOpenServer = config.EnableOpenServer === 'true';
const noAccounts = config.NoAccounts === 'true';
const enableSignUpWithEmail = config.EnableSignUpWithEmail === 'true';
const enableSignUpWithGitLab = config.EnableSignUpWithGitLab === 'true';
const enableSignUpWithGoogle = config.EnableSignUpWithGoogle === 'true';
const enableSignUpWithOffice365 = config.EnableSignUpWithOffice365 === 'true';
const enableLDAP = config.EnableLdap === 'true';
const enableSAML = config.EnableSaml === 'true';
const samlLoginButtonText = config.SamlLoginButtonText;
const ldapLoginFieldName = config.LdapLoginFieldName;
const siteName = config.SiteName;
let usedBefore;
function mapStateToProps(state) {
const license = getLicense(state);
const config = getConfig(state);
const team = getCurrentTeam(state);
const teamChannels = getChannelsNameMapInCurrentTeam(state);
const townSquare = teamChannels[Constants.DEFAULT_CHANNEL];
const townSquareDisplayName = townSquare ? townSquare.display_name : Constants.DEFAULT_CHANNEL_UI_NAME;
const appDownloadLink = config.AppDownloadLink;
const isLicensed = license.IsLicensed === 'true';
const restrictTeamInvite = !haveITeamPermission(state, {team: team.id, permission: Permissions.INVITE_USER});
const supportEmail = config.SupportEmail;
return {
townSquareDisplayName,
appDownloadLink,
function mapStateToProps(state) {
const config = getConfig(state);
const license = getLicense(state);
const {announcement} = state.views;
return {
bannerColor: config.BannerColor,
bannerDismissed: config.BannerText === announcement,
bannerEnabled: config.EnableBanner === 'true' && license.IsLicensed === 'true',
bannerText: config.BannerText,
bannerTextColor: config.BannerTextColor || '#000',
theme: getTheme(state),
isLandscape: isLandscape(state),
};
}
function mapStateToProps(state) {
const modalId = ModalIdentifiers.ABOUT;
return {
config: getConfig(state),
license: getLicense(state),
show: isModalOpen(state, modalId),
};
}
function mapStateToProps(state, ownProps) {
const license = getLicense(state);
const config = getConfig(state);
const currentUser = getCurrentUser(state);
return {
theme: getTheme(state),
mfaRequired: checkIfMFARequired(currentUser, license, config, ownProps.match.url),
currentUser,
currentTeamId: getCurrentTeamId(state),
teamsList: getMyTeams(state),
currentChannelId: getCurrentChannelId(state),
};
}
export function isLicenseExpiring() {
const license = getLicense(store.getState());
if (license.IsLicensed !== 'true') {
return false;
}
const timeDiff = parseInt(license.ExpiresAt, 10) - Date.now();
return timeDiff <= LICENSE_EXPIRY_NOTIFICATION;
}
function mapStateToProps(state) {
return {
config: getConfig(state),
license: getLicense(state),
roles: getRoles(state),
rolesRequest: state.requests.roles.getRolesByNames,
};
}
function mapStateToProps(state) {
const config = getConfig(state);
const license = getLicense(state);
const isLicensed = license.IsLicensed === 'true';
const customBrandText = config.CustomBrandText;
const customDescriptionText = config.CustomDescriptionText;
const enableCustomBrand = config.EnableCustomBrand === 'true';
const enableLdap = config.EnableLdap === 'true';
const enableOpenServer = config.EnableOpenServer === 'true';
const enableSaml = config.EnableSaml === 'true';
const enableSignInWithEmail = config.EnableSignInWithEmail === 'true';
const enableSignInWithUsername = config.EnableSignInWithUsername === 'true';
const enableSignUpWithEmail = config.EnableSignUpWithEmail === 'true';
const enableSignUpWithGitLab = config.EnableSignUpWithGitLab === 'true';
const enableSignUpWithGoogle = config.EnableSignUpWithGoogle === 'true';
const enableSignUpWithOffice365 = config.EnableSignUpWithOffice365 === 'true';
const ldapLoginFieldName = config.LdapLoginFieldName;
function mapStateToProps(state) {
const license = getLicense(state);
const isLicensed = license.IsLicensed === 'true';
return {
isLicensed,
stats: state.entities.admin.analytics,
};
}
function mapStateToProps(state, ownProps) {
const license = getLicense(state);
const config = getConfig(state);
const showTermsOfService = shouldShowTermsOfService(state);
return {
currentUser: getCurrentUser(state),
currentChannelId: getCurrentChannelId(state),
mfaRequired: checkIfMFARequired(getCurrentUser(state), license, config, ownProps.match.url),
enableTimezone: config.ExperimentalTimezone === 'true',
showTermsOfService,
};
}