diff --git a/client/main.html b/client/main.html index 57d97df2..65edcd1b 100644 --- a/client/main.html +++ b/client/main.html @@ -5,7 +5,7 @@ - + diff --git a/package-lock.json b/package-lock.json index 02313faf..db04d72a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -967,22 +967,6 @@ "regenerator-runtime": "^0.13.4" } }, - "@babel/runtime-corejs2": { - "version": "7.17.9", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.17.9.tgz", - "integrity": "sha512-+QThIsnjVY12uURTvmnW33risFZ7ulq6OWw0VJL08UwiYiWVp9PM63s+W1L2ppajYyKAYKb7afcGYSHzA0k04Q==", - "requires": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.4" - }, - "dependencies": { - "core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" - } - } - }, "@babel/template": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", @@ -2013,6 +1997,11 @@ "fastq": "^1.6.0" } }, + "@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==" + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -2067,6 +2056,19 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, + "@restart/context": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz", + "integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==" + }, + "@restart/hooks": { + "version": "0.3.27", + "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.27.tgz", + "integrity": "sha512-s984xV/EapUIfkjlf8wz9weP2O9TNKR96C68FfMEy2bE69+H4cNv3RD4Mf97lW7Htt7PjZrYTjSC8f3SB9VCXw==", + "requires": { + "dequal": "^2.0.2" + } + }, "@samverschueren/stream-to-observable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", @@ -2231,6 +2233,11 @@ "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.8.2.tgz", "integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w==" }, + "@types/invariant": { + "version": "2.2.35", + "resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.35.tgz", + "integrity": "sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==" + }, "@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -2348,6 +2355,14 @@ "csstype": "^3.0.2" } }, + "@types/react-transition-group": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.4.tgz", + "integrity": "sha512-7gAPz7anVK5xzbeQW9wFBDg7G++aPLAFY0QaSMOou9rJZpbuI58WAuJrgu+qR92l61grlnCUe7AFX8KGahAgug==", + "requires": { + "@types/react": "*" + } + }, "@types/scheduler": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", @@ -2368,6 +2383,11 @@ "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", "dev": true }, + "@types/warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz", + "integrity": "sha1-DSUBJorY+ZYrdA04fEZU9fjiPlI=" + }, "@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", @@ -5505,6 +5525,11 @@ "resolved": "https://registry.npmjs.org/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz", "integrity": "sha1-AJZjF7ehL+kvPMgx91g68ym4bDc=" }, + "dequal": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", + "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==" + }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", @@ -5565,11 +5590,12 @@ } }, "dom-helpers": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz", - "integrity": "sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", "requires": { - "@babel/runtime": "^7.1.2" + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" } }, "dom-serializer": { @@ -10169,11 +10195,6 @@ } } }, - "keycode": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.1.tgz", - "integrity": "sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==" - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -12755,16 +12776,6 @@ "requires": { "react-is": "^16.3.2", "warning": "^4.0.0" - }, - "dependencies": { - "warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "requires": { - "loose-envify": "^1.0.0" - } - } } }, "proxy-addr": { @@ -12901,22 +12912,27 @@ "integrity": "sha1-k2u1jt9ribYZxQ+C8OYXFZ/f1PE=" }, "react-bootstrap": { - "version": "0.33.1", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-0.33.1.tgz", - "integrity": "sha512-qWTRravSds87P8WC82tETy2yIso8qDqlIm0czsrduCaYAFtHuyLu0XDbUlfLXeRzqgwm5sRk2wRaTNoiVkk/YQ==", - "requires": { - "@babel/runtime-corejs2": "^7.0.0", - "classnames": "^2.2.5", - "dom-helpers": "^3.2.0", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.6.4.tgz", + "integrity": "sha512-z3BhBD4bEZuLP8VrYqAD7OT7axdcSkkyvWBWnS2U/4MhyabUihrUyucPWkan7aMI1XIHbmH4LCpEtzWGfx/yfA==", + "requires": { + "@babel/runtime": "^7.14.0", + "@restart/context": "^2.1.4", + "@restart/hooks": "^0.3.26", + "@types/invariant": "^2.2.33", + "@types/prop-types": "^15.7.3", + "@types/react": ">=16.14.8", + "@types/react-transition-group": "^4.4.1", + "@types/warning": "^3.0.0", + "classnames": "^2.3.1", + "dom-helpers": "^5.2.1", "invariant": "^2.2.4", - "keycode": "^2.2.0", - "prop-types": "^15.6.1", - "prop-types-extra": "^1.0.1", - "react-overlays": "^0.9.0", - "react-prop-types": "^0.4.0", - "react-transition-group": "^2.0.0", - "uncontrollable": "^7.0.2", - "warning": "^3.0.0" + "prop-types": "^15.7.2", + "prop-types-extra": "^1.1.0", + "react-overlays": "^5.1.1", + "react-transition-group": "^4.4.1", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" } }, "react-dom": { @@ -12972,24 +12988,18 @@ } }, "react-overlays": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-0.9.3.tgz", - "integrity": "sha512-u2T7nOLnK+Hrntho4p0Nxh+BsJl0bl4Xuwj/Y0a56xywLMetgAfyjnDVrudLXsNcKGaspoC+t3C1V80W9QQTdQ==", - "requires": { - "classnames": "^2.2.5", - "dom-helpers": "^3.2.1", - "prop-types": "^15.5.10", - "prop-types-extra": "^1.0.1", - "react-transition-group": "^2.2.1", - "warning": "^3.0.0" - } - }, - "react-prop-types": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/react-prop-types/-/react-prop-types-0.4.0.tgz", - "integrity": "sha1-+ZsL+0AGkpya8gUefBQUpcdbk9A=", - "requires": { - "warning": "^3.0.0" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-5.1.1.tgz", + "integrity": "sha512-eCN2s2/+GVZzpnId4XVWtvDPYYBD2EtOGP74hE+8yDskPzFy9+pV1H3ZZihxuRdEbQzzacySaaDkR7xE0ydl4Q==", + "requires": { + "@babel/runtime": "^7.13.8", + "@popperjs/core": "^2.8.6", + "@restart/hooks": "^0.3.26", + "@types/warning": "^3.0.0", + "dom-helpers": "^5.2.0", + "prop-types": "^15.7.2", + "uncontrollable": "^7.2.1", + "warning": "^4.0.3" } }, "react-router": { @@ -13074,14 +13084,14 @@ } }, "react-transition-group": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.9.0.tgz", - "integrity": "sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", + "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", "requires": { - "dom-helpers": "^3.4.0", + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", "loose-envify": "^1.4.0", - "prop-types": "^15.6.2", - "react-lifecycles-compat": "^3.0.4" + "prop-types": "^15.6.2" }, "dependencies": { "loose-envify": { @@ -15727,9 +15737,9 @@ } }, "warning": { - "version": "3.0.0", - "resolved": false, - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", "requires": { "loose-envify": "^1.0.0" } diff --git a/package.json b/package.json index 62c14d7f..6e0884c9 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "react": "^16.14.0", "react-apollo": "^2.5.8", "react-autobind": "^1.0.6", - "react-bootstrap": "^0.33.1", + "react-bootstrap": "^1.6.4", "react-dom": "^16.14.0", "react-helmet": "^5.2.1", "react-markdown": "^4.3.1", diff --git a/startup/client/GlobalStyle.js b/startup/client/GlobalStyle.js index 23d8db1a..7ce10f42 100644 --- a/startup/client/GlobalStyle.js +++ b/startup/client/GlobalStyle.js @@ -50,6 +50,15 @@ const GlobalStyle = createGlobalStyle` border-left: none; border-right: none; border-top: none; + margin-bottom: 20px; + } + + .navbar-brand { + font-size: 1.2rem; + } + + .navbar-light .navbar-brand { + color: #777; } form label { @@ -70,7 +79,9 @@ const GlobalStyle = createGlobalStyle` } .page-header { - margin-top: 0; + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; } .table tr td { @@ -88,7 +99,7 @@ const GlobalStyle = createGlobalStyle` } .page-header { - margin-top: 20px; + margin-top: 40px; } } `; diff --git a/ui/components/AdminUserProfile/index.js b/ui/components/AdminUserProfile/index.js index 588c0b38..fab7e24f 100644 --- a/ui/components/AdminUserProfile/index.js +++ b/ui/components/AdminUserProfile/index.js @@ -3,11 +3,12 @@ import PropTypes from 'prop-types'; import { Row, Col, - ControlLabel, + FormLabel, FormGroup, ListGroup, ListGroupItem, - Checkbox, + FormCheck, + Form, InputGroup, Button, } from 'react-bootstrap'; @@ -15,12 +16,19 @@ import { capitalize } from 'lodash'; import { Random } from 'meteor/random'; import InputHint from '../InputHint'; import Icon from '../Icon'; -import Validation from '../Validation'; class AdminUserProfile extends React.Component { - state = { showPassword: false, password: '' }; + state = { showPassword: false, password: '', validated: false }; + + handleSubmit = (event) => { + const form = event.currentTarget; + event.preventDefault(); + event.stopPropagation(); + if (!form.checkValidity()) { + this.setState({ validated: true }); + return; + } - handleSubmit = (form) => { const { user, updateUser } = this.props; const existingUser = user; const isPasswordUser = existingUser && !existingUser.oAuthProvider; @@ -74,177 +82,165 @@ class AdminUserProfile extends React.Component { render() { const { user } = this.props; - const { showPassword, password } = this.state; + const { showPassword, password, validated } = this.state; return ( -
- this.handleSubmit(form)} - > -
(this.form = form)} onSubmit={(event) => event.preventDefault()}> - {user && ( - - - {user && user.name && ( - - - - First Name - - - - - - Last Name - - - - - )} - {user && user.username && ( - - - - Username - - - - - )} +
+ + {user && ( + + + {user && user.name && ( - + + + First Name + + + {/* eslint-disable-next-line react/no-unescaped-entities */} + What's the user's first name? + + + + - Email Address + Last Name + + {/* eslint-disable-next-line react/no-unescaped-entities */} + What's the user's last name? + + )} + {user && user.username && ( - Roles - - {user.roles.map(({ _id, name, inRole }) => ( - - - {capitalize(name)} - - - ))} - + Username + - {user && !user.oAuthProvider && ( - - - - - Password - + + + Email Address + + + Need an email address here. + + + + + + + + Roles + + {user.roles.map(({ _id, name, inRole }) => ( + + - this.setState({ - showPassword: !showPassword, - }) - } - > - Show Password - - - - { - this.setState({ password: event.target.value }); - }} + label={capitalize(name)} /> - - - - - Use at least six characters. - - - - )} - + + + Please use at least six characters. + + + Use at least six characters. + + + + )} + + {user && ( + - {user && ( - - )} - - - )} - - + )} + + + )} +
); } diff --git a/ui/components/AdminUserSettingsModal/index.js b/ui/components/AdminUserSettingsModal/index.js index 7752cfa9..2c6831d2 100644 --- a/ui/components/AdminUserSettingsModal/index.js +++ b/ui/components/AdminUserSettingsModal/index.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Modal, Button, Row, Col, FormGroup, ControlLabel } from 'react-bootstrap'; +import { Modal, Button, Row, Col, FormGroup, FormLabel } from 'react-bootstrap'; import { camelCase } from 'lodash'; import Validation from '../Validation'; import InputHint from '../InputHint'; @@ -107,7 +107,7 @@ class AdminUserSettingsModal extends React.Component { - Key Name + Key Name - Is this a GDPR setting? + Is this a GDPR setting? (this.isGDPR = isGDPRToggle)} toggled={isGDPR} @@ -130,7 +130,7 @@ class AdminUserSettingsModal extends React.Component { - Label + Label - Type + Type - diff --git a/ui/components/AuthenticatedNavigation/index.js b/ui/components/AuthenticatedNavigation/index.js index 521e413b..09c19241 100644 --- a/ui/components/AuthenticatedNavigation/index.js +++ b/ui/components/AuthenticatedNavigation/index.js @@ -2,46 +2,46 @@ import React from 'react'; import PropTypes from 'prop-types'; import { withRouter } from 'react-router-dom'; import { LinkContainer } from 'react-router-bootstrap'; -import { Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap'; +import { Nav, NavDropdown } from 'react-bootstrap'; import { Roles } from 'meteor/alanning:roles'; const AuthenticatedNavigation = ({ name, history, userId }) => ( -
-
+ ); AuthenticatedNavigation.propTypes = { diff --git a/ui/components/BlankState/index.js b/ui/components/BlankState/index.js index 76136ba8..3edcc4a8 100644 --- a/ui/components/BlankState/index.js +++ b/ui/components/BlankState/index.js @@ -11,7 +11,7 @@ const BlankState = ({ image, icon, title, subtitle, action }) => (

{title}

{subtitle}

{action && ( - )} diff --git a/ui/components/CommentComposer/index.js b/ui/components/CommentComposer/index.js index a5bdda77..d6d9260e 100644 --- a/ui/components/CommentComposer/index.js +++ b/ui/components/CommentComposer/index.js @@ -47,7 +47,7 @@ const CommentComposer = ({ mutate, documentId }) => ( name="comment" placeholder="Have a comment about this?" /> - diff --git a/ui/components/DocumentEditor/index.js b/ui/components/DocumentEditor/index.js index 92670550..dd2afb19 100644 --- a/ui/components/DocumentEditor/index.js +++ b/ui/components/DocumentEditor/index.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { ControlLabel, DropdownButton, MenuItem } from 'react-bootstrap'; +import { Dropdown } from 'react-bootstrap'; import { Mutation } from 'react-apollo'; import autoBind from 'react-autobind'; import { Bert } from 'meteor/themeteorchef:bert'; @@ -110,43 +110,47 @@ class DocumentEditor extends React.Component { ) : ( Last edit was - {timeago(doc.updatedAt)} + {` ${timeago(doc.updatedAt)}`} )}

- - history.push(`/documents/${doc._id}`)}> - - {' View Document'} - - - Visibility - this.handleSetVisibility(mutate, 'public')} - > - - {' Public'} - - this.handleSetVisibility(mutate, 'private')} - > - - {' Private'} - - - this.handleRemoveDocument(mutate)}> - Delete Document - - + + + {settingsIcon} + + + history.push(`/documents/${doc._id}`)}> + + {' View Document'} + + + Visibility + this.handleSetVisibility(mutate, 'public')} + > + + {' Public'} + + this.handleSetVisibility(mutate, 'private')} + > + + {' Private'} + + + this.handleRemoveDocument(mutate)}> + Delete Document + + +
(this.form = form)} onSubmit={(event) => event.preventDefault()}> - Title - Body