PLT-1909 Removed the ability to edit system posts (#3013)

* Removed the ability to edit system posts

* Added increased timeout to SpinnerButton unit tests
Этот коммит содержится в:
Harrison Healey
2016-05-17 12:27:03 -04:00
коммит произвёл Christopher Speller
родитель 5580c28e54
Коммит 0fe75cb782
7 изменённых файлов: 28 добавлений и 3 удалений

Просмотреть файл

@@ -33,6 +33,7 @@ export default class PostInfo extends React.Component {
var post = this.props.post;
var isOwner = this.props.currentUser.id === post.user_id;
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || Utils.isPostEphemeral(post)) {
return '';
@@ -108,7 +109,7 @@ export default class PostInfo extends React.Component {
);
}
if (isOwner) {
if (isOwner && !isSystemMessage) {
dropdownContents.push(
<li
key='editPost'

Просмотреть файл

@@ -85,6 +85,7 @@ export default class RhsComment extends React.Component {
const isOwner = this.props.currentUser.id === post.user_id;
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
var dropdownContents = [];
@@ -107,7 +108,7 @@ export default class RhsComment extends React.Component {
);
}
if (isOwner) {
if (isOwner && !isSystemMessage) {
dropdownContents.push(
<li
role='presentation'

Просмотреть файл

@@ -41,6 +41,7 @@ export default class RhsRootPost extends React.Component {
const user = this.props.user;
var isOwner = this.props.currentUser.id === post.user_id;
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
var timestamp = UserStore.getProfile(post.user_id).update_at;
var channel = ChannelStore.get(post.channel_id);
@@ -94,7 +95,7 @@ export default class RhsRootPost extends React.Component {
);
}
if (isOwner) {
if (isOwner && !isSystemMessage) {
dropdownContents.push(
<li
key='rhs-root-edit'

Просмотреть файл

@@ -6,6 +6,7 @@ import SpinnerButton from '../components/spinner_button.jsx';
import React from 'react';
describe('SpinnerButton', function() {
this.timeout(10000);
jsdom();
it('check props', function() {