Removed tags

This commit is contained in:
DrMint 2024-05-16 20:35:26 +02:00
parent 2c4842244d
commit ab2032ff0c
7 changed files with 16 additions and 54 deletions

View File

@ -3,7 +3,6 @@ import { attributesField } from "../../fields/attributesField/attributesField";
import { creditsField } from "../../fields/creditsField/creditsField";
import { imageField } from "../../fields/imageField/imageField";
import { rowField } from "../../fields/rowField/rowField";
import { tagsField } from "../../fields/tagsField/tagsField";
import { translatedFields } from "../../fields/translatedFields/translatedFields";
import { buildCollectionConfig } from "../../utils/collectionConfig";
import { createEditor } from "../../utils/editor";
@ -21,7 +20,6 @@ const fields = {
translationsDescription: "description",
thumbnail: "thumbnail",
duration: "duration",
tags: "tags",
attributes: "attributes",
credits: "credits",
};
@ -73,7 +71,6 @@ export const Audios = buildCollectionConfig({
},
],
}),
tagsField({ name: fields.tags }),
attributesField({ name: fields.attributes }),
creditsField({ name: fields.credits }),
],

View File

@ -14,7 +14,6 @@ import { creditsField } from "../../fields/creditsField/creditsField";
import { imageField } from "../../fields/imageField/imageField";
import { rowField } from "../../fields/rowField/rowField";
import { slugField } from "../../fields/slugField/slugField";
import { tagsField } from "../../fields/tagsField/tagsField";
import { translatedFields } from "../../fields/translatedFields/translatedFields";
import { beforeDuplicateAddCopyTo } from "../../hooks/beforeDuplicateAddCopyTo";
import { beforeDuplicatePiping } from "../../hooks/beforeDuplicatePiping";
@ -34,7 +33,6 @@ const fields = {
thumbnail: "thumbnail",
backgroundImage: "backgroundImage",
nature: "nature",
tags: "tags",
attributes: "attributes",
languages: "languages",
@ -190,7 +188,6 @@ export const Collectibles = buildVersionedCollectionConfig({
},
]),
tagsField({ name: fields.tags }),
attributesField({ name: fields.attributes }),
translatedFields({

View File

@ -2,7 +2,6 @@ import { Collections } from "../../constants";
import { attributesField } from "../../fields/attributesField/attributesField";
import { creditsField } from "../../fields/creditsField/creditsField";
import { rowField } from "../../fields/rowField/rowField";
import { tagsField } from "../../fields/tagsField/tagsField";
import { translatedFields } from "../../fields/translatedFields/translatedFields";
import { createEditor } from "../../utils/editor";
import { buildImageCollectionConfig } from "../../utils/imageCollectionConfig";
@ -19,7 +18,6 @@ const fields = {
translationsTitle: "title",
translationsSubtitle: "subtitle",
translationsDescription: "description",
tags: "tags",
attributes: "attributes",
credits: "credits",
} as const satisfies Record<string, string>;
@ -65,7 +63,6 @@ export const Images = buildImageCollectionConfig({
},
],
}),
tagsField({ name: fields.tags }),
attributesField({ name: fields.attributes }),
creditsField({ name: fields.credits }),
],

View File

