How to use the mattermost-redux/selectors/entities/teams.getCurrentTeam 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 / stores / team_store.jsx View on Github external
getCurrent() {
        const team = Selectors.getCurrentTeam(store.getState());

        if (team) {
            return team;
        }

        return null;
    }
github mattermost / mattermost-mobile / app / scenes / channel_add_members / channel_add_members_container.js View on Github external
function mapStateToProps(state) {
    const currentTeamMemberCount = getCurrentTeamStats(state) && getCurrentTeamStats(state).total_member_count;
    const currentChannelMemberCount = getCurrentChannelStats(state) && getCurrentChannelStats(state).member_count;

    return {
        theme: getTheme(state),
        currentChannel: getCurrentChannel(state),
        membersNotInChannel: getProfilesNotInCurrentChannel(state),
        currentTeam: getCurrentTeam(state),
        currentTeamMemberCount,
        currentChannelMemberCount,
        preferences: getMyPreferences(state),
        loadMoreRequestStatus: state.requests.users.getProfilesNotInChannel.status,
        addChannelMemberRequestStatus: state.requests.channels.addChannelMember,
        searchRequestStatus: state.requests.users.searchProfiles.status,
        addChannelMemberStatus: state.requests.channels.addChannelMember.status
    };
}
github mattermost / mattermost-webapp / components / invite_member_modal / index.js View on Github external
function mapStateToProps(state) {
    const config = getConfig(state);

    const enableUserCreation = config.EnableUserCreation === 'true';

    const defaultChannel = getChannelsNameMapInCurrentTeam(state)[Constants.DEFAULT_CHANNEL];
    const team = getCurrentTeam(state);

    return {
        enableUserCreation,
        currentUser: getCurrentUser(state),
        defaultChannelName: defaultChannel ? defaultChannel.display_name : '',
        teamType: team ? team.type : '',
        teamId: team ? team.id : '',
    };
}
github mattermost / mattermost-mobile / app / components / sidebars / main / channels_list / filtered_list / index.js View on Github external
function mapStateToProps(state) {
    const {currentUserId} = state.entities.users;

    const profiles = getUsers(state);
    let teamProfiles = {};
    const restrictDms = getConfig(state).RestrictDirectMessage !== General.RESTRICT_DIRECT_MESSAGE_ANY;
    if (restrictDms) {
        teamProfiles = getTeamProfiles(state);
    }

    const searchOrder = Config.DrawerSearchOrder ? Config.DrawerSearchOrder : DEFAULT_SEARCH_ORDER;

    return {
        channels: getChannelsWithUnreadSection(state),
        currentChannel: getCurrentChannel(state),
        currentTeam: getCurrentTeam(state),
        currentUserId,
        otherChannels: getOtherChannels(state, false),
        archivedChannels: getArchivedChannels(state),
        groupChannelMemberDetails: getGroupChannelMemberDetails(state),
        profiles,
        teamProfiles,
        teammateNameDisplay: getTeammateNameDisplaySetting(state),
        statuses: getUserStatuses(state),
        searchOrder,
        pastDirectMessages: pastDirectMessages(state),
        restrictDms,
        theme: getTheme(state),
        isLandscape: isLandscape(state),
    };
}
github mattermost / mattermost-mobile / app / scenes / load_team / load_team_container.js View on Github external
function mapStateToProps(state) {
    return {
        config: state.entities.general.config,
        theme: getTheme(state),
        teamsRequest: state.requests.teams.allTeams,
        teams: state.entities.teams.teams,
        currentTeam: getCurrentTeam(state),
        myMembers: state.entities.teams.myMembers,
        notification: state.views.notification
    };
}
github mattermost / mattermost-webapp / components / create_team / index.js View on Github external
function mapStateToProps(state) {
    const config = getConfig(state);
    const license = getLicense(state);
    const currentChannel = getCurrentChannel(state);
    const currentTeam = getCurrentTeam(state);

    const isLicensed = license.IsLicensed === 'true';
    const customBrand = license.CustomBrand === 'true';
    const enableCustomBrand = config.EnableCustomBrand === 'true';
    const customDescriptionText = config.CustomDescriptionText;
    const siteName = config.SiteName;

    return {
        currentChannel,
        currentTeam,
        isLicensed,
        customBrand,
        enableCustomBrand,
        customDescriptionText,
        siteName,
    };
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 / permalink_view / index.js View on Github external
function mapStateToProps(state) {
    const team = getCurrentTeam(state);
    const channel = getCurrentChannel(state);
    let channelId = '';
    let channelName = '';
    let channelIsArchived;
    if (channel) {
        channelId = channel.id;
        channelName = channel.name;
        channelIsArchived = channel.delete_at !== 0;
    }

    let teamName = '';
    if (team) {
        teamName = team.name;
    }

    return {
github mattermost / mattermost-webapp / components / search_results_item / index.js View on Github external
return (state, ownProps) => {
        const config = getConfig(state);
        const preferences = getMyPreferences(state);
        const enablePostUsernameOverride = config.EnablePostUsernameOverride === 'true';
        const {post} = ownProps;
        const user = getUser(state, post.user_id);
        const channel = getChannel(state, post.channel_id) || {delete_at: 0};

        return {
            createAriaLabel: createAriaLabelForPost(state, post),
            channelId: channel.id,
            channelName: channel.display_name,
            channelType: channel.type,
            channelIsArchived: channel.delete_at !== 0,
            currentTeamName: getCurrentTeam(state).name,
            commentCountForPost: getCommentCountForPost(state, {post}),
            enablePostUsernameOverride,
            isFlagged: isPostFlagged(post.id, preferences),
            isBot: user ? user.is_bot : false,
        };
    };
}
github mattermost / mattermost-mobile / app / utils / sentry / index.js View on Github external
function getExtraContext(state) {
    const context = {};

    const currentTeam = getCurrentTeam(state);
    if (currentTeam) {
        context.currentTeam = {
            id: currentTeam.id,
        };
    }

    const currentTeamMember = getCurrentTeamMembership(state);
    if (currentTeamMember) {
        context.currentTeamMember = {
            roles: currentTeamMember.roles,
        };
    }

    const currentChannel = getCurrentChannel(state);
    if (currentChannel) {
        context.currentChannel = {