-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #890 from ubyssey/peter/widget-fields
Automatically connect field schemas
- Loading branch information
Showing
10 changed files
with
188 additions
and
129 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
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
9 changes: 8 additions & 1 deletion
9
dispatch/static/manager/src/js/components/fields/ArticleField.js
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,12 +1,19 @@ | ||
import React from 'react' | ||
|
||
import { articleSchema } from '../../constants/Schemas' | ||
|
||
import ArticleSelectInput from '../inputs/selects/ArticleSelectInput' | ||
|
||
export default function ArticleField(props) { | ||
function ArticleField(props) { | ||
return ( | ||
<ArticleSelectInput | ||
value={props.data} | ||
many={props.field.many} | ||
onChange={selected => props.onChange(selected)} /> | ||
) | ||
} | ||
|
||
ArticleField.type = 'article' | ||
ArticleField.schema = articleSchema | ||
|
||
export default ArticleField |
9 changes: 8 additions & 1 deletion
9
dispatch/static/manager/src/js/components/fields/EventField.js
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,12 +1,19 @@ | ||
import React from 'react' | ||
|
||
import { eventSchema } from '../../constants/Schemas' | ||
|
||
import EventSelectInput from '../inputs/selects/EventSelectInput' | ||
|
||
export default function EventField(props) { | ||
function EventField(props) { | ||
return ( | ||
<EventSelectInput | ||
value={props.data} | ||
many={props.field.many} | ||
onChange={selected => props.onChange(selected)} /> | ||
) | ||
} | ||
|
||
EventField.type = 'event' | ||
EventField.schema = eventSchema | ||
|
||
export default EventField |
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
9 changes: 8 additions & 1 deletion
9
dispatch/static/manager/src/js/components/fields/PodcastField.js
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,12 +1,19 @@ | ||
import React from 'react' | ||
|
||
import { podcastEpisodeSchema } from '../../constants/Schemas' | ||
|
||
import PodcastEpisodeSelectInput from '../inputs/selects/PodcastEpisodeSelectInput' | ||
|
||
export default function PodcastField(props) { | ||
function PodcastField(props) { | ||
return ( | ||
<PodcastEpisodeSelectInput | ||
value={props.data} | ||
many={props.field.many} | ||
onChange={selected => props.onChange(selected)} /> | ||
) | ||
} | ||
|
||
PodcastField.type = 'podcast' | ||
PodcastField.schema = podcastEpisodeSchema | ||
|
||
export default PodcastField |
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,12 +1,19 @@ | ||
import React from 'react' | ||
|
||
import { pollSchema } from '../../constants/Schemas' | ||
|
||
import PollSelectInput from '../inputs/selects/PollSelectInput' | ||
|
||
export default function PollField(props) { | ||
function PollField(props) { | ||
return ( | ||
<PollSelectInput | ||
value={props.data} | ||
many={props.field.many} | ||
onChange={selected => props.onChange(selected)} /> | ||
) | ||
} | ||
|
||
PollField.type = 'poll' | ||
PollField.schema = pollSchema | ||
|
||
export default PollField |
9 changes: 8 additions & 1 deletion
9
dispatch/static/manager/src/js/components/fields/TopicField.js
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,12 +1,19 @@ | ||
import React from 'react' | ||
|
||
import { topicSchema } from '../../constants/Schemas' | ||
|
||
import TopicSelectInput from '../inputs/selects/TopicSelectInput' | ||
|
||
export default function TopicField(props) { | ||
function TopicField(props) { | ||
return ( | ||
<TopicSelectInput | ||
value={props.data} | ||
many={props.field.many} | ||
update={selected => props.onChange(selected)} /> | ||
) | ||
} | ||
|
||
TopicField.type = 'topic' | ||
TopicField.schema = topicSchema | ||
|
||
export default TopicField |
Oops, something went wrong.