-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
695 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,25 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- run: npm ci | ||
- run: npm run test | ||
|
||
|
||
e2e-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
directory: ["services/api"] | ||
defaults: | ||
run: | ||
working-directory: ${{ matrix.directory }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: rrainn/[email protected] | ||
with: | ||
port: 8001 | ||
- run: npm ci | ||
- run: npm run test:e2e | ||
|
||
build-api: | ||
needs: [lint, test] | ||
needs: [lint, test, e2e-test] | ||
if: github.ref == 'refs/heads/develop' | ||
uses: jbrunton/workflows/.github/workflows/build-image.yml@develop | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
import { List, ListIcon, ListItem } from '@chakra-ui/react' | ||
import React from 'react' | ||
import { Message } from '../../data/messages' | ||
import { Message, User } from '../../data/messages' | ||
import { UserIcon } from '../icons/User' | ||
|
||
export type MessagesListProps = { | ||
messages: Message[] | ||
data: { | ||
messages: Message[] | ||
authors: Record<string, User> | ||
} | ||
} | ||
|
||
export const MessagesList: React.FC<MessagesListProps> = ({ messages }) => { | ||
export const MessagesList: React.FC<MessagesListProps> = ({ data: { messages, authors } }) => { | ||
return ( | ||
<List spacing={3}> | ||
{messages.map((message) => ( | ||
<ListItem key={message.id}> | ||
<ListIcon as={UserIcon} color='green.500' /> | ||
{message.content} | ||
</ListItem> | ||
))} | ||
{messages.map((message) => { | ||
const author = authors[message.authorId] | ||
return ( | ||
<ListItem key={message.id}> | ||
<ListIcon as={UserIcon} color='green.500' /> | ||
<span>{author?.name ?? 'Anon'}: </span> | ||
{message.content} | ||
</ListItem> | ||
) | ||
})} | ||
</List> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { DataModule } from '../../src/data/data.module'; | ||
import { DynamoDBAdapter } from '../../src/data/adapters/dynamodb.adapter'; | ||
import { runWithContext } from '../runWithContext'; | ||
|
||
runWithContext({ | ||
rootModule: DataModule, | ||
run: async (app, logger) => { | ||
const db = app.get(DynamoDBAdapter); | ||
const { TableDescription } = await db.destroy(); | ||
logger.log( | ||
`Dropped table ${TableDescription?.TableName} (${TableDescription?.TableArn})`, | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { DynamoDBAdapter } from '../../src/data/adapters/dynamodb.adapter'; | ||
import { DataModule } from '../../src/data/data.module'; | ||
import { runWithContext } from '../runWithContext'; | ||
|
||
runWithContext({ | ||
rootModule: DataModule, | ||
run: async (app, logger) => { | ||
const db = app.get(DynamoDBAdapter); | ||
const { TableDescription } = await db.create(); | ||
logger.log( | ||
`Created table ${TableDescription?.TableName} (${TableDescription?.TableArn})`, | ||
); | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.