Skip to content

Website post discord #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/ui/api-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ input CreateProductionInput {
startTime: DateTime
teamNotes: String
thumbnailId: BigInt
useDiscord: Boolean!
useDiscord: Boolean
}

input CreateProductionRSVPInput {
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/components/category/CategoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<template #default>
<CreateCategoryCard
closable
@save="(id: number) => {
@save="(category: Category) => {
showCreatePopup = false;
refresh();
createdCategory = { id: id, show: true };
createdCategory = { id: category.id, show: true };
}"
@close="showCreatePopup = false"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/category/CreateCategoryCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function nextStep() {
return;
}

emit("save", createdCategory?.data?.category.id);
emit("save", createdCategory?.data?.category);
}
}
</script>
Expand Down
3 changes: 1 addition & 2 deletions apps/ui/src/components/image/CreateImageCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ async function nextStep() {
error.value = "Failed to create image";
return;
}

emit("save", createdImage?.data?.image.id);
emit("save", createdImage?.data?.image);
}
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/components/image/ImageList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<template #default>
<CreateImageCard
closable
@save="(id: number) => {
@save="(image: Image) => {
showCreatePopup = false;
refresh();
createdImage = { id: id, show: true };
createdImage = { id: image.id, show: true };
}"
@close="showCreatePopup = false"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/person/CreatePersonCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async function validate(next: () => void) {
return;
}
loading.value = false;
emit("save", createdPerson?.data?.person.id);
emit("save", createdPerson?.data?.person);
}

