How to use the mattermost-redux/selectors/entities/general.getConfig function in mattermost-redux

To help you get started, we’ve selected a few mattermost-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattermost / mattermost-webapp / components / more_channels / index.js View on Github external
function mapStateToProps(state) {
    const team = getCurrentTeam(state) || {};

    return {
        channels: getNotArchivedOtherChannels(state) || [],
        archivedChannels: getArchivedOtherChannels(state) || [],
        currentUserId: getCurrentUserId(state),
        teamId: team.id,
        teamName: team.name,
        channelsRequestStarted: state.requests.channels.getChannels.status === RequestStatus.STARTED,
        canShowArchivedChannels: (getConfig(state).ExperimentalViewArchivedChannels === 'true'),
    };
}
github mattermost / mattermost-webapp / components / admin_console / reset_password_modal / index.js View on Github external
function mapStateToProps(state) {
    const config = getConfig(state);

    return {
        currentUserId: getCurrentUserId(state),
        passwordConfig: getPasswordConfig(config),
    };
}
github mattermost / mattermost-webapp / components / channel_view / index.js View on Github external
function mapStateToProps(state) {
    const channel = getCurrentChannel(state);

    const config = getConfig(state);
    const enableTutorial = config.EnableTutorial === 'true';
    const tutorialStep = getInt(state, Preferences.TUTORIAL_STEP, getCurrentUserId(state), TutorialSteps.FINISHED);
    const viewArchivedChannels = config.ExperimentalViewArchivedChannels === 'true';

    return {
        channelId: channel ? channel.id : '',
        deactivatedChannel: channel ? getDeactivatedChannel(state, channel.id) : false,
        showTutorial: enableTutorial && tutorialStep <= TutorialSteps.INTRO_SCREENS,
        channelIsArchived: channel ? channel.delete_at !== 0 : false,
        viewArchivedChannels,
    };
}
github mattermost / mattermost-mobile / app / components / markdown / markdown_link / index.js View on Github external
function mapStateToProps(state) {
    return {
        serverURL: getCurrentUrl(state),
        siteURL: getConfig(state).SiteURL,
    };
}
github mattermost / mattermost-mobile / app / screens / user_profile / index.js View on Github external
function mapStateToProps(state, ownProps) {
    const config = getConfig(state);
    const {createChannel: createChannelRequest} = state.requests.channels;
    const militaryTime = getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time');
    const enableTimezone = isTimezoneEnabled(state);

    return {
        config,
        createChannelRequest,
        currentDisplayName: state.views.channel.displayName,
        user: state.entities.users.profiles[ownProps.userId],
        bot: getBotAccounts(state)[ownProps.userId],
        teammateNameDisplay: getTeammateNameDisplaySetting(state),
        enableTimezone,
        militaryTime,
        theme: getTheme(state),
        isMyUser: getCurrentUserId(state) === ownProps.userId,
        isLandscape: isLandscape(state),
github mattermost / mattermost-mobile / app / utils / sentry / index.js View on Github external
const currentChannel = getCurrentChannel(state);
    if (currentChannel) {
        context.currentChannel = {
            id: currentChannel.id,
            type: currentChannel.type,
        };
    }

    const currentChannelMember = getMyCurrentChannelMembership(state);
    if (currentChannelMember) {
        context.currentChannelMember = {
            roles: currentChannelMember.roles,
        };
    }

    const config = getConfig(state);
    if (config) {
        context.config = {
            BuildDate: config.BuildDate,
            BuildEnterpriseReady: config.BuildEnterpriseReady,
            BuildHash: config.BuildHash,
            BuildHashEnterprise: config.BuildHashEnterprise,
            BuildNumber: config.BuildNumber,
        };
    }

    return context;
}
github mattermost / mattermost-webapp / components / user_settings / sidebar / index.js View on Github external
function mapStateToProps(state) {
    const config = getConfig(state);

    const closeUnusedDirectMessages = getPreference(
        state,
        Preferences.CATEGORY_SIDEBAR_SETTINGS,
        'close_unused_direct_messages',
        'after_seven_days'
    );

    const channelSwitcherOption = getPreference(
        state,
        Preferences.CATEGORY_SIDEBAR_SETTINGS,
        'channel_switcher_section',
        'true'
    );

    const sidebarPreference = getSidebarPreferences(state);
github jespino / mattermost-plugin-draw / webapp / src / actions.js View on Github external
export const getPluginServerRoute = (state) => {
    const config = getConfig(state);

    let basePath = '/';
    if (config && config.SiteURL) {
        basePath = new URL(config.SiteURL).pathname;

        if (basePath && basePath[basePath.length - 1] === '/') {
            basePath = basePath.substr(0, basePath.length - 1);
        }
    }

    return basePath + '/plugins/' + pluginId;
};
github mattermost / mattermost-webapp / components / webrtc / notification / index.js View on Github external
function mapStateToProps(state) {
    const config = getConfig(state);

    return {
        enableWebrtc: config.EnableWebrtc === 'true',
        isRhsOpen: getIsRhsOpen(state),
    };
}
github mattermost / mattermost-webapp / components / integrations / index.js View on Github external
function mapStateToProps(state) {
    const config = getConfig(state);
    const siteName = config.SiteName;
    const enableIncomingWebhooks = config.EnableIncomingWebhooks === 'true';
    const enableOutgoingWebhooks = config.EnableOutgoingWebhooks === 'true';
    const enableCommands = config.EnableCommands === 'true';
    const enableOAuthServiceProvider = config.EnableOAuthServiceProvider === 'true';

    return {
        siteName,
        enableIncomingWebhooks,
        enableOutgoingWebhooks,
        enableCommands,
        enableOAuthServiceProvider,
    };
}