diff --git a/client/package-lock.json b/client/package-lock.json index ba8280b45..20902b318 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -2134,7 +2134,7 @@ "dependencies": { "core-js": { "version": "1.2.7", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" }, "fbjs": { diff --git a/client/src/index.js b/client/src/index.js index 51349a3b0..8a49f1b22 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -8,7 +8,6 @@ import { AcceptTeamInvite, ManageTeams, TeamMembers, - FinancialBeings, Settings, Teams, Landing, @@ -57,12 +56,7 @@ class App extends Component { /> } - /> - } /> ({ + root: { + flexGrow: 1 + }, heroContent: { - maxWidth: 600, - margin: '0 auto', - padding: `${theme.spacing.unit * 8}px 0 ${theme.spacing.unit * 6}px` + maxWidth: 800, + margin: `${theme.spacing.unit * 4}px auto`, + padding: 0 }, cardGrid: { padding: `${theme.spacing.unit * 8}px 0` @@ -63,17 +66,21 @@ export const ManageFBList = ({ classes }) => ( if (!loading && !error) { if (data.teams_TeamsByOwner.length > 0) { return ( - - {!loading && - data.teams_TeamsByOwner.map(team => ( - - ))} - {errors} - +
+
+ + {!loading && + data.teams_TeamsByOwner.map(team => ( + + ))} + {errors} + +
+
) } else { return ( diff --git a/client/src/views/manage-teams/components/ManageTeamProfile.js b/client/src/views/manage-teams/components/ManageTeamProfile.js index 48c2acb5a..51297cbc9 100644 --- a/client/src/views/manage-teams/components/ManageTeamProfile.js +++ b/client/src/views/manage-teams/components/ManageTeamProfile.js @@ -11,6 +11,8 @@ import { Link } from 'react-router-dom' import ManageTeamProfileView from './ManageTeamProfileView' import ManageTeamProfileEdit from './ManageTeamProfileEdit' +import log from '../../../utils/log' + const styles = theme => ({ root: { flexGrow: 1 @@ -72,6 +74,7 @@ export class ManageTeamProfile extends Component { this.toggleEdit = this.toggleEdit.bind(this) this.handleSave = this.handleSave.bind(this) + this.handleUpdate = this.handleUpdate.bind(this) this.state = { edit: false, @@ -81,7 +84,7 @@ export class ManageTeamProfile extends Component { render () { const { classes, team, slug, match } = this.props - + log.debug('ManageTeamProfile render', this.state) return (
@@ -94,7 +97,7 @@ export class ManageTeamProfile extends Component { slug={slug} match={match} save={this.state.save} - handleUpdate={e => this.toggleEdit} + handleUpdate={this.handleUpdate} /> } @@ -134,7 +137,7 @@ export class ManageTeamProfile extends Component { + + + + + + Edit Financial Being + + + + {loader} + {errors} + + + + + + + +
+ ) + }} + + ) + } + + handleClickOpen () { + this.setState({ open: true }) + } + + handleClose () { + this.setState({ open: false }) + } + + handleAvatar (avatarUrl) { + log.debug('handleAvatar: ', avatarUrl) + this.setState({ avatar: `${avatarUrl}?${Math.random()}` }) + } + + async handleSubmit (e, updateFB, fbId, slug) { + log.debug('handleSubmit: ', this.state) + e.preventDefault() + + await updateFB({ + variables: { + fbId, + avatar: this.state.avatar + } + }) + window.canvasApp.eventHandler.raiseEvent('User Profile Changed') + this.setState({ open: false }) + } +} + +ManageTeamProfileFBEdit.propTypes = { + classes: PropTypes.object.isRequired, + slug: PropTypes.string.isRequired, + fb: PropTypes.object +} + +export default withStyles(styles)(ManageTeamProfileFBEdit) diff --git a/client/src/views/manage-teams/components/ManageTeamProfileFBView.js b/client/src/views/manage-teams/components/ManageTeamProfileFBView.js new file mode 100644 index 000000000..bbd902d0b --- /dev/null +++ b/client/src/views/manage-teams/components/ManageTeamProfileFBView.js @@ -0,0 +1,76 @@ +import React from 'react' +import PropTypes from 'prop-types' + +import Grid from '@material-ui/core/Grid' +import Card from '@material-ui/core/Card' +import CardContent from '@material-ui/core/CardContent' +import CardActions from '@material-ui/core/CardActions' +import CardMedia from '@material-ui/core/CardMedia' +import Typography from '@material-ui/core/Typography' +import { withStyles } from '@material-ui/core/styles' + +import ManageTeamProfileFBEdit from './ManageTeamProfileFBEdit' + +import log from '../../../utils/log' + +const styles = theme => ({ + fbContainer: { + margin: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit * 2}px` + }, + card: { + display: 'flex', + width: '100%' + }, + cardDetails: { + display: 'flex', + flex: 1 + }, + cardContent: { + flex: 1 + }, + cardMedia: { + flex: 1, + width: 100, + height: 100, + maxWidth: 100, + justifyContent: 'flex-start' + } +}) + +export const ManageTeamProvileFBView = ({ classes, team }) => { + log.debug('ManageTeamProvileFBView', team, team.fb[0], team.fb[0].avatar) + + let avatar = (team.fb[0].avatar !== undefined && team.fb[0].avatar !== null) ? team.fb[0].avatar : 'https://aadevelop.blob.core.windows.net/module-teams/module-default/aa-avatar-default.png' + + return ( + + +
+ + + + {team.fb[0].name} + + + {team.fb[0].kind} + + + + + +
+
+
+ ) +} + +ManageTeamProvileFBView.propTypes = { + classes: PropTypes.object.isRequired, + team: PropTypes.object.isRequired +} + +export default withStyles(styles)(ManageTeamProvileFBView) diff --git a/client/src/views/manage-teams/components/ManageTeamProfileView.js b/client/src/views/manage-teams/components/ManageTeamProfileView.js index cf0e23d36..dc47aec64 100644 --- a/client/src/views/manage-teams/components/ManageTeamProfileView.js +++ b/client/src/views/manage-teams/components/ManageTeamProfileView.js @@ -5,6 +5,8 @@ import Typography from '@material-ui/core/Typography' import Grid from '@material-ui/core/Grid' import { withStyles } from '@material-ui/core/styles' +import ManageTeamProfileFBView from './ManageTeamProfileFBView' + const styles = theme => ({ root: { flexGrow: 1 @@ -38,23 +40,36 @@ const styles = theme => ({ margin: '0 auto', padding: `0 0 ${theme.spacing.unit * 2}px` }, + metaContainer: { + marginTop: `${theme.spacing.unit * 1}px`, + alignSelf: 'stretch', + borderRight: '1px solid #CCCCCC' + }, teamMeta: { - borderRight: '1px solid #CCCCCC', margin: `${theme.spacing.unit * 3}px 0 0`, paddingLeft: `${theme.spacing.unit * 2}px`, textAlign: 'center' }, teamContent: { '& h2': { - padding: `${theme.spacing.unit * 4}px ${theme.spacing.unit * 3}px ${theme.spacing.unit * 2}px` + padding: `${theme.spacing.unit * 4}px ${theme.spacing.unit * 3}px 0` }, '& h4': { - padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit * 2}px` + padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit * 1}px` }, '& h6': { padding: `0 ${theme.spacing.unit * 3}px 0` } }, + fbContent: { + borderTop: '1px solid #CCCCCC', + width: '90%', + margin: `${theme.spacing.unit * 3}px auto`, + paddingTop: `${theme.spacing.unit * 3}px`, + '& h4': { + padding: `0 ${theme.spacing.unit * 3}px ${theme.spacing.unit * 1}px` + } + }, banner: { maxWidth: '100%', height: 'auto', @@ -85,7 +100,7 @@ const ManageTeamProfileView = ({ classes, team }) => { {team.name} - + {team.name} @@ -119,6 +134,16 @@ const ManageTeamProfileView = ({ classes, team }) => { Description: {team.profile.description} + + + Financial Beings + + + diff --git a/client/src/views/teams/components/TeamsItem.js b/client/src/views/teams/components/TeamsItem.js index 767c9eb4f..c0460e29a 100644 --- a/client/src/views/teams/components/TeamsItem.js +++ b/client/src/views/teams/components/TeamsItem.js @@ -30,7 +30,8 @@ const styles = theme => ({ height: 65, margin: '0 0.875em 0 0', borderRadius: '50%', - verticalAlign: 'middle' + verticalAlign: 'middle', + alignSelf: 'flex-start' }, buttonRight: { textDecoration: 'none' @@ -61,7 +62,7 @@ export const TeamsItem = ({ classes, team }) => { /> - + {team.name} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..e5e010a59 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "AATeamModule", + "version": "2.0.1", + "lockfileVersion": 1 +}