This repository has been archived by the owner on Jun 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 360
feat(client, db): event url #423
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7aef5fa
add nullable url column to model, create migration to add url column …
gh-23378 9fb800c
update UI to display event url
gh-23378 a688f86
conditionally render anchor if event has a url, add missing type info
gh-23378 b7a2709
event url validation
gh-23378 a1f1d30
handle empty strings event urls
gh-23378 5b2c4b7
remove URL validation
gh-23378 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -63,6 +63,7 @@ export type Event = { | |
updated_at: Scalars['DateTime']; | ||
name: Scalars['String']; | ||
description: Scalars['String']; | ||
url?: Maybe<Scalars['String']>; | ||
start_at: Scalars['DateTime']; | ||
ends_at: Scalars['DateTime']; | ||
canceled: Scalars['Boolean']; | ||
|
@@ -280,6 +281,7 @@ export type UpdateVenueInputs = { | |
export type CreateEventInputs = { | ||
name: Scalars['String']; | ||
description: Scalars['String']; | ||
url: Scalars['String']; | ||
start_at: Scalars['DateTime']; | ||
ends_at: Scalars['DateTime']; | ||
capacity: Scalars['Float']; | ||
|
@@ -290,6 +292,7 @@ export type CreateEventInputs = { | |
export type UpdateEventInputs = { | ||
name?: Maybe<Scalars['String']>; | ||
description?: Maybe<Scalars['String']>; | ||
url?: Maybe<Scalars['String']>; | ||
start_at?: Maybe<Scalars['DateTime']>; | ||
ends_at?: Maybe<Scalars['DateTime']>; | ||
capacity?: Maybe<Scalars['Float']>; | ||
|
@@ -302,7 +305,7 @@ export type EventsQuery = { __typename?: 'Query' } & { | |
events: Array< | ||
{ __typename?: 'Event' } & Pick< | ||
Event, | ||
'id' | 'name' | 'canceled' | 'description' | 'capacity' | ||
'id' | 'name' | 'canceled' | 'description' | 'url' | 'capacity' | ||
> & { | ||
tags?: Maybe<Array<{ __typename?: 'Tag' } & Pick<Tag, 'id' | 'name'>>>; | ||
} | ||
|
@@ -320,6 +323,7 @@ export type EventQuery = { __typename?: 'Query' } & { | |
| 'id' | ||
| 'name' | ||
| 'description' | ||
| 'url' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to sort these alphabetically? |
||
| 'canceled' | ||
| 'capacity' | ||
| 'start_at' | ||
|
@@ -356,7 +360,13 @@ export type EventVenuesQuery = { __typename?: 'Query' } & { | |
event?: Maybe< | ||
{ __typename?: 'Event' } & Pick< | ||
Event, | ||
'id' | 'name' | 'description' | 'capacity' | 'start_at' | 'ends_at' | ||
| 'id' | ||
| 'name' | ||
| 'description' | ||
| 'url' | ||
| 'capacity' | ||
| 'start_at' | ||
| 'ends_at' | ||
> & { | ||
tags?: Maybe<Array<{ __typename?: 'Tag' } & Pick<Tag, 'id' | 'name'>>>; | ||
venue: { __typename?: 'Venue' } & Pick<Venue, 'id'>; | ||
|
@@ -372,7 +382,7 @@ export type CreateEventMutationVariables = Exact<{ | |
export type CreateEventMutation = { __typename?: 'Mutation' } & { | ||
createEvent: { __typename?: 'Event' } & Pick< | ||
Event, | ||
'id' | 'name' | 'canceled' | 'description' | 'capacity' | ||
'id' | 'name' | 'canceled' | 'description' | 'url' | 'capacity' | ||
> & { | ||
tags?: Maybe<Array<{ __typename?: 'Tag' } & Pick<Tag, 'id' | 'name'>>>; | ||
}; | ||
|
@@ -489,6 +499,7 @@ export const EventsDocument = gql` | |
name | ||
canceled | ||
description | ||
url | ||
capacity | ||
tags { | ||
id | ||
|
@@ -547,6 +558,7 @@ export const EventDocument = gql` | |
id | ||
name | ||
description | ||
url | ||
canceled | ||
capacity | ||
start_at | ||
|
@@ -627,6 +639,7 @@ export const EventVenuesDocument = gql` | |
id | ||
name | ||
description | ||
url | ||
capacity | ||
start_at | ||
ends_at | ||
|
@@ -698,6 +711,7 @@ export const CreateEventDocument = gql` | |
name | ||
canceled | ||
description | ||
url | ||
capacity | ||
tags { | ||
id | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ import Actions from './Actions'; | |
interface IEventItemProps { | ||
event: Pick< | ||
Event, | ||
'id' | 'name' | 'description' | 'capacity' | 'canceled' | ||
'id' | 'name' | 'description' | 'url' | 'capacity' | 'canceled' | ||
> & { tags?: Pick<Tag, 'id' | 'name'>[] | null }; | ||
loading: boolean; | ||
} | ||
|
@@ -37,6 +37,7 @@ const EventItem: React.FC<IEventItemProps> = ({ loading, event }) => { | |
<Typography variant="body2" color="textSecondary" component="p"> | ||
{event.description} | ||
</Typography> | ||
{event.url && <a href={event.url}>{event.url}</a>} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps worth to wrap in a |
||
<Typography variant="body2" color="textSecondary" component="p"> | ||
{event.capacity} | ||
</Typography> | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ export const EventPage: NextPage = () => { | |
{loading | ||
? 'Loading...' | ||
: !error | ||
? 'Cant find event :(' | ||
? "Can't find event :(" | ||
timmyichen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
: 'Error...'} | ||
</h1> | ||
</Skeleton> | ||
|
@@ -48,6 +48,7 @@ export const EventPage: NextPage = () => { | |
<Typography variant="body2" color="textSecondary" component="p"> | ||
{data.event.description} | ||
</Typography> | ||
<a href={data.event.url}>{data.event.url}</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps worth to wrap in a |
||
<Typography variant="body2" color="textSecondary" component="p"> | ||
{data.event.capacity} | ||
</Typography> | ||
|
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,13 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AddUrlColumnToEvent1603576293055 implements MigrationInterface { | ||
name = 'AddUrlColumnToEvent1603576293055'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "events" ADD "url" character varying`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN "url"`); | ||
} | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have these ordered alphabetically?
(The OCD in me. Would not block a merge IMHO).