Introduce relay

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-30 16:40:59 +02:00
parent 56467301a1
commit c51115bdbe
54 changed files with 3100 additions and 1038 deletions

View File

@@ -98,6 +98,7 @@ export default class App extends Vue {
@import "~buefy/src/scss/components/tag";
@import "~buefy/src/scss/components/taginput";
@import "~buefy/src/scss/components/upload";
@import "~buefy/src/scss/components/radio";
.router-enter-active,
.router-leave-active {

View File

@@ -145,7 +145,8 @@ export const CREATE_EVENT = gql`
$beginsOn: DateTime!,
$picture: PictureInput,
$tags: [String],
$physicalAddress: AddressInput!
$physicalAddress: AddressInput,
$visibility: EventVisibility
) {
createEvent(
title: $title,
@@ -155,7 +156,8 @@ export const CREATE_EVENT = gql`
category: $category,
picture: $picture,
tags: $tags,
physicalAddress: $physicalAddress
physicalAddress: $physicalAddress,
visibility: $visibility
) {
id,
uuid,

View File

@@ -6,6 +6,11 @@
<div v-if="$apollo.loading">Loading...</div>
<div class="columns is-centered" v-else>
<form class="column is-two-thirds-desktop" @submit="createEvent">
<h2 class="subtitle">
<translate>
General informations
</translate>
</h2>
<picture-upload v-model="pictureFile" />
<b-field :label="$gettext('Title')">
@@ -34,7 +39,28 @@
</b-select>
</b-field>
<button class="button is-primary">
<h2 class="subtitle">
<translate>
Visibility
</translate>
</h2>
<label class="label">{{ $gettext('Event visibility') }}</label>
<div class="field">
<b-radio v-model="event.visibility"
name="name"
:native-value="EventVisibility.PUBLIC">
<translate>Visible everywhere on the web (public)</translate>
</b-radio>
</div>
<div class="field">
<b-radio v-model="event.visibility"
name="name"
:native-value="EventVisibility.PRIVATE">
<translate>Only accessible through link and search (private)</translate>
</b-radio>
</div>
<button class="button is-primary">
<translate>Create my event</translate>
</button>
</form>
@@ -60,6 +86,7 @@ import TagInput from '@/components/Event/TagInput.vue';
import { TAGS } from '@/graphql/tags';
import { ITag } from '@/types/tag.model';
import AddressAutoComplete from '@/components/Event/AddressAutoComplete.vue';
import { EventVisibility } from '@/types/event.model';
@Component({
components: { AddressAutoComplete, TagInput, DateTimePicker, PictureUpload, Editor },
@@ -79,6 +106,7 @@ export default class CreateEvent extends Vue {
categories: string[] = Object.keys(Category);
event: IEvent = new EventModel();
pictureFile: File | null = null;
EventVisibility = EventVisibility;
created() {
const now = new Date();
@@ -181,4 +209,4 @@ export default class CreateEvent extends Vue {
// }
// }
}
</script>
</script>