const checkDisable = computed(() => {
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/components/person/PersonList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
>
<template #default>
<CreatePersonCard
@save="(id: number) => {
@save="(person: Person) => {
showCreatePopup = false;
refresh();
createdPerson = { id: id, show: true };
createdPerson = { id: person.id, show: true };
}"
/>
</template>
Expand Down
8 changes: 5 additions & 3 deletions apps/ui/src/components/production/CreateProductionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
@setThumbnail="setThumbnail"
@addImage="addImage"
/>
<ImageRow :productionThumbnail="productionData.thumbnail as Image" :productionImages="productionImages" @close="productionData.thumbnailId = null" />
<ImageRow :productionThumbnail="productionData.thumbnail as Image" :productionImages="productionImages"
@close="productionData.thumbnail = {}; productionData.thumbnailId = null;" />
</v-stepper-window-item>
<v-stepper-window-item :value="5">
<VideoTable :productionName="productionData.name as string" :productionVideos="productionVideos" :take="take" @addVideo="addVideo" />
Expand All @@ -61,7 +62,7 @@
</v-stepper-window-item>
</v-stepper-window>
<v-stepper-actions @click:next="validate(next)" @click:prev="prev" prev-text="PREVIOUS" :next-text="step >= 7 ? 'CREATE' : 'NEXT'"
:disabled="loading ? 'next' : step <= 1 ? 'prev' : false">
:disabled="loading ? 'next' : step <= 1 ? 'prev' : false">
</v-stepper-actions>
</template>
</v-stepper>
Expand Down Expand Up @@ -299,7 +300,8 @@ function addPerson(person: Person) {

watch(productionData, async () => {
if (requiredForm.value) {
const valid = await requiredForm.value.validate();
await requiredForm.value.validate()
const valid = await requiredForm.value.validate();
validation.value = valid.valid && !!productionData.value.eventLocation && !!productionData.value.startTime && !!productionData.value.endTime;
}
}, {deep: true});
Expand Down
8 changes: 5 additions & 3 deletions apps/ui/src/components/production/EditProductionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@
<CategoryTable :take="take" :productionCategory="productionData.category as Category"
@setCategory="(category: Category) => { productionData.category = category; productionData.categoryId = category.id }"
/>
<CategoryRow :productionCategory="productionData.category as Category" @close="productionData.category = {}; productionData.categoryId = null;" />
<CategoryRow :productionCategory="productionData.category as Category"
@close="productionData.category = {}; productionData.categoryId = null;" />
</v-stepper-window-item>
<v-stepper-window-item :value="4" >
<ImageTable :take="take" :productionImages="newProductionImages" :thumbnail="productionData.thumbnail as Image"
@setThumbnail="setThumbnail"
@addImage="addImage"
/>
<ImageRow :productionThumbnail="productionData.thumbnail as Image" :productionImages="newProductionImages" @close="productionData.thumbnail = {}" />
<ImageRow :productionThumbnail="productionData.thumbnail as Image" :productionImages="newProductionImages"
@close="productionData.thumbnail = {}; productionData.thumbnailId = null" />
</v-stepper-window-item>
<v-stepper-window-item :value="5">
<VideoTable :productionVideos="newProductionVideos" :take="take" @addVideo="addVideo" />
<VideoTable :productionVideos="newProductionVideos" :take="take" :productionName="productionData.name as string" @addVideo="addVideo" />
<VideoRow :productionVideos="newProductionVideos" />
</v-stepper-window-item>
<v-stepper-window-item :value="6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
>
<CreateCategoryCard
closable
@save="
@save="(category: Category) => {
emit('setCategory', category);
refresh();
showCreatePopup = false;
"
}"
@close="showCreatePopup = false"
/>
<template #trigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<v-dialog width="400" scrim="black">
<template v-slot:activator="{ props }" >
<v-chip v-tooltip="'Click to view image'" v-bind="props" class="ml-3" closable
@click:close="emit('close')">
@click:close="emit('close')">
Image ID: {{ productionThumbnail.id }}
</v-chip>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
>
<CreateImageCard
closable
@save="
@save="(image: Image) => {
emit('addImage', image);
refresh();
showCreatePopup = false;
"
}"
@close="showCreatePopup = false"
/>
<template #trigger>
Expand Down Expand Up @@ -46,10 +47,9 @@
<VBtn variant="outlined" class="text-none mr-2" :disabled="thumbnail.id === item.id"
@click="emit('setThumbnail', item)" color="blue">Set As Thumbnail</VBtn>
<VBtn variant="outlined" class="text-none"
:disabled="productionImages.findIndex(
(ele) => ele.imageId === item.id && ele.image?.path === item.path) !== -1 ||
!ability.can(AbilityActions.Create, subject(AbilitySubjects.ProductionImage, {imageId: item.id}))"
@click="emit('addImage', item, item.id)">
:disabled="productionImages.findIndex((ele) => ele.imageId === item.id) !== -1 ||
!ability.can(AbilityActions.Create, subject(AbilitySubjects.ProductionImage, {imageId: item.id}))"
@click="emit('addImage', item)">
Add Image
</VBtn>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
:to="{ name: 'dashboard-category-create' }"
>
<CreatePersonCard
@save="
@save="(person: Person) => {
emit('addPerson', person);
refresh();
showCreatePopup = false;
"
}"
/>
<template #trigger>
<v-btn class="top-button text-none" variant="outlined" rounded color="green"
Expand Down Expand Up @@ -61,12 +62,12 @@
import DashboardSearch from "@/components/DashboardSearch.vue";
import { ability, AbilityActions } from "@/casl";
import {
AbilitySubjects,
PersonOrderableFields,
OrderDirection,
FindPeopleDocument, CaseSensitivity
AbilitySubjects,
PersonOrderableFields,
OrderDirection,
FindPeopleDocument, CaseSensitivity
} from "@/graphql/types";
import type { Credit } from "@/graphql/types";
import type { Credit, Person } from "@/graphql/types";
import { useQuery } from "@vue/apollo-composable";
import {subject} from "@casl/ability";
import RouterPopup from "@/components/util/RouterPopup.vue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<CreateVideoCard
closable
:videoName="props.productionName"
@save="
refresh();
showCreatePopup = false;
"
@save="(video: Video) => {
emit('addVideo', video);
refresh();
showCreatePopup = false;
}"
@close="showCreatePopup = false"
/>
<template #trigger>
Expand Down Expand Up @@ -45,8 +46,8 @@
</template>
<template #item.actions="{ item }">
<VBtn variant="outlined" class="text-none"
:disabled="(productionVideos.findIndex((ele) => ele.videoId === item.id) !== -1)
|| !ability.can(AbilityActions.Create, subject(AbilitySubjects.ProductionVideo, {videoId: item.id}))"
:disabled="(productionVideos.findIndex((ele) => ele.videoId === item.id) !== -1) ||
!ability.can(AbilityActions.Create, subject(AbilitySubjects.ProductionVideo, {videoId: item.id}))"
@click="emit('addVideo', item)">Add Video</VBtn>

