Remove unneded ownProps (#1177)
This commit is contained in:
parent
e74d8c90f3
commit
c69bf5a950
26 changed files with 23 additions and 49 deletions
|
|
@ -9,11 +9,10 @@ import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|||
|
||||
import AtMention from './at_mention';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
theme: getTheme(state),
|
||||
usersByUsername: getUsersByUsername(state),
|
||||
...ownProps
|
||||
usersByUsername: getUsersByUsername(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ function mapStateToProps(state, ownProps) {
|
|||
firstName: user.first_name,
|
||||
lastName: user.last_name,
|
||||
username: user.username,
|
||||
theme: getTheme(state),
|
||||
...ownProps
|
||||
theme: getTheme(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ function mapStateToProps(state, ownProps) {
|
|||
}
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
myChannels,
|
||||
otherChannels,
|
||||
publicChannels,
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ function mapStateToProps(state, ownProps) {
|
|||
return {
|
||||
displayName: channel.display_name,
|
||||
name: channel.name,
|
||||
theme: getTheme(state),
|
||||
...ownProps
|
||||
theme: getTheme(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ const getGroupChannelMemberDetails = createSelector(
|
|||
getGroupDetails
|
||||
);
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const {currentUserId} = state.entities.users;
|
||||
|
||||
const profiles = getUsers(state);
|
||||
|
|
@ -119,8 +119,7 @@ function mapStateToProps(state, ownProps) {
|
|||
searchOrder,
|
||||
pastDirectMessages: pastDirectMessages(state),
|
||||
restrictDms,
|
||||
theme: getTheme(state),
|
||||
...ownProps
|
||||
theme: getTheme(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,9 @@ import {handleSelectChannel, setChannelDisplayName} from 'app/actions/views/chan
|
|||
|
||||
import ChannelLink from './channel_link';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
channelsByName: getChannelsNameMapInCurrentTeam(state),
|
||||
...ownProps
|
||||
channelsByName: getChannelsNameMapInCurrentTeam(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ function makeMapStateToProps() {
|
|||
return (state, ownProps) => {
|
||||
return {
|
||||
theme: getTheme(state),
|
||||
channel: getChannel(state, ownProps),
|
||||
...ownProps
|
||||
channel: getChannel(state, ownProps)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ function mapStateToProps(state, ownProps) {
|
|||
return {
|
||||
theme: getTheme(state),
|
||||
user: getUser(state, ownProps.id),
|
||||
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
||||
...ownProps
|
||||
teammateNameDisplay: getTeammateNameDisplaySetting(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'
|
|||
|
||||
import Emoji from './emoji';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
...ownProps,
|
||||
customEmojis: getCustomEmojisByName(state),
|
||||
token: state.entities.general.credentials.token
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ function mapStateToProps(state, ownProps) {
|
|||
const {deviceHeight} = getDimensions(state);
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
channelIsLoading: state.views.channel.loading,
|
||||
createPostRequestStatus: state.requests.posts.createPost.status,
|
||||
deviceHeight,
|
||||
|
|
|
|||
|
|
@ -7,10 +7,9 @@ import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|||
|
||||
import MarkdownCodeBlock from './markdown_code_block';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
theme: getTheme(state),
|
||||
...ownProps
|
||||
theme: getTheme(state)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ function mapStateToProps(state, ownProps) {
|
|||
const post = getPost(state, ownProps.postId);
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
postProps: post.props || {},
|
||||
fileIds: post.file_ids,
|
||||
hasBeenDeleted: post.state === Posts.POST_DELETED,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ function makeMapStateToProps() {
|
|||
const militaryTime = getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time');
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
commentedOnDisplayName: displayUsername(commentedOnUser, teammateNameDisplay),
|
||||
commentCount: getCommentCountForPost(state, {post}),
|
||||
createAt: post.create_at,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ function mapStateToProps(state, ownProps) {
|
|||
const post = getPost(state, ownProps.postId);
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
enablePostIconOverride: config.EnablePostIconOverride === 'true',
|
||||
fromWebHook: post.props && post.props.from_webhook === 'true',
|
||||
isSystemMessage: isSystemMessage(post),
|
||||
|
|
|
|||
|
|
@ -13,13 +13,12 @@ import {removeProtocol} from 'app/utils/url';
|
|||
|
||||
import Root from './root';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const locale = getCurrentLocale(state);
|
||||
Client.setLocale(locale);
|
||||
Client4.setAcceptLanguage(locale);
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
theme: getTheme(state),
|
||||
currentChannelId: getCurrentChannelId(state),
|
||||
currentUrl: removeProtocol(getCurrentUrl(state)),
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|||
|
||||
import StatusBar from './status_bar';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
...ownProps,
|
||||
theme: getTheme(state)
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ function mapStateToProps(state, ownProps) {
|
|||
const {createChannel: createChannelRequest} = state.requests.channels;
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
createChannelRequest,
|
||||
channelType: ownProps.channelType,
|
||||
theme: getTheme(state)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ function mapStateToProps(state, ownProps) {
|
|||
const {editPost: editPostRequest} = state.requests.posts;
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
editPostRequest,
|
||||
post: ownProps.post,
|
||||
theme: getTheme(state)
|
||||
|
|
|
|||
|
|
@ -11,11 +11,10 @@ import {checkMfa, login} from 'mattermost-redux/actions/users';
|
|||
|
||||
import Login from './login.js';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const {checkMfa: checkMfaRequest, login: loginRequest} = state.requests.users;
|
||||
const {config, license} = state.entities.general;
|
||||
return {
|
||||
...ownProps,
|
||||
...state.views.login,
|
||||
checkMfaRequest,
|
||||
loginRequest,
|
||||
|
|
|
|||
|
|
@ -7,10 +7,9 @@ import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|||
|
||||
import LoginOptions from './login_options';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const {config, license, serverVersion} = state.entities.general;
|
||||
return {
|
||||
...ownProps,
|
||||
config,
|
||||
license,
|
||||
serverVersion,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const joinableChannels = createSelector(
|
|||
}
|
||||
);
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const {currentUserId} = state.entities.users;
|
||||
const {currentTeamId} = state.entities.teams;
|
||||
const {getChannels: requestStatus} = state.requests.channels;
|
||||
|
|
@ -36,7 +36,6 @@ function mapStateToProps(state, ownProps) {
|
|||
const channels = joinableChannels(state);
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
canCreateChannels: showCreateOption(config, license, General.OPEN_CHANNEL, isAdmin(roles), isSystemAdmin(roles)),
|
||||
currentUserId,
|
||||
currentTeamId,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const getUsersForMoreDirectMessages = createSelector(
|
|||
sortAndRemoveCurrentUser
|
||||
);
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const {searchProfiles: searchRequest} = state.requests.users;
|
||||
|
||||
const config = getConfig(state);
|
||||
|
|
@ -56,7 +56,6 @@ function mapStateToProps(state, ownProps) {
|
|||
}
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
config,
|
||||
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
||||
allProfiles: getUsers(state),
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ import {getUsers} from 'mattermost-redux/selectors/entities/users';
|
|||
|
||||
import SelectedUsers from './selected_users';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
...ownProps,
|
||||
theme: getTheme(state),
|
||||
profiles: getUsers(state),
|
||||
teammateNameDisplay: getTeammateNameDisplaySetting(state)
|
||||
|
|
|
|||
|
|
@ -9,9 +9,8 @@ import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|||
|
||||
import AdvancedSettings from './advanced_settings';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
...ownProps,
|
||||
theme: getTheme(state)
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,10 @@ import {removeProtocol} from 'app/utils/url';
|
|||
|
||||
import Settings from './settings';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
const {config} = state.entities.general;
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
config,
|
||||
theme: getTheme(state),
|
||||
errors: state.errors,
|
||||
|
|
|
|||
|
|
@ -11,9 +11,8 @@ import {setStoreFromLocalData} from 'mattermost-redux/actions/general';
|
|||
|
||||
import SSO from './sso';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
...ownProps,
|
||||
...state.views.selectServer,
|
||||
theme: getTheme(state)
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue