Add ecosystem stuff

This commit is contained in:
Amit Jakubowicz 2019-07-25 22:24:18 +02:00
parent 682ace9a27
commit f41db5647d
6 changed files with 53 additions and 20 deletions

View File

@ -1,6 +1,7 @@
import * as React from 'react'
import {RouteComponentProps, withRouter} from "react-router"
import OccurrenceDetailsQuery from "./OccurrenceDetailsQuery";
import OccurrenceDetailsQuery from "./OccurrenceDetailsQuery"
import styled from '@emotion/styled'
interface RouteParams {
occurrenceId: string
@ -20,14 +21,33 @@ const OccurrenceDetails = (props: Props) => {
if (error) {
return <p>{error.message}</p>
}
const info = data.occurrence.event.info[0]
return (
<div>
{ data.occurrence.event.info[0].title}
</div>
<Root>
<Title>
{ info.title }
</Title>
<Info>
{ info.description }
</Info>
</Root>
)
} }
</OccurrenceDetailsQuery>
}
const Title = styled.div`
grid-row: title;
`
const Info = styled.div`
grid-row: info
`
const Root = styled.div`
display: grid;
grid-template-rows: 48px [title] 1fr [info];
`
export default withRouter(OccurrenceDetails)

View File

@ -33,11 +33,11 @@ export interface OccurrenceDetailsData {
id: string
name: string
}
info: {
info: Array<{
description
language
title
}
}>
}
}
}

23
ecosystem.config.json Normal file
View File

@ -0,0 +1,23 @@
{
"apps" : [{
"name" : "client",
"script" : "./client/SSR/index.ts",
"watch" : true,
"env": {
"NODE_ENV": "development"
},
"env_production" : {
"NODE_ENV": "production"
}
},{
"name" : "api",
"exp_backoff_restart_delay": 2000,
"script" : "./server/lib/src/index.js",
"env": {
"NODE_ENV": "production"
},
"env_production" : {
"NODE_ENV": "development"
}
}]
}

View File

@ -1,12 +0,0 @@
{
"type": "postgres",
"host": "localhost",
"database": "qpa-dev",
"entities": ["src/**/*.entity.ts"],
"migrations": ["migrations/*.ts"],
"cli": {
"migrationsDir": "./migrations"
},
"logging": true,
"synchronize": true
}

View File

@ -5,8 +5,8 @@ const config: ConnectionOptions = {
host: process.env.POSTGRES_HOST || 'localhost',
port: Number(process.env.POSTGRES_PORT || 5432),
database: process.env.POSTGRES_DB || 'qpa-dev',
username: 'qpa',
password: 'qpa',
username: process.env.DB_USER || null,
password: process.env.DB_PASSWORD || null,
entities: ["src/**/*.entity.ts"],
logging: true,
synchronize: true,

View File

@ -6,6 +6,7 @@ import gql from "graphql-tag"
import {PostOffice, sendEmail} from "../../post_office"
import {User} from "../User.entity"
import {Session, SessionInvite} from "../Session.entity"
import SessionManager from "../SessionManager";
jest.setTimeout(10000)
@ -32,6 +33,7 @@ describe('Authentication', () => {
await testyUser.save()
const server = await createServer({
typeormConnection: connection,
sessionManager: {} as SessionManager,
sendEmail: jest.fn(() => Promise.resolve(true)) as PostOffice,
domain: 'example.com',
customContext: {