Fixed wb toolbar console warnings cause by improper props validation

This commit is contained in:
Oleksandr Zhurbenko 2017-10-03 14:28:44 -07:00
parent 76bcdd55d6
commit ab95c87f48
17 changed files with 19 additions and 18 deletions

View File

View File

@ -2,8 +2,7 @@ import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
import Users from '/imports/api/2.0/users';
export default function handleChangeRole({body}, meetingId) {
export default function handleChangeRole({ body }, meetingId) {
const { userId, role, changedBy } = body;
check(userId, String);
@ -32,5 +31,4 @@ export default function handleChangeRole({body}, meetingId) {
};
return Users.update(selector, modifier, cb);
}

View File

View File

View File

View File

View File

View File

@ -23,20 +23,23 @@ export default createContainer(() => ({
WhiteboardOverlayContainer.propTypes = {
drawSettings: PropTypes.shape({
// Annotation color
color: PropTypes.number.isRequired,
// Annotation thickness (not normalized)
thickness: PropTypes.number.isRequired,
// The name of the tool currently selected
tool: PropTypes.string.isRequired,
// Font size for the text shape
textFontSize: PropTypes.number.isRequired,
// Current active text shape value
textShapeValue: PropTypes.string.isRequired,
// Text active text shape id
textShapeActiveId: PropTypes.string.isRequired,
}),
drawSettings: PropTypes.oneOfType([
PropTypes.shape({
// Annotation color
color: PropTypes.number.isRequired,
// Annotation thickness (not normalized)
thickness: PropTypes.number.isRequired,
// The name of the tool currently selected
tool: PropTypes.string.isRequired,
// Font size for the text shape
textFontSize: PropTypes.number.isRequired,
// Current active text shape value
textShapeValue: PropTypes.string.isRequired,
// Text active text shape id
textShapeActiveId: PropTypes.string.isRequired,
}),
PropTypes.object.isRequired,
]),
};
WhiteboardOverlayContainer.defaultProps = {

View File

@ -130,5 +130,5 @@ ToolbarSubmenu.propTypes = {
}),
]).isRequired,
label: PropTypes.string.isRequired,
customIcon: PropTypes.node.isRequired,
customIcon: PropTypes.bool.isRequired,
};