Fix team images for Master App
This commit is contained in:
1 parent
2f59d2a3fb
commit
4d87e353e8
17 files changed
+30
-132
No files matched your search
@@ -13,6 +13,7 @@ const TEAMS_FRAGMENT = gql`{
|
||||
createdAt
|
||||
profile {
|
||||
avatar
|
||||
banner
|
||||
description
|
||||
motto
|
||||
updatedAt
|
||||
|
||||
+6
-6
@@ -162,13 +162,13 @@ const resolvers = {
|
||||
async createTeam(parent, { name, slug, botName, botSlug }, ctx, info) {
|
||||
console.log('createTeam ctx:', ctx.request.user)
|
||||
const authId = ctx.request.user.sub
|
||||
const encodedAuthId = encodeURI(`:"${authId}"`)
|
||||
const encodedURL = `https://users-api.advancedalgos.net/graphql?query=%7B%0A%20%20userByAuthId(authId${encodedAuthId})%7B%0A%20%20%20%20id%0A%09%09email%0A%20%20%20%20alias%0A%20%20%7D%0A%7D`
|
||||
const encodedAuthId = encodeURI(authId)
|
||||
const encodedURL = `https://users-api.advancedalgos.net/graphql?query=%7B%0A%20%20userByAuthId(authId%3A%20"${encodedAuthId}")%7B%0A%20%20%20%20id%0A%09%09email%0A%20%20%20%20alias%0A%20%20%7D%0A%7D`
|
||||
const decodedURL = decodeURI(encodedURL)
|
||||
console.log('decoded URL: ', decodedURL)
|
||||
console.log('createTeam URLs: ', encodedURL, decodedURL)
|
||||
const getUserModuleUser = await axios.get(encodedURL)
|
||||
.then((result) => {
|
||||
console.log('getUserModuleUser:', result)
|
||||
console.log('getUserModuleUser axios:', result)
|
||||
return result
|
||||
})
|
||||
.catch(err =>{
|
||||
@@ -182,8 +182,8 @@ const resolvers = {
|
||||
const banner = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-banner-default.png'
|
||||
|
||||
const createTeamUrl = encodeURI(`${slug}/${name}/${alias}/${botSlug}/${authId}`)
|
||||
// const platformUrl = 'https://develop.advancedalgos.net/AABrowserAPI/teamSetup/'
|
||||
const platformUrl = 'http://localhost:1337/AABrowserAPI/teamSetup/'
|
||||
const platformUrl = 'https://develop.advancedalgos.net/AABrowserAPI/teamSetup/'
|
||||
// const platformUrl = 'http://localhost:3100/AABrowserAPI/teamSetup/'
|
||||
const createPlatformTeam = await axios.get(`${platformUrl}${createTeamUrl}`)
|
||||
.then((result) => {
|
||||
console.log('createPlatformTeam:', result)
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@advancedalgos/teams-client",
|
||||
"version": "0.0.20",
|
||||
"version": "0.0.21",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@advancedalgos/teams-client",
|
||||
"version": "0.0.20",
|
||||
"version": "0.0.21",
|
||||
"description": "Advanced Algos Team client-side web app",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const AddAlgobotMutation = gql`
|
||||
mutation addAlgobot($input: AddAlgobotInput!) {
|
||||
addAlgobot(input: $input) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
owner
|
||||
avatar
|
||||
repo
|
||||
team_id
|
||||
type
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -1,10 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const DeleteAlgobotMutation = gql`
|
||||
mutation deleteAlgobot($id: Int!) {
|
||||
deleteAlgobot(id: $id) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -1,19 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const GetAlgobotQuery = gql`
|
||||
query getAlgobotByOwner($owner: Int!) {
|
||||
getAlgobotByOwner(owner: $owner) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
owner
|
||||
avatar
|
||||
repo
|
||||
team_id
|
||||
type
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default GetAlgobotQuery
|
||||
@@ -1,29 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const GetAllAlgobotsQuery = gql`
|
||||
query algobots($limit: Int!, $after: Int) {
|
||||
algobots(limit: $limit, after: $after) {
|
||||
totalCount
|
||||
edges {
|
||||
cursor
|
||||
node {
|
||||
id
|
||||
name
|
||||
slug
|
||||
owner
|
||||
avatar
|
||||
repo
|
||||
team_id
|
||||
type
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
endCursor
|
||||
hasNextPage
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default GetAllAlgobotsQuery
|
||||
@@ -1,10 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const UniqueAlgobotnameQuery = gql`
|
||||
query uniqueAlgobotname($algobotname: String!) {
|
||||
uniqueAlgobotname(algobotname: $algobotname)
|
||||
}
|
||||
`
|
||||
|
||||
export default UniqueAlgobotnameQuery
|
||||
@@ -1,25 +0,0 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const USER_BY_AUTHID = gql`
|
||||
query($authId: String){
|
||||
userByAuthId (authId: $authId){
|
||||
id
|
||||
alias
|
||||
firstName
|
||||
middleName
|
||||
lastName
|
||||
bio
|
||||
email
|
||||
emailVerified
|
||||
isDeveloper
|
||||
isDataAnalyst
|
||||
isTrader
|
||||
role {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default USER_BY_AUTHID
|
||||
@@ -1,4 +1,3 @@
|
||||
import { GetCurrentMember } from './GetCurrentMemberQuery'
|
||||
import { USER_BY_AUTHID } from './GetUserByAuthIDQuery'
|
||||
|
||||
export { GetCurrentMember, USER_BY_AUTHID }
|
||||
export { GetCurrentMember }
|
||||
@@ -61,8 +61,8 @@ export class ManageTeamEdit extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
console.log('ManageTeamEdit ', this.props, this.props.slug, this.props.team)
|
||||
const { classes, team } = this.props
|
||||
const { classes, team, match } = this.props
|
||||
console.log('ManageTeamEdit ', this.props, this.props.slug, this.props.team, match)
|
||||
return (
|
||||
<Mutation
|
||||
mutation={UPDATE_TEAM_PROFILE}
|
||||
@@ -114,9 +114,9 @@ export class ManageTeamEdit extends Component {
|
||||
<DialogContent>
|
||||
<Mutation mutation={GET_AZURE_SAS} >
|
||||
{(getAzureSAS, { loading, error, data }) => {
|
||||
console.log('getAzureSAS: ', loading, error, data, team.profile)
|
||||
const AzureStorageUrl = process.env.AZURE_STORAGE_URL
|
||||
const containerName = team.slug
|
||||
console.log('getAzureSAS: ', loading, error, data, containerName, AzureStorageUrl, this.props)
|
||||
let AzureSASURL
|
||||
if (!loading && data !== undefined) {
|
||||
AzureSASURL = data.teams_GetAzureSAS
|
||||
@@ -162,7 +162,7 @@ export class ManageTeamEdit extends Component {
|
||||
debug
|
||||
/>
|
||||
<ImageUpload
|
||||
key='avatar'
|
||||
key='avatar1'
|
||||
handleUrl={this.handleAvatar}
|
||||
fileName={`${team.slug}-avatar.jpg`}
|
||||
containerName={containerName}
|
||||
@@ -296,7 +296,8 @@ ManageTeamEdit.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
slug: PropTypes.string.isRequired,
|
||||
team: PropTypes.object,
|
||||
authId: PropTypes.string.isRequired
|
||||
authId: PropTypes.string.isRequired,
|
||||
match: PropTypes.object
|
||||
}
|
||||
|
||||
export default withStyles(styles)(ManageTeamEdit)
|
||||
@@ -12,7 +12,7 @@ import ManageTeamDetails from './ManageTeamDetails'
|
||||
import ManageTeamDelete from './ManageTeamDelete'
|
||||
import ManageTeamEdit from './ManageTeamEdit'
|
||||
|
||||
export const ManageTeamsItem = ({ classes, team, authId }) => {
|
||||
export const ManageTeamsItem = ({ classes, team, authId, ...props }) => {
|
||||
console.log('ManageTeamsItem', team, team.profile, team.profile.avatar)
|
||||
let avatar
|
||||
if (team.profile.avatar !== undefined && team.profile.avatar !== 'a') {
|
||||
@@ -39,7 +39,7 @@ export const ManageTeamsItem = ({ classes, team, authId }) => {
|
||||
</CardContent>
|
||||
<CardActions>
|
||||
<ManageTeamDetails team={team} />
|
||||
<ManageTeamEdit slug={team.slug} team={team} authId={authId} />
|
||||
<ManageTeamEdit slug={team.slug} team={team} authId={authId} {...props} />
|
||||
<ManageTeamDelete slug={team.slug} authId={authId} />
|
||||
</CardActions>
|
||||
</div>
|
||||
|
||||
@@ -47,7 +47,7 @@ const styles = theme => ({
|
||||
}
|
||||
})
|
||||
|
||||
export const ManageTeamsList = ({ classes, user = null }) => {
|
||||
export const ManageTeamsList = ({ classes, user = null, ...props }) => {
|
||||
let owner
|
||||
let authId = null
|
||||
console.log('ManageTeamsList: ', user)
|
||||
@@ -92,6 +92,7 @@ export const ManageTeamsList = ({ classes, user = null }) => {
|
||||
team={team}
|
||||
classes={classes}
|
||||
authId={authId}
|
||||
{...props}
|
||||
/>
|
||||
))}
|
||||
{errors}
|
||||
|
||||
@@ -12,12 +12,12 @@ const styles = theme => ({
|
||||
}
|
||||
})
|
||||
|
||||
const ManageTeams = ({ classes }) => (
|
||||
const ManageTeams = ({ classes, ...props }) => (
|
||||
<div>
|
||||
<Typography variant='h4' gutterBottom>
|
||||
Manage Your Teams
|
||||
</Typography>
|
||||
<ManageTeamsList />
|
||||
<ManageTeamsList {...props} />
|
||||
</div>
|
||||
)
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ const styles = theme => ({
|
||||
|
||||
const TeamsDetails = ({ classes, team }) => {
|
||||
let avatar
|
||||
if (team.profile.avatar !== undefined && team.profile.avatar !== 'a') {
|
||||
if (team.profile.avatar !== undefined && team.profile.avatar !== null) {
|
||||
avatar = team.profile.avatar
|
||||
} else {
|
||||
avatar = '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'
|
||||
}
|
||||
let banner
|
||||
if (team.profile.banner !== undefined && team.profile.banner !== 'a') {
|
||||
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'
|
||||
|
||||
@@ -102,6 +102,12 @@ export const TeamsList = ({ classes, match }) => (
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return (
|
||||
<Grid container spacing={40}>
|
||||
<MessageCard message='No teams found' />
|
||||
</Grid>
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user