@ -10,7 +10,6 @@ import { creditsField } from "../../fields/creditsField/creditsField";
import { imageField } from "../../fields/imageField/imageField";
import { rowField } from "../../fields/rowField/rowField";
import { slugField } from "../../fields/slugField/slugField";
import { tagsField } from "../../fields/tagsField/tagsField";
import { translatedFields } from "../../fields/translatedFields/translatedFields";
import { beforeDuplicateAddCopyTo } from "../../hooks/beforeDuplicateAddCopyTo";
import { beforeDuplicatePiping } from "../../hooks/beforeDuplicatePiping";
@ -24,7 +23,6 @@ const fields = {
thumbnail: "thumbnail",
backgroundImage: "backgroundImage",
translations: "translations",
tags: "tags",
attributes: "attributes",
sourceLanguage: "sourceLanguage",
pretitle: "pretitle",
@ -50,7 +48,6 @@ export const Pages = buildVersionedCollectionConfig({
fields.slug,
fields.thumbnail,
fields.backgroundImage,
fields.tags,
fields.translations,
fields.folders,
],
@ -90,7 +87,6 @@ export const Pages = buildVersionedCollectionConfig({
},
}),
]),
tagsField({ name: fields.tags }),
attributesField({ name: fields.attributes }),
translatedFields({
name: fields.translations,

View File

@ -4,7 +4,6 @@ import { componentField } from "../../fields/componentField/componentField";
import { creditsField } from "../../fields/creditsField/creditsField";
import { imageField } from "../../fields/imageField/imageField";
import { rowField } from "../../fields/rowField/rowField";
import { tagsField } from "../../fields/tagsField/tagsField";
import { translatedFields } from "../../fields/translatedFields/translatedFields";
import { buildCollectionConfig } from "../../utils/collectionConfig";
import { createEditor } from "../../utils/editor";
@ -23,7 +22,6 @@ const fields = {
translationsSubfile: "subfile",
thumbnail: "thumbnail",
duration: "duration",
tags: "tags",
attributes: "attributes",
platform: "platform",
platformChannel: "channel",
@ -88,7 +86,6 @@ export const Videos = buildCollectionConfig({
},
],
}),
tagsField({ name: fields.tags }),
attributesField({ name: fields.attributes }),
creditsField({ name: fields.credits }),
componentField({

View File

@ -1,17 +0,0 @@
import { FieldBase, SingleRelationshipField } from "payload/dist/fields/config/types";
import { Collections } from "../../constants";
type KeysField = FieldBase & {
admin?: SingleRelationshipField["admin"];
};
export const tagsField = ({ admin, ...props }: KeysField): SingleRelationshipField => ({
...props,
admin: {
allowCreate: false,
...admin,
},
type: "relationship",
hasMany: true,
relationTo: Collections.Tags,
});

View File

@ -55,7 +55,6 @@ export interface Page {
slug: string;
thumbnail?: string | Image | null;
backgroundImage?: string | Image | null;
tags?: (string | Tag)[] | null;
attributes?: (TagsBlock | NumberBlock | TextBlock)[] | null;
translations: {
language: string | Language;
@ -133,7 +132,6 @@ export interface Image {
id?: string | null;
}[]
| null;
tags?: (string | Tag)[] | null;
attributes?: (TagsBlock | NumberBlock | TextBlock)[] | null;
credits?: Credits;
updatedAt: string;
@ -171,22 +169,6 @@ export interface Language {
id: string;
name: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "tags".
*/
export interface Tag {
id: string;
slug: string;
page?: (string | null) | Page;
translations: {
language: string | Language;
name: string;
id?: string | null;
}[];
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "TagsBlock".
@ -215,6 +197,22 @@ export interface Attribute {
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "tags".
*/
export interface Tag {
id: string;
slug: string;
page?: (string | null) | Page;
translations: {
language: string | Language;
name: string;
id?: string | null;
}[];
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "NumberBlock".
@ -373,7 +371,6 @@ export interface Collectible {
thumbnail?: string | Image | null;
nature: "Physical" | "Digital";
languages?: (string | Language)[] | null;
tags?: (string | Tag)[] | null;
attributes?: (TagsBlock | NumberBlock | TextBlock)[] | null;
translations: {
language: string | Language;
@ -638,7 +635,6 @@ export interface Audio {
} | null;
id?: string | null;
}[];
tags?: (string | Tag)[] | null;
attributes?: (TagsBlock | NumberBlock | TextBlock)[] | null;
credits?: Credits;
updatedAt: string;
@ -714,7 +710,6 @@ export interface Video {
subfile?: string | VideoSubtitle | null;
id?: string | null;
}[];
tags?: (string | Tag)[] | null;
attributes?: (TagsBlock | NumberBlock | TextBlock)[] | null;
credits?: Credits;
platformEnabled?: boolean | null;