This commit is contained in:
David Baker 2017-08-21 19:34:07 +01:00
parent b898d15580
commit ac64e9b705
8 changed files with 17 additions and 27 deletions

View file

@ -14,12 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import MatrixClientPeg from './MatrixClientPeg';
import Modal from './Modal'; import Modal from './Modal';
import sdk from './'; import sdk from './';
import MultiInviter from './utils/MultiInviter'; import MultiInviter from './utils/MultiInviter';
import { _t } from './languageHandler'; import { _t } from './languageHandler';
import Promise from 'bluebird';
export function showGroupInviteDialog(groupId) { export function showGroupInviteDialog(groupId) {
const UserPickerDialog = sdk.getComponent("dialogs.UserPickerDialog"); const UserPickerDialog = sdk.getComponent("dialogs.UserPickerDialog");

View file

@ -362,7 +362,7 @@ export default React.createClass({
description: _t("Unable to leave room"), description: _t("Unable to leave room"),
}); });
}); });
} },
}); });
}, },
@ -500,7 +500,7 @@ export default React.createClass({
let nameNode; let nameNode;
let shortDescNode; let shortDescNode;
let roomBody; let roomBody;
let rightButtons = []; const rightButtons = [];
const headerClasses = { const headerClasses = {
mx_GroupView_header: true, mx_GroupView_header: true,
}; };
@ -548,13 +548,13 @@ export default React.createClass({
onClick={this._onSaveClick} key="_saveButton" onClick={this._onSaveClick} key="_saveButton"
> >
{_t('Save')} {_t('Save')}
</AccessibleButton> </AccessibleButton>,
); );
rightButtons.push( rightButtons.push(
<AccessibleButton className='mx_GroupView_textButton' onClick={this._onCancelClick} key="_cancelButton"> <AccessibleButton className='mx_GroupView_textButton' onClick={this._onCancelClick} key="_cancelButton">
<img src="img/cancel.svg" className='mx_filterFlipColor' <img src="img/cancel.svg" className='mx_filterFlipColor'
width="18" height="18" alt={_t("Cancel")}/> width="18" height="18" alt={_t("Cancel")}/>
</AccessibleButton> </AccessibleButton>,
); );
roomBody = <div> roomBody = <div>
<textarea className="mx_GroupView_editLongDesc" value={this.state.profileForm.long_description} <textarea className="mx_GroupView_editLongDesc" value={this.state.profileForm.long_description}
@ -596,7 +596,7 @@ export default React.createClass({
onClick={this._onEditClick} title={_t("Edit Group")} key="_editButton" onClick={this._onEditClick} title={_t("Edit Group")} key="_editButton"
> >
<TintableSvg src="img/icons-settings-room.svg" width="16" height="16"/> <TintableSvg src="img/icons-settings-room.svg" width="16" height="16"/>
</AccessibleButton> </AccessibleButton>,
); );
if (this.props.collapsedRhs) { if (this.props.collapsedRhs) {
rightButtons.push( rightButtons.push(
@ -604,7 +604,7 @@ export default React.createClass({
onClick={this._onShowRhsClick} title={ _t('Show panel') } key="_maximiseButton" onClick={this._onShowRhsClick} title={ _t('Show panel') } key="_maximiseButton"
> >
<TintableSvg src="img/maximise.svg" width="10" height="16"/> <TintableSvg src="img/maximise.svg" width="10" height="16"/>
</AccessibleButton> </AccessibleButton>,
); );
} }

View file

@ -105,7 +105,7 @@ export default React.createClass({
userId = this.props.member.userId; userId = this.props.member.userId;
} else { } else {
// we don't get this info from the API yet // we don't get this info from the API yet
avatar = <BaseAvatar name={this.props.groupMember.userId} width={36} height={36} /> avatar = <BaseAvatar name={this.props.groupMember.userId} width={36} height={36} />;
name = this.props.groupMember.userId; name = this.props.groupMember.userId;
userId = this.props.groupMember.userId; userId = this.props.groupMember.userId;
} }

View file

@ -18,8 +18,6 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import sdk from '../../../index'; import sdk from '../../../index';
import dis from '../../../dispatcher'; import dis from '../../../dispatcher';
import withMatrixClient from '../../../wrappers/withMatrixClient';
import Matrix from "matrix-js-sdk";
import AccessibleButton from '../elements/AccessibleButton'; import AccessibleButton from '../elements/AccessibleButton';
export default React.createClass({ export default React.createClass({
@ -68,5 +66,5 @@ export default React.createClass({
</div> </div>
</AccessibleButton> </AccessibleButton>
); );
} },
}); });

View file

@ -16,16 +16,11 @@ limitations under the License.
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import classNames from 'classnames';
import dis from '../../../dispatcher'; import dis from '../../../dispatcher';
import Modal from '../../../Modal'; import Modal from '../../../Modal';
import sdk from '../../../index'; import sdk from '../../../index';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
import createRoom from '../../../createRoom';
import DMRoomMap from '../../../utils/DMRoomMap';
import Unread from '../../../Unread';
import { GroupMemberType } from '../../../groups'; import { GroupMemberType } from '../../../groups';
import { findReadReceiptFromUserId } from '../../../utils/Receipt';
import { groupMemberFromApiObject } from '../../../groups'; import { groupMemberFromApiObject } from '../../../groups';
import withMatrixClient from '../../../wrappers/withMatrixClient'; import withMatrixClient from '../../../wrappers/withMatrixClient';
import AccessibleButton from '../elements/AccessibleButton'; import AccessibleButton from '../elements/AccessibleButton';
@ -46,7 +41,7 @@ module.exports = withMatrixClient(React.createClass({
fetching: false, fetching: false,
removingUser: false, removingUser: false,
members: null, members: null,
} };
}, },
componentWillMount: function() { componentWillMount: function() {
@ -81,7 +76,7 @@ module.exports = withMatrixClient(React.createClass({
this.props.matrixClient.removeUserFromGroup(this.props.groupId, this.props.member.userId).then(() => { this.props.matrixClient.removeUserFromGroup(this.props.groupId, this.props.member.userId).then(() => {
dis.dispatch({ dis.dispatch({
action: "view_user", action: "view_user",
member: null member: null,
}); });
}).catch((e) => { }).catch((e) => {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
@ -99,7 +94,7 @@ module.exports = withMatrixClient(React.createClass({
_onCancel: function(e) { _onCancel: function(e) {
dis.dispatch({ dis.dispatch({
action: "view_user", action: "view_user",
member: null member: null,
}); });
}, },
@ -124,7 +119,8 @@ module.exports = withMatrixClient(React.createClass({
} }
} }
let kickButton, adminButton; let kickButton;
let adminButton;
if (targetIsInGroup) { if (targetIsInGroup) {
kickButton = ( kickButton = (
@ -182,5 +178,5 @@ module.exports = withMatrixClient(React.createClass({
</GeminiScrollbar> </GeminiScrollbar>
</div> </div>
); );
} },
})); }));

View file

@ -145,5 +145,5 @@ export default withMatrixClient(React.createClass({
</GeminiScrollbar> </GeminiScrollbar>
</div> </div>
); );
} },
})); }));

View file

@ -18,10 +18,8 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import sdk from '../../../index'; import sdk from '../../../index';
import dis from '../../../dispatcher'; import dis from '../../../dispatcher';
import { _t } from '../../../languageHandler';
import { GroupMemberType } from '../../../groups'; import { GroupMemberType } from '../../../groups';
import withMatrixClient from '../../../wrappers/withMatrixClient'; import withMatrixClient from '../../../wrappers/withMatrixClient';
import Matrix from "matrix-js-sdk";
export default withMatrixClient(React.createClass({ export default withMatrixClient(React.createClass({
displayName: 'GroupMemberTile', displayName: 'GroupMemberTile',
@ -60,5 +58,5 @@ export default withMatrixClient(React.createClass({
name={name} powerLevel={0} suppressOnHover={true} name={name} powerLevel={0} suppressOnHover={true}
/> />
); );
} },
})); }));

View file

@ -23,5 +23,5 @@ export const GroupMemberType = PropTypes.shape({
export function groupMemberFromApiObject(apiObject) { export function groupMemberFromApiObject(apiObject) {
return { return {
userId: apiObject.user_id, userId: apiObject.user_id,
} };
} }