</template>
Expand All @@ -63,13 +64,13 @@
<script setup lang="ts">
import ProductionSearch from "@/components/DashboardSearch.vue";
import {
AbilitySubjects,
CaseSensitivity,
OrderDirection,
SearchVideosDocument,
VideoOrderableFields
AbilitySubjects,
CaseSensitivity,
OrderDirection,
SearchVideosDocument,
VideoOrderableFields
} from "@/graphql/types";
import type { ProductionVideo } from "@/graphql/types";
import type { ProductionVideo, Video } from "@/graphql/types";
import {useQuery} from "@vue/apollo-composable";
import {ref, watch, onMounted} from "vue";
import type {PropType} from "vue";
Expand Down
10 changes: 7 additions & 3 deletions apps/ui/src/components/production/ProductionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ import {
OrderDirection,
ProductionOrderableFields,
CaseSensitivity,
DeleteProductionRsvpDocument, ProductionDetailsDocument,
DeleteProductionRsvpDocument, ProductionDetailsDocument, DeleteCreditDocument,
} from "@/graphql/types";
import type {Production} from "@/graphql/types"
import RouterPopup from "@/components/util/RouterPopup.vue";
Expand Down Expand Up @@ -178,6 +178,7 @@ const deleteTag = useMutation(DeleteProductionTagDocument);
const deleteImage = useMutation(DeleteProductionImageDocument);
const deleteVideo = useMutation(DeleteProductionVideoDocument);
const deleteRSVP = useMutation(DeleteProductionRsvpDocument);
const deleteCredit = useMutation(DeleteCreditDocument);
const queryData = useQuery(SearchProductionsDocument, {
pagination: {
take: take,
Expand Down Expand Up @@ -266,20 +267,23 @@ async function deleteProduction(productionId: number) {
const images = production.images;
const videos = production.videos;
const rsvps = production.rsvps;
const credits = production.credits;
if (images)
for (const image of images)
await deleteImage.mutate({id: parseInt(image.id)});

if (tags)
for (const tag of tags)
await deleteTag.mutate({id: parseInt(tag.id)});

if (videos)
for (const video of videos)
await deleteVideo.mutate({id: parseInt(video.id)});
if (credits)
for (const credit of credits)
await deleteCredit.mutate({id: parseInt(credit.id)});
if (rsvps)
for (const rsvp of rsvps)
await deleteRSVP.mutate({id: parseInt(rsvp.id)});


await deleteMutation.mutate({id: parseInt(production.id)});

Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/util/RouterPopup.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-dialog v-model="isPopupShown" :style="`width: min(${maxWidth}px, 80%); z-index: 1500`" scrim="black" scrollable>
<v-dialog v-model="isPopupShown" :style="`width: clamp(60vw, ${maxWidth}px, 80vw); z-index: 1500;" scrim="black" scrollable>
<slot name="default"/>
</v-dialog>
<RouterLink v-if="to"
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/components/video/CreateVideoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const steps = [
const currentStep = ref(1);
const error = ref<string | null>(null);

const videoDetailsInput = ref<VideoDetailsInput | null>(null);
const videoDetailsInput = ref<typeof VideoDetailsInput | null>(null);
const videoData = ref<Partial<Video>>({
name: props.videoName ?? "",
format: "EMBED",
Expand Down Expand Up @@ -186,7 +186,7 @@ async function nextStep() {
return;
}

emit("save", createdVideo?.data?.video.id);
emit("save", createdVideo?.data?.video);
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/video/VideoDetailsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import {
NGridItem,
} from "naive-ui";
import { computed, h, PropType, ref, VNode, watch } from "vue";
import { Video } from "@/graphql/types";
import type { Video } from "@/graphql/types";
import { FormRules } from "naive-ui";

const props = defineProps({
Expand Down
5 changes: 2 additions & 3 deletions apps/ui/src/components/video/VideoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<template #default>
<CreateVideoCard
closable
@save="(id: number) => {
@save="(video: Video) => {
showCreatePopup = false;
refresh();
createdVideo = { id: id, show: true };
createdVideo = { id: video.id, show: true };
}"
@close="showCreatePopup = false"
/>
Expand Down Expand Up @@ -56,7 +56,6 @@
v-if="ability.can(AbilityActions.Update, subject(AbilitySubjects.Video, {
id: item.id,
name: item.name,
priority: item.priority
}))"
:max-width="1100" v-model="list[index]"
:to="{ name: 'dashboard-video-details-edit', params: {id: item.id } }"
Expand Down
3 changes: 2 additions & 1 deletion apps/ui/src/graphql/CreateCategory.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mutation CreateCategory($data: CreateCategoryInput!) {
category: createCategory(input: $data) {
id
id
name
}
}
5 changes: 4 additions & 1 deletion apps/ui/src/graphql/CreateImage.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
mutation CreateImage($data: CreateImageInput!) {
image: createImage(input: $data) {
id
id
name
description
path
}
}
3 changes: 2 additions & 1 deletion apps/ui/src/graphql/CreatePerson.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mutation CreatePerson($data: CreatePersonInput!) {
person: createPerson(input: $data) {
id
id
name
}
}
4 changes: 3 additions & 1 deletion apps/ui/src/graphql/CreateVideo.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
mutation CreateVideo($data: CreateVideoInput!) {
video: createVideo(input: $data) {
id
id
name
metadata
}
}
Loading