Bug 1212348 - Loop's RoomList view requires user profile data passed in when it doesn't need to. r=mikedeboer

This commit is contained in:
Mark Banner 2015-10-08 11:30:06 +01:00
Родитель bc83c52931
Коммит 93963ee2bc
2 изменённых файлов: 8 добавлений и 28 удалений

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

@ -668,9 +668,7 @@ loop.panel = (function(_, mozL10n) {
propTypes: { propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired, mozLoop: React.PropTypes.object.isRequired,
store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired, store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired
// Used for room creation, associated with room owner.
userProfile: userProfileValidator
}, },
getInitialState: function() { getInitialState: function() {
@ -703,11 +701,6 @@ loop.panel = (function(_, mozL10n) {
this.setState(this.props.store.getStoreState()); this.setState(this.props.store.getStoreState());
}, },
_getUserDisplayName: function() {
return this.props.userProfile && this.props.userProfile.email ||
mozL10n.get("display_name_guest");
},
/** /**
* Let the user know we're loading rooms * Let the user know we're loading rooms
* @returns {Object} React render * @returns {Object} React render
@ -746,8 +739,7 @@ loop.panel = (function(_, mozL10n) {
React.createElement(NewRoomView, {dispatcher: this.props.dispatcher, React.createElement(NewRoomView, {dispatcher: this.props.dispatcher,
mozLoop: this.props.mozLoop, mozLoop: this.props.mozLoop,
pendingOperation: this.state.pendingCreation || pendingOperation: this.state.pendingCreation ||
this.state.pendingInitialRetrieval, this.state.pendingInitialRetrieval})
userDisplayName: this._getUserDisplayName()})
); );
}, },
@ -792,8 +784,7 @@ loop.panel = (function(_, mozL10n) {
propTypes: { propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired, mozLoop: React.PropTypes.object.isRequired,
pendingOperation: React.PropTypes.bool.isRequired, pendingOperation: React.PropTypes.bool.isRequired
userDisplayName: React.PropTypes.string.isRequired
}, },
mixins: [ mixins: [
@ -1002,8 +993,7 @@ loop.panel = (function(_, mozL10n) {
notifications: this.props.notifications}), notifications: this.props.notifications}),
React.createElement(RoomList, {dispatcher: this.props.dispatcher, React.createElement(RoomList, {dispatcher: this.props.dispatcher,
mozLoop: this.props.mozLoop, mozLoop: this.props.mozLoop,
store: this.props.roomStore, store: this.props.roomStore}),
userProfile: this.state.userProfile}),
React.createElement("div", {className: "footer"}, React.createElement("div", {className: "footer"},
React.createElement("div", {className: "user-details"}, React.createElement("div", {className: "user-details"},
React.createElement(AvailabilityDropdown, null) React.createElement(AvailabilityDropdown, null)

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

@ -668,9 +668,7 @@ loop.panel = (function(_, mozL10n) {
propTypes: { propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired, mozLoop: React.PropTypes.object.isRequired,
store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired, store: React.PropTypes.instanceOf(loop.store.RoomStore).isRequired
// Used for room creation, associated with room owner.
userProfile: userProfileValidator
}, },
getInitialState: function() { getInitialState: function() {
@ -703,11 +701,6 @@ loop.panel = (function(_, mozL10n) {
this.setState(this.props.store.getStoreState()); this.setState(this.props.store.getStoreState());
}, },
_getUserDisplayName: function() {
return this.props.userProfile && this.props.userProfile.email ||
mozL10n.get("display_name_guest");
},
/** /**
* Let the user know we're loading rooms * Let the user know we're loading rooms
* @returns {Object} React render * @returns {Object} React render
@ -746,8 +739,7 @@ loop.panel = (function(_, mozL10n) {
<NewRoomView dispatcher={this.props.dispatcher} <NewRoomView dispatcher={this.props.dispatcher}
mozLoop={this.props.mozLoop} mozLoop={this.props.mozLoop}
pendingOperation={this.state.pendingCreation || pendingOperation={this.state.pendingCreation ||
this.state.pendingInitialRetrieval} this.state.pendingInitialRetrieval} />
userDisplayName={this._getUserDisplayName()} />
); );
}, },
@ -792,8 +784,7 @@ loop.panel = (function(_, mozL10n) {
propTypes: { propTypes: {
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
mozLoop: React.PropTypes.object.isRequired, mozLoop: React.PropTypes.object.isRequired,
pendingOperation: React.PropTypes.bool.isRequired, pendingOperation: React.PropTypes.bool.isRequired
userDisplayName: React.PropTypes.string.isRequired
}, },
mixins: [ mixins: [
@ -1002,8 +993,7 @@ loop.panel = (function(_, mozL10n) {
notifications={this.props.notifications} /> notifications={this.props.notifications} />
<RoomList dispatcher={this.props.dispatcher} <RoomList dispatcher={this.props.dispatcher}
mozLoop={this.props.mozLoop} mozLoop={this.props.mozLoop}
store={this.props.roomStore} store={this.props.roomStore} />
userProfile={this.state.userProfile} />
<div className="footer"> <div className="footer">
<div className="user-details"> <div className="user-details">
<AvailabilityDropdown /> <AvailabilityDropdown />