From 7fa1c210922fac754599ae71d819a02563cb70ed Mon Sep 17 00:00:00 2001 From: Barry Low Date: Wed, 7 Nov 2018 08:52:59 -0800 Subject: [PATCH 1/3] Fix teamByName #55 --- api/src/graphql/resolvers/Query/Team.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/graphql/resolvers/Query/Team.js b/api/src/graphql/resolvers/Query/Team.js index d70de3cd4..295375ca3 100644 --- a/api/src/graphql/resolvers/Query/Team.js +++ b/api/src/graphql/resolvers/Query/Team.js @@ -16,7 +16,7 @@ export const teamById = async (parent, { teamId }, ctx, info) => { } export const teamByName = async (parent, { name }, ctx, info) => { - return ctx.db.query.team({ where: { name: name } }, `{ name }`) + return ctx.db.query.team({ where: { name: name } }, TEAMS_FRAGMENT) } export const teamWithRole = async (parent, { teamId, role }, ctx, info) => { From ba87853988a367af772da677cea987c3c2b57c98 Mon Sep 17 00:00:00 2001 From: Barry Low Date: Wed, 7 Nov 2018 08:55:56 -0800 Subject: [PATCH 2/3] Add query teamBySlug #56 --- api/src/graphql/resolvers/Query/Team.js | 4 ++++ api/src/graphql/schema.graphql | 1 + 2 files changed, 5 insertions(+) diff --git a/api/src/graphql/resolvers/Query/Team.js b/api/src/graphql/resolvers/Query/Team.js index 295375ca3..100980423 100644 --- a/api/src/graphql/resolvers/Query/Team.js +++ b/api/src/graphql/resolvers/Query/Team.js @@ -19,6 +19,10 @@ export const teamByName = async (parent, { name }, ctx, info) => { return ctx.db.query.team({ where: { name: name } }, TEAMS_FRAGMENT) } +export const teamBySlug= async (parent, { slug }, ctx, info) => { + return ctx.db.query.team({ where: { slug: slug } }, TEAMS_FRAGMENT) +} + export const teamWithRole = async (parent, { teamId, role }, ctx, info) => { return ctx.db.query.teamsConnection({where: {AND: [{id: teamId},{members_some:{role: role}}]}, first:1}, info) } diff --git a/api/src/graphql/schema.graphql b/api/src/graphql/schema.graphql index 2095882bb..54559651e 100644 --- a/api/src/graphql/schema.graphql +++ b/api/src/graphql/schema.graphql @@ -9,6 +9,7 @@ type Query { teams: TeamConnection teamDetails: [Team!]! @isAuthenticated teamByName(name: String!): Team + teamBySlug(slug: String!): Team teamById(teamId: String!): Team teamWithRole(teamId: String!, role: String!): Team teamsByOwner: [Team!]! @isAuthenticated From 730061a61a559ec9eec3661bdfbee836e104284f Mon Sep 17 00:00:00 2001 From: Barry Low Date: Wed, 7 Nov 2018 09:14:20 -0800 Subject: [PATCH 3/3] Update Router for MasterApp Menu fix --- client/src/index.js | 68 +++++++++---------- .../components/ManageTeamDetails.js | 4 +- .../components/ManageTeamsItem.js | 2 +- .../src/views/teams/components/TeamsItem.js | 2 +- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/client/src/index.js b/client/src/index.js index 8f5d8aa70..9ff881c15 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { Route, BrowserRouter, Switch } from 'react-router-dom' +import { Route, Switch } from 'react-router-dom' import { hot } from 'react-hot-loader' import { withStyles } from '@material-ui/core/styles' @@ -43,40 +43,38 @@ class App extends Component { loggedIn = '' } return ( - -
- {loggedIn} - - - } - /> - } - /> - } - /> - } - /> - } - /> - - -
-
+
+ {loggedIn} + + + } + /> + } + /> + } + /> + } + /> + } + /> + + +
) } } diff --git a/client/src/views/manage-teams/components/ManageTeamDetails.js b/client/src/views/manage-teams/components/ManageTeamDetails.js index 2a2f0a63d..cc5aa8367 100644 --- a/client/src/views/manage-teams/components/ManageTeamDetails.js +++ b/client/src/views/manage-teams/components/ManageTeamDetails.js @@ -72,12 +72,12 @@ export class ManageTeamDetails extends Component { if (profile.avatar !== undefined && profile.avatar !== null) { avatar = profile.avatar } else { - avatar = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-avatar-default.png' + avatar = 'https://aadevelop.blob.core.windows.net/module-teams/module-default/aa-avatar-default.png' } if (profile.banner !== undefined && profile.banner !== null) { banner = profile.banner } else { - banner = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-banner-default.png' + banner = 'https://aadevelop.blob.core.windows.net/module-teams/module-default/aa-banner-default.png' } return (
diff --git a/client/src/views/manage-teams/components/ManageTeamsItem.js b/client/src/views/manage-teams/components/ManageTeamsItem.js index 4af1b51d5..a4522a4d3 100644 --- a/client/src/views/manage-teams/components/ManageTeamsItem.js +++ b/client/src/views/manage-teams/components/ManageTeamsItem.js @@ -20,7 +20,7 @@ export const ManageTeamsItem = ({ classes, team, ...props }) => { if (team.profile.avatar !== undefined && team.profile.avatar !== 'a') { avatar = team.profile.avatar } else { - avatar = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-avatar-default.png' + avatar = 'https://aadevelop.blob.core.windows.net/module-teams/module-default/aa-avatar-default.png' } return ( diff --git a/client/src/views/teams/components/TeamsItem.js b/client/src/views/teams/components/TeamsItem.js index b597e55b0..34ba34df2 100644 --- a/client/src/views/teams/components/TeamsItem.js +++ b/client/src/views/teams/components/TeamsItem.js @@ -23,7 +23,7 @@ export const TeamsItem = ({ classes, team }) => { if (team.profile.banner !== undefined && team.profile.banner !== null) { banner = team.profile.banner } else { - banner = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22288%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20288%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164edaf95ee%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A14pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164edaf95ee%22%3E%3Crect%20width%3D%22288%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2296.32500076293945%22%20y%3D%22118.8%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E' + banner = 'https://aadevelop.blob.core.windows.net/module-teams/module-default/aa-banner-default.png' } return (