Revert accidentally merged changes from mark-as-unread branch (#3405)
* Revert "Update mattermost-redux" This reverts commit04b3897ecb. * Revert "[MM-17068] Add set post as unread option to menu (#3202)" This reverts commitc7a29eea6a.
This commit is contained in:
parent
d48610407a
commit
00356ad543
13 changed files with 52 additions and 179 deletions
|
|
@ -348,11 +348,6 @@ function lastChannelViewTime(state = {}, action) {
|
|||
return state;
|
||||
}
|
||||
|
||||
case ChannelTypes.POST_UNREAD_SUCCESS: {
|
||||
const data = action.data;
|
||||
return {...state, [data.channelId]: data.lastViewedAt};
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ exports[`PostOptions should match snapshot, no option for system message to user
|
|||
>
|
||||
<ForwardRef(forwardConnectRef)
|
||||
allowStayMiddle={false}
|
||||
initialPosition={300}
|
||||
marginFromTop={300}
|
||||
initialPosition={250}
|
||||
marginFromTop={350}
|
||||
onRequestClose={[Function]}
|
||||
theme={
|
||||
Object {
|
||||
|
|
@ -44,10 +44,10 @@ exports[`PostOptions should match snapshot, no option for system message to user
|
|||
>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="reply"
|
||||
icon="edit"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Reply"
|
||||
text="Edit"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -79,44 +79,10 @@ exports[`PostOptions should match snapshot, no option for system message to user
|
|||
/>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="emoji"
|
||||
icon="reply"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Add Reaction"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
"buttonBg": "#166de0",
|
||||
"buttonColor": "#ffffff",
|
||||
"centerChannelBg": "#ffffff",
|
||||
"centerChannelColor": "#3d3c40",
|
||||
"codeTheme": "github",
|
||||
"dndIndicator": "#f74343",
|
||||
"errorTextColor": "#fd5960",
|
||||
"linkColor": "#2389d7",
|
||||
"mentionBj": "#ffffff",
|
||||
"mentionColor": "#145dbf",
|
||||
"mentionHighlightBg": "#ffe577",
|
||||
"mentionHighlightLink": "#166de0",
|
||||
"newMessageSeparator": "#ff8800",
|
||||
"onlineIndicator": "#06d6a0",
|
||||
"sidebarBg": "#145dbf",
|
||||
"sidebarHeaderBg": "#1153ab",
|
||||
"sidebarHeaderTextColor": "#ffffff",
|
||||
"sidebarText": "#ffffff",
|
||||
"sidebarTextActiveBorder": "#579eff",
|
||||
"sidebarTextActiveColor": "#ffffff",
|
||||
"sidebarTextHoverBg": "#4578bf",
|
||||
"sidebarUnreadText": "#ffffff",
|
||||
"type": "Mattermost",
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PostOption
|
||||
icon="bookmark"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Mark post as unread"
|
||||
text="Reply"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -183,10 +149,10 @@ exports[`PostOptions should match snapshot, no option for system message to user
|
|||
/>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="edit"
|
||||
icon="emoji"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Edit"
|
||||
text="Add Reaction"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -230,8 +196,8 @@ exports[`PostOptions should match snapshot, showing Delete option only for syste
|
|||
>
|
||||
<ForwardRef(forwardConnectRef)
|
||||
allowStayMiddle={false}
|
||||
initialPosition={350}
|
||||
marginFromTop={250}
|
||||
initialPosition={300}
|
||||
marginFromTop={300}
|
||||
onRequestClose={[Function]}
|
||||
theme={
|
||||
Object {
|
||||
|
|
@ -264,10 +230,10 @@ exports[`PostOptions should match snapshot, showing Delete option only for syste
|
|||
>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="reply"
|
||||
icon="edit"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Reply"
|
||||
text="Edit"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -299,44 +265,10 @@ exports[`PostOptions should match snapshot, showing Delete option only for syste
|
|||
/>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="emoji"
|
||||
icon="reply"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Add Reaction"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
"buttonBg": "#166de0",
|
||||
"buttonColor": "#ffffff",
|
||||
"centerChannelBg": "#ffffff",
|
||||
"centerChannelColor": "#3d3c40",
|
||||
"codeTheme": "github",
|
||||
"dndIndicator": "#f74343",
|
||||
"errorTextColor": "#fd5960",
|
||||
"linkColor": "#2389d7",
|
||||
"mentionBj": "#ffffff",
|
||||
"mentionColor": "#145dbf",
|
||||
"mentionHighlightBg": "#ffe577",
|
||||
"mentionHighlightLink": "#166de0",
|
||||
"newMessageSeparator": "#ff8800",
|
||||
"onlineIndicator": "#06d6a0",
|
||||
"sidebarBg": "#145dbf",
|
||||
"sidebarHeaderBg": "#1153ab",
|
||||
"sidebarHeaderTextColor": "#ffffff",
|
||||
"sidebarText": "#ffffff",
|
||||
"sidebarTextActiveBorder": "#579eff",
|
||||
"sidebarTextActiveColor": "#ffffff",
|
||||
"sidebarTextHoverBg": "#4578bf",
|
||||
"sidebarUnreadText": "#ffffff",
|
||||
"type": "Mattermost",
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PostOption
|
||||
icon="bookmark"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Mark post as unread"
|
||||
text="Reply"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -403,10 +335,10 @@ exports[`PostOptions should match snapshot, showing Delete option only for syste
|
|||
/>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="edit"
|
||||
icon="emoji"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Edit"
|
||||
text="Add Reaction"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -485,8 +417,8 @@ exports[`PostOptions should match snapshot, showing all possible options 1`] = `
|
|||
>
|
||||
<ForwardRef(forwardConnectRef)
|
||||
allowStayMiddle={false}
|
||||
initialPosition={350}
|
||||
marginFromTop={250}
|
||||
initialPosition={300}
|
||||
marginFromTop={300}
|
||||
onRequestClose={[Function]}
|
||||
theme={
|
||||
Object {
|
||||
|
|
@ -519,10 +451,10 @@ exports[`PostOptions should match snapshot, showing all possible options 1`] = `
|
|||
>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="reply"
|
||||
icon="edit"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Reply"
|
||||
text="Edit"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -554,44 +486,10 @@ exports[`PostOptions should match snapshot, showing all possible options 1`] = `
|
|||
/>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="emoji"
|
||||
icon="reply"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Add Reaction"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
"buttonBg": "#166de0",
|
||||
"buttonColor": "#ffffff",
|
||||
"centerChannelBg": "#ffffff",
|
||||
"centerChannelColor": "#3d3c40",
|
||||
"codeTheme": "github",
|
||||
"dndIndicator": "#f74343",
|
||||
"errorTextColor": "#fd5960",
|
||||
"linkColor": "#2389d7",
|
||||
"mentionBj": "#ffffff",
|
||||
"mentionColor": "#145dbf",
|
||||
"mentionHighlightBg": "#ffe577",
|
||||
"mentionHighlightLink": "#166de0",
|
||||
"newMessageSeparator": "#ff8800",
|
||||
"onlineIndicator": "#06d6a0",
|
||||
"sidebarBg": "#145dbf",
|
||||
"sidebarHeaderBg": "#1153ab",
|
||||
"sidebarHeaderTextColor": "#ffffff",
|
||||
"sidebarText": "#ffffff",
|
||||
"sidebarTextActiveBorder": "#579eff",
|
||||
"sidebarTextActiveColor": "#ffffff",
|
||||
"sidebarTextHoverBg": "#4578bf",
|
||||
"sidebarUnreadText": "#ffffff",
|
||||
"type": "Mattermost",
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PostOption
|
||||
icon="bookmark"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Mark post as unread"
|
||||
text="Reply"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
@ -658,10 +556,10 @@ exports[`PostOptions should match snapshot, showing all possible options 1`] = `
|
|||
/>
|
||||
<PostOption
|
||||
destructive={false}
|
||||
icon="edit"
|
||||
icon="emoji"
|
||||
isLandscape={false}
|
||||
onPress={[Function]}
|
||||
text="Edit"
|
||||
text="Add Reaction"
|
||||
theme={
|
||||
Object {
|
||||
"awayIndicator": "#ffbc42",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
unflagPost,
|
||||
unpinPost,
|
||||
removePost,
|
||||
setUnreadPost,
|
||||
} from 'mattermost-redux/actions/posts';
|
||||
import {General, Permissions} from 'mattermost-redux/constants';
|
||||
import {getChannel, getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels';
|
||||
|
|
@ -107,7 +106,6 @@ export function mapStateToProps(state, ownProps) {
|
|||
canFlag,
|
||||
canPin,
|
||||
currentTeamUrl: getCurrentTeamUrl(state),
|
||||
currentUserId: getCurrentUserId(state),
|
||||
isMyPost: currentUserId === post.user_id,
|
||||
theme: getTheme(state),
|
||||
isLandscape: isLandscape(state),
|
||||
|
|
@ -124,7 +122,6 @@ function mapDispatchToProps(dispatch) {
|
|||
removePost,
|
||||
unflagPost,
|
||||
unpinPost,
|
||||
setUnreadPost,
|
||||
}, dispatch),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import link from 'assets/images/post_menu/link.png';
|
|||
import pin from 'assets/images/post_menu/pin.png';
|
||||
import trash from 'assets/images/post_menu/trash.png';
|
||||
import reply from 'assets/images/post_menu/reply.png';
|
||||
import bookmark from 'assets/images/post_menu/bookmark.png';
|
||||
|
||||
const icons = {
|
||||
copy,
|
||||
|
|
@ -34,7 +33,6 @@ const icons = {
|
|||
pin,
|
||||
trash,
|
||||
reply,
|
||||
bookmark,
|
||||
};
|
||||
|
||||
export default class PostOption extends PureComponent {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import {BOTTOM_MARGIN} from 'app/components/slide_up_panel/slide_up_panel';
|
|||
import {t} from 'app/utils/i18n';
|
||||
import {showModal, dismissModal} from 'app/actions/navigation';
|
||||
|
||||
import {isSystemMessage} from 'mattermost-redux/utils/post_utils';
|
||||
import {OPTION_HEIGHT, getInitialPosition} from './post_options_utils';
|
||||
import PostOption from './post_option';
|
||||
|
||||
|
|
@ -28,7 +27,6 @@ export default class PostOptions extends PureComponent {
|
|||
removePost: PropTypes.func.isRequired,
|
||||
unflagPost: PropTypes.func.isRequired,
|
||||
unpinPost: PropTypes.func.isRequired,
|
||||
setUnreadPost: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
canAddReaction: PropTypes.bool,
|
||||
canReply: PropTypes.bool,
|
||||
|
|
@ -40,7 +38,6 @@ export default class PostOptions extends PureComponent {
|
|||
canEdit: PropTypes.bool,
|
||||
canEditUntil: PropTypes.number.isRequired,
|
||||
currentTeamUrl: PropTypes.string.isRequired,
|
||||
currentUserId: PropTypes.string.isRequired,
|
||||
deviceHeight: PropTypes.number.isRequired,
|
||||
isFlagged: PropTypes.bool,
|
||||
isMyPost: PropTypes.bool,
|
||||
|
|
@ -227,34 +224,29 @@ export default class PostOptions extends PureComponent {
|
|||
return this.getOption(key, icon, message, onPress);
|
||||
};
|
||||
|
||||
getMarkAsUnreadOption = () => {
|
||||
const {post, isLandscape, theme} = this.props;
|
||||
const {formatMessage} = this.context.intl;
|
||||
getMyPostOptions = () => {
|
||||
const actions = [
|
||||
this.getEditOption(),
|
||||
this.getReplyOption(),
|
||||
this.getFlagOption(),
|
||||
this.getPinOption(),
|
||||
this.getAddReactionOption(),
|
||||
this.getCopyPermalink(),
|
||||
this.getCopyText(),
|
||||
this.getDeleteOption(),
|
||||
];
|
||||
|
||||
if (!isSystemMessage(post)) {
|
||||
return (
|
||||
<PostOption
|
||||
key='markUnread'
|
||||
icon='bookmark'
|
||||
text={formatMessage({id: 'mobile.post_info.mark_unread', defaultMessage: 'Mark post as unread'})}
|
||||
onPress={this.handleMarkUnread}
|
||||
isLandscape={isLandscape}
|
||||
theme={theme}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
return actions.filter((a) => a !== null);
|
||||
};
|
||||
|
||||
getPostOptions = () => {
|
||||
getOthersPostOptions = () => {
|
||||
const actions = [
|
||||
this.getReplyOption(),
|
||||
this.getAddReactionOption(),
|
||||
this.getMarkAsUnreadOption(),
|
||||
this.getCopyPermalink(),
|
||||
this.getFlagOption(),
|
||||
this.getCopyText(),
|
||||
this.getAddReactionOption(),
|
||||
this.getPinOption(),
|
||||
this.getCopyPermalink(),
|
||||
this.getCopyText(),
|
||||
this.getEditOption(),
|
||||
this.getDeleteOption(),
|
||||
];
|
||||
|
|
@ -262,6 +254,12 @@ export default class PostOptions extends PureComponent {
|
|||
return actions.filter((a) => a !== null);
|
||||
};
|
||||
|
||||
getPostOptions = () => {
|
||||
const {isMyPost} = this.props;
|
||||
|
||||
return isMyPost ? this.getMyPostOptions() : this.getOthersPostOptions();
|
||||
};
|
||||
|
||||
handleAddReaction = () => {
|
||||
const {theme} = this.props;
|
||||
const {formatMessage} = this.context.intl;
|
||||
|
|
@ -326,15 +324,6 @@ export default class PostOptions extends PureComponent {
|
|||
});
|
||||
};
|
||||
|
||||
handleMarkUnread = () => {
|
||||
const {actions, post, currentUserId} = this.props;
|
||||
|
||||
this.closeWithAnimation();
|
||||
requestAnimationFrame(() => {
|
||||
actions.setUnreadPost(currentUserId, post.id);
|
||||
});
|
||||
}
|
||||
|
||||
handlePostDelete = () => {
|
||||
const {formatMessage} = this.context.intl;
|
||||
const {actions, post} = this.props;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ describe('PostOptions', () => {
|
|||
removePost: jest.fn(),
|
||||
unflagPost: jest.fn(),
|
||||
unpinPost: jest.fn(),
|
||||
setUnreadPost: jest.fn(),
|
||||
};
|
||||
|
||||
const post = {
|
||||
|
|
@ -47,7 +46,6 @@ describe('PostOptions', () => {
|
|||
canEditUntil: -1,
|
||||
channelIsReadOnly: false,
|
||||
currentTeamUrl: 'http://localhost:8065/team-name',
|
||||
currentUserId: 'user1',
|
||||
deviceHeight: 600,
|
||||
hasBeenDeleted: false,
|
||||
isFlagged: false,
|
||||
|
|
|
|||
|
|
@ -360,7 +360,6 @@
|
|||
"mobile.post_info.add_reaction": "Add Reaction",
|
||||
"mobile.post_info.copy_text": "Copy Text",
|
||||
"mobile.post_info.flag": "Flag",
|
||||
"mobile.post_info.mark_unread": "Mark post as unread",
|
||||
"mobile.post_info.pin": "Pin to Channel",
|
||||
"mobile.post_info.reply": "Reply",
|
||||
"mobile.post_info.unflag": "Unflag",
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 669 B |
Binary file not shown.
|
Before Width: | Height: | Size: 840 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1,023 B |
10
package-lock.json
generated
10
package-lock.json
generated
|
|
@ -14133,8 +14133,8 @@
|
|||
"integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A=="
|
||||
},
|
||||
"mattermost-redux": {
|
||||
"version": "github:mattermost/mattermost-redux#dc5f8c1f30cbc6a25d4304f2923f5b78e674099d",
|
||||
"from": "github:mattermost/mattermost-redux#dc5f8c1f30cbc6a25d4304f2923f5b78e674099d",
|
||||
"version": "github:mattermost/mattermost-redux#3bb89a5450b94da564d3a286fefb5945a1c3fca8",
|
||||
"from": "github:mattermost/mattermost-redux#3bb89a5450b94da564d3a286fefb5945a1c3fca8",
|
||||
"requires": {
|
||||
"deep-equal": "1.0.1",
|
||||
"eslint-plugin-header": "3.0.0",
|
||||
|
|
@ -14147,7 +14147,7 @@
|
|||
"redux": "4.0.4",
|
||||
"redux-action-buffer": "1.2.0",
|
||||
"redux-batched-actions": "0.4.1",
|
||||
"redux-offline": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df",
|
||||
"redux-offline": "git+https://github.com/enahum/redux-offline.git#4bd85e7e3b279a2b11fb4d587808d583d2b5e7b5",
|
||||
"redux-persist": "4.9.1",
|
||||
"redux-thunk": "2.3.0",
|
||||
"reselect": "4.0.0",
|
||||
|
|
@ -17575,8 +17575,8 @@
|
|||
}
|
||||
},
|
||||
"redux-offline": {
|
||||
"version": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df",
|
||||
"from": "git+https://github.com/enahum/redux-offline.git#885024de96b6ec73650c340c8928066585c413df",
|
||||
"version": "git+https://github.com/enahum/redux-offline.git#4bd85e7e3b279a2b11fb4d587808d583d2b5e7b5",
|
||||
"from": "git+https://github.com/enahum/redux-offline.git#4bd85e7e3b279a2b11fb4d587808d583d2b5e7b5",
|
||||
"requires": {
|
||||
"@react-native-community/netinfo": "^4.1.3",
|
||||
"redux-persist": "^4.5.0"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
"intl": "1.2.5",
|
||||
"jail-monkey": "2.2.0",
|
||||
"jsc-android": "241213.2.0",
|
||||
"mattermost-redux": "github:mattermost/mattermost-redux#dc5f8c1f30cbc6a25d4304f2923f5b78e674099d",
|
||||
"mattermost-redux": "github:mattermost/mattermost-redux#3bb89a5450b94da564d3a286fefb5945a1c3fca8",
|
||||
"mime-db": "1.40.0",
|
||||
"moment-timezone": "0.5.25",
|
||||
"prop-types": "15.7.2",
|
||||
|
|
|
|||
|
|
@ -303,7 +303,6 @@ module.exports = [
|
|||
'dist/assets/images/icons/word.png',
|
||||
'dist/assets/images/post_header/flag.png',
|
||||
'dist/assets/images/post_header/pin.png',
|
||||
'dist/assets/images/post_header/bookmark.png',
|
||||
'dist/assets/images/profile.jpg',
|
||||
'dist/assets/images/status/away.png',
|
||||
'dist/assets/images/status/dnd.png',
|
||||
|
|
|
|||
Loading…
Reference in a new issue