From b59106912a0c47ca3dc8949c280fe43a6cb63bca Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Thu, 14 Dec 2017 09:31:05 -0800 Subject: [PATCH] fix console warnings --- .../actions-dropdown/component.jsx | 18 ++++++++++++------ .../ui/components/dropdown/list/component.jsx | 14 +++++++++----- .../ui/components/user-list/container.jsx | 19 +------------------ .../user-list-content/component.jsx | 11 ++++++----- 4 files changed, 28 insertions(+), 34 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx index 0c71b45665..6a07f84841 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl, intlShape } from 'react-intl'; +import _ from 'lodash'; import Button from '/imports/ui/components/button/component'; import Dropdown from '/imports/ui/components/dropdown/component'; @@ -72,12 +73,17 @@ class ActionsDropdown extends Component { - + { + [ + () + ] + } diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx index c630ce5812..9887641fdb 100644 --- a/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx @@ -2,11 +2,13 @@ import React, { Component, Children, cloneElement } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import KEY_CODES from '/imports/utils/keyCodes'; + import styles from './styles'; import ListItem from './item/component'; import ListSeparator from './separator/component'; import ListTitle from './title/component'; + const propTypes = { /* We should recheck this proptype, sometimes we need to create an container and send to dropdown, but with this */ @@ -14,11 +16,10 @@ const propTypes = { children: PropTypes.arrayOf((propValue, key, componentName, location, propFullName) => { if (propValue[key].type !== ListItem && propValue[key].type !== ListSeparator && - propValue[key].type !== ListTitle) { - return new Error( - `Invalid prop \`${propFullName}\` supplied to` + - ` \`${componentName}\`. Validation failed.`, - ); + propValue[key].type !== ListTitle && + propValue[key].type.name !== 'UserActions') { + return new Error(`Invalid prop \`${propFullName}\` supplied to` + + ` \`${componentName}\`. Validation failed.`); } return true; }).isRequired, @@ -122,6 +123,9 @@ export default class DropdownList extends Component { } render() { + //console.log('DropdownList render'); + //console.log(this.props.children); + const { children, style, className } = this.props; const boundChildren = Children.map(children, diff --git a/bigbluebutton-html5/imports/ui/components/user-list/container.jsx b/bigbluebutton-html5/imports/ui/components/user-list/container.jsx index 4d8063c9ed..c494af6603 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/container.jsx @@ -8,7 +8,6 @@ import UserList from './component'; const propTypes = { openChats: PropTypes.arrayOf(String).isRequired, - openChat: PropTypes.string.isRequired, users: PropTypes.arrayOf(Object).isRequired, currentUser: PropTypes.shape({}).isRequired, meeting: PropTypes.shape({}).isRequired, @@ -23,12 +22,6 @@ const propTypes = { toggleVoice: PropTypes.func.isRequired, changeRole: PropTypes.func.isRequired, roving: PropTypes.func.isRequired, - userActions: PropTypes.func.isRequired, - children: PropTypes.Object, -}; - -const defaultProps = { - children: {}, }; const UserListContainer = (props) => { @@ -36,10 +29,7 @@ const UserListContainer = (props) => { users, currentUser, openChats, - openChat, - userActions, isBreakoutRoom, - children, meeting, getAvailableActions, normalizeEmojiName, @@ -59,35 +49,28 @@ const UserListContainer = (props) => { meeting={meeting} currentUser={currentUser} openChats={openChats} - openChat={openChat} isBreakoutRoom={isBreakoutRoom} setEmojiStatus={setEmojiStatus} assignPresenter={assignPresenter} kickUser={kickUser} toggleVoice={toggleVoice} changeRole={changeRole} - userActions={userActions} getAvailableActions={getAvailableActions} normalizeEmojiName={normalizeEmojiName} isMeetingLocked={isMeetingLocked} isPublicChat={isPublicChat} roving={roving} - > - {children} - + /> ); }; UserListContainer.propTypes = propTypes; -UserListContainer.defaultProps = defaultProps; export default createContainer(({ params }) => ({ users: Service.getUsers(), meeting: Meetings.findOne({}), currentUser: Service.getCurrentUser(), openChats: Service.getOpenChats(params.chatID), - openChat: params.chatID, - userActions: Service.userActions, isBreakoutRoom: meetingIsBreakout(), getAvailableActions: Service.getAvailableActions, normalizeEmojiName: Service.normalizeEmojiName, diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-list-content/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-list-content/component.jsx index 17f4b7ae3d..6962e78d84 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-list-content/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-list-content/component.jsx @@ -283,11 +283,12 @@ class UserListContent extends Component { > { [ - ( - {user.name} + ( + + {user.name} ), (), ].concat(actions)