Allow to register custom categories

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-03-28 20:02:43 +02:00
parent f5bdedf789
commit 368911b58e
40 changed files with 4587 additions and 725 deletions

View File

@@ -34,6 +34,7 @@
<div class="flex flex-wrap gap-4">
<b-field
v-if="config"
:label="$t('Category')"
label-for="category"
class="w-full md:max-w-fit"
@@ -44,7 +45,7 @@
expanded
>
<option
v-for="category in eventCategories"
v-for="category in config.eventCategories"
:value="category.id"
:key="category.id"
>
@@ -665,7 +666,6 @@ import { USER_SETTINGS } from "@/graphql/user";
import { IUser } from "@/types/current-user.model";
import { IAddress } from "@/types/address.model";
import { LOGGED_USER_PARTICIPATIONS } from "@/graphql/participant";
import { eventCategories } from "@/utils/categories";
const DEFAULT_LIMIT_NUMBER_OF_PLACES = 10;
@@ -775,8 +775,6 @@ export default class EditEvent extends Vue {
formatList = formatList;
eventCategories = eventCategories;
@Watch("eventId", { immediate: true })
resetFormForCreation(eventId: string): void {
if (eventId === undefined) {

View File

@@ -507,7 +507,6 @@ import { IEventMetadataDescription } from "@/types/event-metadata";
import { eventMetaDataList } from "../../services/EventMetadata";
import { USER_SETTINGS } from "@/graphql/user";
import { IUser } from "@/types/current-user.model";
import { eventCategories } from "@/utils/categories";
// noinspection TypeScriptValidateTypes
@Component({
@@ -1138,7 +1137,7 @@ export default class Event extends EventMixin {
if (this.event?.category === "MEETING") {
return undefined;
}
return eventCategories.find((eventCategory) => {
return this.config.eventCategories.find((eventCategory) => {
return eventCategory.id === this.event?.category;
})?.label as string;
}