diff --git a/packages/payload/src/admin/forms/RowLabel.ts b/packages/payload/src/admin/forms/RowLabel.ts index 3fb73221e..6a7dc0533 100644 --- a/packages/payload/src/admin/forms/RowLabel.ts +++ b/packages/payload/src/admin/forms/RowLabel.ts @@ -1,5 +1,3 @@ -import type { Data } from './Form.js' - export type RowLabelComponent = React.ComponentType export type RowLabel = Record | RowLabelComponent | string diff --git a/packages/richtext-lexical/src/field/features/relationship/plugins/index.tsx b/packages/richtext-lexical/src/field/features/relationship/plugins/index.tsx index 078b2ec09..18a097fd0 100644 --- a/packages/richtext-lexical/src/field/features/relationship/plugins/index.tsx +++ b/packages/richtext-lexical/src/field/features/relationship/plugins/index.tsx @@ -39,7 +39,7 @@ export function RelationshipPlugin(props?: RelationshipFeatureProps): React.Reac enabledRelations = props?.enabledCollections } else if (props?.disabledCollections) { enabledRelations = collections - .filter(({ slug }) => !(props?.disabledCollections).includes(slug)) + .filter(({ slug }) => !props?.disabledCollections?.includes(slug)) .map(({ slug }) => slug) } diff --git a/packages/translations/src/_generatedFiles_/api/ar.js b/packages/translations/src/_generatedFiles_/api/ar.js index f382a4cbc..2c5704c44 100644 --- a/packages/translations/src/_generatedFiles_/api/ar.js +++ b/packages/translations/src/_generatedFiles_/api/ar.js @@ -44,6 +44,8 @@ export default { deletedSuccessfully: 'تمّ الحذف بنجاح.', email: 'البريد الإلكتروني', notFound: 'غير موجود', + row: 'سطر', + rows: 'أسطُر', successfullyCreated: '{{label}} تم إنشاؤها بنجاح.', successfullyDuplicated: '{{label}} تم استنساخها بنجاح.', thisLanguage: 'العربية', @@ -72,6 +74,7 @@ export default { longerThanMin: 'يجب أن يكون هذا القيمة أطول من الحد الأدنى للطول الذي هو {{minLength}} أحرف.', notValidDate: '"{{value}}" ليس تاريخا صالحا.', required: 'هذا الحقل مطلوب.', + requiresAtLeast: 'هذا الحقل يتطلب على الأقل {{count}} {{label}}.', requiresNoMoreThan: 'هذا الحقل يتطلب عدم تجاوز {{count}} {{label}}.', requiresTwoNumbers: 'هذا الحقل يتطلب رقمين.', shorterThanMax: 'يجب أن تكون هذه القيمة أقصر من الحد الأقصى للطول الذي هو {{maxLength}} أحرف.', diff --git a/packages/translations/src/_generatedFiles_/api/az.js b/packages/translations/src/_generatedFiles_/api/az.js index 749f00704..da0d2d5e1 100644 --- a/packages/translations/src/_generatedFiles_/api/az.js +++ b/packages/translations/src/_generatedFiles_/api/az.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Uğurla silindi.', email: 'Elektron poçt', notFound: 'Tapılmadı', + row: 'Sətir', + rows: 'Sətirlər', successfullyCreated: '{{label}} uğurla yaradıldı.', successfullyDuplicated: '{{label}} uğurla dublikatlandı.', thisLanguage: 'Azərbaycan dili', @@ -74,6 +76,7 @@ export default { longerThanMin: 'Bu dəyər {{minLength}} simvoldan uzun olmalıdır.', notValidDate: '"{{value}}" doğru tarix deyil.', required: 'Bu sahə mütləq doldurulmalıdır.', + requiresAtLeast: 'Bu sahə ən azı {{count}} {{label}} tələb edir.', requiresNoMoreThan: 'Bu sahə {{count}} {{label}}-dan çox olmamalıdır.', requiresTwoNumbers: 'Bu sahə iki nömrə tələb edir.', shorterThanMax: 'Bu dəyər {{maxLength}} simvoldan qısa olmalıdır.', diff --git a/packages/translations/src/_generatedFiles_/api/bg.js b/packages/translations/src/_generatedFiles_/api/bg.js index ff7816902..d14577e07 100644 --- a/packages/translations/src/_generatedFiles_/api/bg.js +++ b/packages/translations/src/_generatedFiles_/api/bg.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Изтрито успешно.', email: 'Имейл', notFound: 'Няма открит', + row: 'ред', + rows: 'Редове', successfullyCreated: '{{label}} успешно създаден.', successfullyDuplicated: '{{label}} успешно дупликиран.', thisLanguage: 'Български', @@ -74,6 +76,7 @@ export default { 'Тази стойност трябва да е по-голяма от минималната стойност от {{minLength}} символа.', notValidDate: '"{{value}}" не е валидна дата.', required: 'Това поле е задължително.', + requiresAtLeast: 'Това поле изисква поне {{count}} {{label}}.', requiresNoMoreThan: 'Това поле изисква не повече от {{count}} {{label}}.', requiresTwoNumbers: 'Това поле изисква 2 числа.', shorterThanMax: diff --git a/packages/translations/src/_generatedFiles_/api/cs.js b/packages/translations/src/_generatedFiles_/api/cs.js index 2c028b7cb..8603c9c7b 100644 --- a/packages/translations/src/_generatedFiles_/api/cs.js +++ b/packages/translations/src/_generatedFiles_/api/cs.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Úspěšně odstraněno.', email: 'E-mail', notFound: 'Nenalezeno', + row: 'Řádek', + rows: 'Řádky', successfullyCreated: '{{label}} úspěšně vytvořeno.', successfullyDuplicated: '{{label}} úspěšně duplikováno.', thisLanguage: 'Čeština', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Tato hodnota musí být delší než minimální délka {{minLength}} znaků.', notValidDate: '"{{value}}" není platné datum.', required: 'Toto pole je povinné.', + requiresAtLeast: 'Toto pole vyžaduje alespoň {{count}} {{label}}.', requiresNoMoreThan: 'Toto pole vyžaduje ne více než {{count}} {{label}}.', requiresTwoNumbers: 'Toto pole vyžaduje dvě čísla.', shorterThanMax: 'Tato hodnota musí být kratší než maximální délka {{maxLength}} znaků.', diff --git a/packages/translations/src/_generatedFiles_/api/de.js b/packages/translations/src/_generatedFiles_/api/de.js index 7338b4cc2..d68cb8b5b 100644 --- a/packages/translations/src/_generatedFiles_/api/de.js +++ b/packages/translations/src/_generatedFiles_/api/de.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Erfolgreich gelöscht.', email: 'E-Mail', notFound: 'Nicht gefunden', + row: 'Zeile', + rows: 'Zeilen', successfullyCreated: '{{label}} erfolgreich erstellt.', successfullyDuplicated: '{{label}} wurde erfolgreich dupliziert.', thisLanguage: 'Deutsch', @@ -74,6 +76,7 @@ export default { longerThanMin: 'Dieser Wert muss länger als die minimale Länge von {{minLength}} Zeichen sein.', notValidDate: '"{{value}}" ist kein gültiges Datum.', required: 'Pflichtfeld', + requiresAtLeast: 'Dieses Feld muss mindestens {{count}} {{label}} enthalten.', requiresNoMoreThan: 'Dieses Feld kann nicht mehr als {{count}} {{label}} enthalten.', requiresTwoNumbers: 'Dieses Feld muss zwei Nummern enthalten.', shorterThanMax: 'Dieser Wert muss kürzer als die maximale Länge von {{maxLength}} sein.', diff --git a/packages/translations/src/_generatedFiles_/api/en.js b/packages/translations/src/_generatedFiles_/api/en.js index 70cd36f04..2af1478ef 100644 --- a/packages/translations/src/_generatedFiles_/api/en.js +++ b/packages/translations/src/_generatedFiles_/api/en.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Deleted successfully.', email: 'Email', notFound: 'Not Found', + row: 'Row', + rows: 'Rows', successfullyCreated: '{{label}} successfully created.', successfullyDuplicated: '{{label}} successfully duplicated.', thisLanguage: 'English', @@ -73,6 +75,7 @@ export default { longerThanMin: 'This value must be longer than the minimum length of {{minLength}} characters.', notValidDate: '"{{value}}" is not a valid date.', required: 'This field is required.', + requiresAtLeast: 'This field requires at least {{count}} {{label}}.', requiresNoMoreThan: 'This field requires no more than {{count}} {{label}}.', requiresTwoNumbers: 'This field requires two numbers.', shorterThanMax: 'This value must be shorter than the max length of {{maxLength}} characters.', diff --git a/packages/translations/src/_generatedFiles_/api/es.js b/packages/translations/src/_generatedFiles_/api/es.js index d2270bf52..0ce2dea43 100644 --- a/packages/translations/src/_generatedFiles_/api/es.js +++ b/packages/translations/src/_generatedFiles_/api/es.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Borrado exitosamente.', email: 'Correo electrónico', notFound: 'No encontrado', + row: 'Fila', + rows: 'Filas', successfullyCreated: '{{label}} creado correctamente.', successfullyDuplicated: '{{label}} duplicado correctamente.', thisLanguage: 'Español', @@ -74,6 +76,7 @@ export default { longerThanMin: 'Este dato debe ser más largo que el mínimo de {{minLength}} caracteres.', notValidDate: '"{{value}}" es una fecha inválida.', required: 'Este campo es obligatorio.', + requiresAtLeast: 'Este campo require al menos {{count}} {{label}}.', requiresNoMoreThan: 'Este campo require no más de {{count}} {{label}}', requiresTwoNumbers: 'Este campo requiere dos números.', shorterThanMax: 'Este dato debe ser más corto que el máximo de {{maxLength}} caracteres.', diff --git a/packages/translations/src/_generatedFiles_/api/fa.js b/packages/translations/src/_generatedFiles_/api/fa.js index f0caa9b1d..0fea235c7 100644 --- a/packages/translations/src/_generatedFiles_/api/fa.js +++ b/packages/translations/src/_generatedFiles_/api/fa.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'با موفقیت حذف شد.', email: 'رایانامه', notFound: 'یافت نشد', + row: 'ردیف', + rows: 'ردیف‌ها', successfullyCreated: '{{label}} با موفقیت ساخته شد.', successfullyDuplicated: '{{label}} با موفقیت رونوشت شد.', thisLanguage: 'فارسی', @@ -73,6 +75,7 @@ export default { longerThanMin: 'ورودی باید بیش از حداقل {{minLength}} واژه باشد.', notValidDate: '"{{value}}" یک تاریخ معتبر نیست.', required: 'این کادر اجباری است.', + requiresAtLeast: 'این رشته حداقل نیازمند {{count}} {{label}}.', requiresNoMoreThan: 'این رشته به بیش از {{count}} {{label}} نیاز دارد.', requiresTwoNumbers: 'این کادر به دو عدد نیاز دارد.', shorterThanMax: 'ورودی باید کمتر از {{maxLength}} واژه باشد.', diff --git a/packages/translations/src/_generatedFiles_/api/fr.js b/packages/translations/src/_generatedFiles_/api/fr.js index 1dbd1c811..bd062f109 100644 --- a/packages/translations/src/_generatedFiles_/api/fr.js +++ b/packages/translations/src/_generatedFiles_/api/fr.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Supprimé(e) avec succès.', email: 'E-mail', notFound: 'Pas trouvé', + row: 'Ligne', + rows: 'Lignes', successfullyCreated: '{{label}} créé(e) avec succès.', successfullyDuplicated: '{{label}} dupliqué(e) avec succès.', thisLanguage: 'Français', @@ -75,6 +77,7 @@ export default { 'Cette valeur doit être supérieure à la longueur minimale de {{minLength}} caractères.', notValidDate: '"{{value}}" n\'est pas une date valide.', required: 'Ce champ est requis.', + requiresAtLeast: 'Ce champ doit avoir au moins {{count}} {{label}}.', requiresNoMoreThan: 'Ce champ ne doit pas avoir plus de {{count}} {{label}}.', requiresTwoNumbers: 'Ce champ doit avoir deux chiffres.', shorterThanMax: diff --git a/packages/translations/src/_generatedFiles_/api/hr.js b/packages/translations/src/_generatedFiles_/api/hr.js index 869096b27..4d2b98025 100644 --- a/packages/translations/src/_generatedFiles_/api/hr.js +++ b/packages/translations/src/_generatedFiles_/api/hr.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Uspješno obrisano.', email: 'Email', notFound: 'Nije pronađeno', + row: 'Red', + rows: 'Redovi', successfullyCreated: '{{label}} uspješno kreirano.', successfullyDuplicated: '{{label}} uspješno duplicirano.', thisLanguage: 'Hrvatski', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Ova vrijednost mora biti duža od minimalne dužine od {{minLength}} znakova', notValidDate: '"{{value}}" nije valjan datum.', required: 'Ovo polje je obvezno.', + requiresAtLeast: 'Ovo polje zahtjeva minimalno {{count}} {{label}}.', requiresNoMoreThan: 'Ovo polje zahtjeva ne više od {{count}} {{label}}.', requiresTwoNumbers: 'Ovo polje zahtjeva dva broja.', shorterThanMax: 'Ova vrijednost mora biti kraća od maksimalne dužine od {{maxLength}} znakova', diff --git a/packages/translations/src/_generatedFiles_/api/hu.js b/packages/translations/src/_generatedFiles_/api/hu.js index 21a8603d9..ba7a2ed3c 100644 --- a/packages/translations/src/_generatedFiles_/api/hu.js +++ b/packages/translations/src/_generatedFiles_/api/hu.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Sikeresen törölve.', email: 'E-mail', notFound: 'Nem található', + row: 'Sor', + rows: 'Sorok', successfullyCreated: '{{label}} sikeresen létrehozva.', successfullyDuplicated: '{{label}} sikeresen duplikálódott.', thisLanguage: 'Magyar', @@ -74,6 +76,7 @@ export default { 'Ennek az értéknek hosszabbnak kell lennie, mint a minimális {{minLength}} karakter hosszúság.', notValidDate: '" {{value}} " nem érvényes dátum.', required: 'Ez a mező kötelező.', + requiresAtLeast: 'Ehhez a mezőhöz legalább {{count}} {{label}} szükséges.', requiresNoMoreThan: 'Ehhez a mezőhöz legfeljebb {{count}} {{label}} szükséges.', requiresTwoNumbers: 'Ehhez a mezőhöz két szám szükséges.', shorterThanMax: diff --git a/packages/translations/src/_generatedFiles_/api/it.js b/packages/translations/src/_generatedFiles_/api/it.js index 8f1dba997..96b67b49e 100644 --- a/packages/translations/src/_generatedFiles_/api/it.js +++ b/packages/translations/src/_generatedFiles_/api/it.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Eliminato con successo.', email: 'Email', notFound: 'Non Trovato', + row: 'Riga', + rows: 'Righe', successfullyCreated: '{{label}} creato con successo.', successfullyDuplicated: '{{label}} duplicato con successo.', thisLanguage: 'Italiano', @@ -74,6 +76,7 @@ export default { 'Questo valore deve essere più lungo della lunghezza minima di {{minLength}} caratteri.', notValidDate: '"{{value}}" non è una data valida.', required: 'Questo campo è obbligatorio.', + requiresAtLeast: 'Questo campo richiede almeno {{count}} {{label}}.', requiresNoMoreThan: 'Questo campo richiede non più di {{count}} {{label}}.', requiresTwoNumbers: 'Questo campo richiede due numeri.', shorterThanMax: diff --git a/packages/translations/src/_generatedFiles_/api/ja.js b/packages/translations/src/_generatedFiles_/api/ja.js index e3a6f548b..4940699c2 100644 --- a/packages/translations/src/_generatedFiles_/api/ja.js +++ b/packages/translations/src/_generatedFiles_/api/ja.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: '正常に削除されました。', email: 'メールアドレス', notFound: 'Not Found', + row: '列', + rows: '列', successfullyCreated: '{{label}} が作成されました。', successfullyDuplicated: '{{label}} が複製されました。', thisLanguage: 'Japanese', @@ -73,6 +75,7 @@ export default { longerThanMin: '{{minLength}} 文字以上にする必要があります。', notValidDate: '"{{value}}" は有効な日付ではありません。', required: '必須フィールドです。', + requiresAtLeast: '少なくとも {{count}} {{label}} 以上が必要です。', requiresNoMoreThan: '最大で {{count}} {{label}} 以下にする必要があります。', requiresTwoNumbers: '2つの数値が必要です。', shorterThanMax: '{{maxLength}} 文字以下にする必要があります。', diff --git a/packages/translations/src/_generatedFiles_/api/ko.js b/packages/translations/src/_generatedFiles_/api/ko.js index 5fbd33f26..591dfcf2f 100644 --- a/packages/translations/src/_generatedFiles_/api/ko.js +++ b/packages/translations/src/_generatedFiles_/api/ko.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: '삭제되었습니다.', email: '이메일', notFound: '찾을 수 없음', + row: '행', + rows: '행', successfullyCreated: '{{label}}이(가) 생성되었습니다.', successfullyDuplicated: '{{label}}이(가) 복제되었습니다.', thisLanguage: '한국어', @@ -73,6 +75,7 @@ export default { longerThanMin: '이 값은 최소 길이인 {{minLength}}자보다 길어야 합니다.', notValidDate: '"{{value}}"은(는) 유효한 날짜가 아닙니다.', required: '이 입력란은 필수입니다.', + requiresAtLeast: '이 입력란운 최소한 {{count}} {{label}}이 필요합니다.', requiresNoMoreThan: '이 입력란은 최대 {{count}} {{label}} 이하이어야 합니다.', requiresTwoNumbers: '이 입력란은 두 개의 숫자가 필요합니다.', shorterThanMax: '이 값은 최대 길이인 {{maxLength}}자보다 짧아야 합니다.', diff --git a/packages/translations/src/_generatedFiles_/api/my.js b/packages/translations/src/_generatedFiles_/api/my.js index 1f3cd22eb..c1591f5de 100644 --- a/packages/translations/src/_generatedFiles_/api/my.js +++ b/packages/translations/src/_generatedFiles_/api/my.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'အောင်မြင်စွာ ဖျက်လိုက်ပါပြီ။', email: 'အီးမေးလ်', notFound: 'ဘာမှ မရှိတော့ဘူး။', + row: 'အတန်း', + rows: 'Rows', successfullyCreated: '{{label}} အောင်မြင်စွာဖန်တီးခဲ့သည်။', successfullyDuplicated: '{{label}} အောင်မြင်စွာ ပုံတူပွားခဲ့သည်။', thisLanguage: 'မြန်မာစာ', @@ -76,6 +78,7 @@ export default { longerThanMin: 'ဤတန်ဖိုးသည် အနိမ့်ဆုံးအရှည် {{minLength}} စာလုံးထက် ပိုရှည်ရမည်။', notValidDate: '"{{value}}" သည် တရားဝင်ရက်စွဲမဟုတ်ပါ။', required: 'ဤအကွက်ကို လိုအပ်သည်။', + requiresAtLeast: 'ဤအကွက်သည် အနည်းဆုံး {{count}} {{label}} လိုအပ်သည်', requiresNoMoreThan: 'ဤအကွက်တွင် {{count}} {{label}} ထက် မပိုရပါ။', requiresTwoNumbers: 'ဤအကွက်သည် နံပါတ်နှစ်ခု လိုအပ်ပါသည်။', shorterThanMax: 'ဤတန်ဖိုးသည် စာလုံး {{maxLength}} လုံး၏ အမြင့်ဆုံးအရှည်ထက် ပိုတိုရပါမည်။', diff --git a/packages/translations/src/_generatedFiles_/api/nb.js b/packages/translations/src/_generatedFiles_/api/nb.js index 424dfeff2..75236025d 100644 --- a/packages/translations/src/_generatedFiles_/api/nb.js +++ b/packages/translations/src/_generatedFiles_/api/nb.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Slettet.', email: 'E-post', notFound: 'Ikke funnet', + row: 'Rad', + rows: 'Rader', successfullyCreated: '{{label}} ble opprettet.', successfullyDuplicated: '{{label}} ble duplisert.', thisLanguage: 'Norsk', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Denne verdien må være lengre enn minimumslengden på {{minLength}} tegn.', notValidDate: '"{{value}}" er ikke en gyldig dato.', required: 'Dette feltet er påkrevd.', + requiresAtLeast: 'Dette feltet krever minst {{count}} {{label}}.', requiresNoMoreThan: 'Dette feltet krever maksimalt {{count}} {{label}}.', requiresTwoNumbers: 'Dette feltet krever to tall.', shorterThanMax: 'Denne verdien må være kortere enn maksimal lengde på {{maxLength}} tegn.', diff --git a/packages/translations/src/_generatedFiles_/api/nl.js b/packages/translations/src/_generatedFiles_/api/nl.js index 31ac2bcf6..47f60299d 100644 --- a/packages/translations/src/_generatedFiles_/api/nl.js +++ b/packages/translations/src/_generatedFiles_/api/nl.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Succesvol verwijderd.', email: 'E-mail', notFound: 'Niet gevonden', + row: 'Rij', + rows: 'Rijen', successfullyCreated: '{{label}} succesvol aangemaakt.', successfullyDuplicated: '{{label}} succesvol gedupliceerd.', thisLanguage: 'Nederlands', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Deze waarde moet langer zijn dan de minimale lengte van {{minLength}} tekens.', notValidDate: '"{{value}}" is geen geldige datum.', required: 'Dit veld is verplicht.', + requiresAtLeast: 'Dit veld vereist minstens {{count}} {{label}}.', requiresNoMoreThan: 'Dit veld vereist niet meer dan {{count}} {{label}}.', requiresTwoNumbers: 'Dit veld vereist twee nummers.', shorterThanMax: 'Dit veld moet korter zijn dan de maximale lengte van {{maxLength}} tekens.', diff --git a/packages/translations/src/_generatedFiles_/api/pl.js b/packages/translations/src/_generatedFiles_/api/pl.js index 44c8b0d81..032f20f82 100644 --- a/packages/translations/src/_generatedFiles_/api/pl.js +++ b/packages/translations/src/_generatedFiles_/api/pl.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Pomyślnie usunięto.', email: 'Email', notFound: 'Nie znaleziono', + row: 'Wiersz', + rows: 'Wiersze', successfullyCreated: 'Pomyślnie utworzono {{label}}.', successfullyDuplicated: 'Pomyślnie zduplikowano {{label}}', thisLanguage: 'Polski', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Ta wartość musi być dłuższa niż minimalna długość znaków: {{minLength}}.', notValidDate: '"{{value}}" nie jest prawidłową datą.', required: 'To pole jest wymagane.', + requiresAtLeast: 'To pole wymaga co najmniej {{count}} {{label}}.', requiresNoMoreThan: 'To pole może posiadać co najmniej {{count}} {{label}}.', requiresTwoNumbers: 'To pole wymaga dwóch liczb.', shorterThanMax: 'Ta wartość musi być krótsza niż maksymalna długość znaków: {{maxLength}}.', diff --git a/packages/translations/src/_generatedFiles_/api/pt.js b/packages/translations/src/_generatedFiles_/api/pt.js index 53cf7d3d3..711270cb7 100644 --- a/packages/translations/src/_generatedFiles_/api/pt.js +++ b/packages/translations/src/_generatedFiles_/api/pt.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Apagado com sucesso.', email: 'Email', notFound: 'Não Encontrado', + row: 'Linha', + rows: 'Linhas', successfullyCreated: '{{label}} criado com sucesso.', successfullyDuplicated: '{{label}} duplicado com sucesso.', thisLanguage: 'Português', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Esse valor deve ser maior do que o mínimo de {{minLength}} characters.', notValidDate: '"{{value}}" não é uma data válida.', required: 'Esse campo é obrigatório.', + requiresAtLeast: 'Esse campo requer no máximo {{count}} {{label}}.', requiresNoMoreThan: 'Esse campo requer pelo menos {{count}} {{label}}.', requiresTwoNumbers: 'Esse campo requer dois números.', shorterThanMax: 'Esse valor deve ser menor do que o máximo de {{maxLength}} caracteres.', diff --git a/packages/translations/src/_generatedFiles_/api/ro.js b/packages/translations/src/_generatedFiles_/api/ro.js index e14d76793..64dd9f747 100644 --- a/packages/translations/src/_generatedFiles_/api/ro.js +++ b/packages/translations/src/_generatedFiles_/api/ro.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Șters cu succes.', email: 'Email', notFound: 'Nu a fost găsit', + row: 'Rând', + rows: 'Rânduri', successfullyCreated: '{{label}} creat(ă) cu succes.', successfullyDuplicated: '{{label}} duplicat(ă) cu succes.', thisLanguage: 'Română', @@ -77,6 +79,7 @@ export default { 'Această valoare trebuie să fie mai mare decât lungimea minimă de {{minLength}} caractere.', notValidDate: '"{{value}}" nu este o dată valabilă.', required: 'Acest câmp este obligatoriu.', + requiresAtLeast: 'Acest domeniu necesită cel puțin {{count}} {{label}}.', requiresNoMoreThan: 'Acest câmp nu necesită mai mult de {{count}} {{label}}.', requiresTwoNumbers: 'Acest câmp necesită două numere.', shorterThanMax: diff --git a/packages/translations/src/_generatedFiles_/api/rs-latin.js b/packages/translations/src/_generatedFiles_/api/rs-latin.js index bf519d6b1..756185d0d 100644 --- a/packages/translations/src/_generatedFiles_/api/rs-latin.js +++ b/packages/translations/src/_generatedFiles_/api/rs-latin.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Uspešno izbrisano.', email: 'E-pošta', notFound: 'Nije pronađeno', + row: 'Red', + rows: 'Redovi', successfullyCreated: '{{label}} uspešno kreirano.', successfullyDuplicated: '{{label}} uspešno duplicirano.', thisLanguage: 'Srpski (latinica)', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Ova vrednost mora biti duža od minimalne dužine od {{minLength}} karaktera', notValidDate: '"{{value}}" nije validan datum.', required: 'Ovo polje je obavezno.', + requiresAtLeast: 'Ovo polje zahteva minimalno {{count}} {{label}}.', requiresNoMoreThan: 'Ovo polje zahteva ne više od {{count}} {{label}}.', requiresTwoNumbers: 'Ovo polje zahteva dva broja.', shorterThanMax: 'Ova vrednost mora biti kraća od maksimalne dužine od {{maxLength}} karaktera', diff --git a/packages/translations/src/_generatedFiles_/api/rs.js b/packages/translations/src/_generatedFiles_/api/rs.js index 6c7495e58..2bf87024f 100644 --- a/packages/translations/src/_generatedFiles_/api/rs.js +++ b/packages/translations/src/_generatedFiles_/api/rs.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Успешно избрисано.', email: 'Е-пошта', notFound: 'Није пронађено', + row: 'Ред', + rows: 'Редови', successfullyCreated: '{{label}} успешно креирано.', successfullyDuplicated: '{{label}} успешно дуплицирано.', thisLanguage: 'Српски (ћирилица)', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Ова вредност мора бити дужа од минималне дужине од {{минЛенгтх}} карактера', notValidDate: '"{{value}}" није валидан датум.', required: 'Ово поље је обавезно.', + requiresAtLeast: 'Ово поље захтева минимално {{count}} {{label}}.', requiresNoMoreThan: 'Ово поље захтева не више од {{count}} {{label}}.', requiresTwoNumbers: 'Ово поље захтева два броја.', shorterThanMax: 'Ова вредност мора бити краћа од максималне дужине од {{maxLength}} карактера', diff --git a/packages/translations/src/_generatedFiles_/api/ru.js b/packages/translations/src/_generatedFiles_/api/ru.js index bcb695f53..cb68b56fa 100644 --- a/packages/translations/src/_generatedFiles_/api/ru.js +++ b/packages/translations/src/_generatedFiles_/api/ru.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Удален успешно.', email: 'Email', notFound: 'Не найдено', + row: 'Строка', + rows: 'Строки', successfullyCreated: '{{label}} успешно создан.', successfullyDuplicated: '{{label}} успешно продублирован.', thisLanguage: 'Русский', @@ -74,6 +76,7 @@ export default { longerThanMin: 'Это значение должно быть больше минимальной длины символов: {{minLength}}.', notValidDate: '"{{value}}" это не действительная дата.', required: 'Это обязательное поле.', + requiresAtLeast: 'Это поле требует не менее {{count}} {{label}}', requiresNoMoreThan: 'Это поле требует не более {{count}} {{label}}', requiresTwoNumbers: 'В этом поле требуется два числа.', shorterThanMax: 'Это значение должно быть короче максимальной длины символов {{maxLength}}.', diff --git a/packages/translations/src/_generatedFiles_/api/sv.js b/packages/translations/src/_generatedFiles_/api/sv.js index 0c7c44c89..23b6d6d03 100644 --- a/packages/translations/src/_generatedFiles_/api/sv.js +++ b/packages/translations/src/_generatedFiles_/api/sv.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Togs bort framgångsrikt.', email: 'E-post', notFound: 'Hittades inte', + row: 'Rad', + rows: 'Rader', successfullyCreated: '{{label}} skapades framgångsrikt.', successfullyDuplicated: '{{label}} duplicerades framgångsrikt.', thisLanguage: 'Svenska', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Detta värde måste vara längre än minimilängden på {{minLength}} tecken.', notValidDate: '"{{value}}" är inte ett giltigt datum.', required: 'Detta fält är obligatoriskt.', + requiresAtLeast: 'Detta fält kräver minst {{count}} {{label}}.', requiresNoMoreThan: 'Detta fält kräver inte mer än {{count}} {{label}}.', requiresTwoNumbers: 'Detta fält kräver två nummer.', shorterThanMax: 'Detta värde måste vara kortare än maxlängden på {{maxLength}} tecken.', diff --git a/packages/translations/src/_generatedFiles_/api/th.js b/packages/translations/src/_generatedFiles_/api/th.js index f85be9c16..651c9864d 100644 --- a/packages/translations/src/_generatedFiles_/api/th.js +++ b/packages/translations/src/_generatedFiles_/api/th.js @@ -44,6 +44,8 @@ export default { deletedSuccessfully: 'ลบสำเร็จ', email: 'อีเมล', notFound: 'ไม่พบ', + row: 'แถว', + rows: 'แถว', successfullyCreated: 'สร้าง {{label}} สำเร็จ', successfullyDuplicated: 'สำเนา {{label}} สำเร็จ', thisLanguage: 'ไทย', @@ -72,6 +74,7 @@ export default { longerThanMin: 'ค่าต้องมีความยาวมากกว่า {{minLength}} ตัวอักษร', notValidDate: 'วันที่ "{{value}}" ไม่ถูกต้อง', required: 'จำเป็นต้องระบุค่า', + requiresAtLeast: 'ต้องมีอย่างน้อย {{count}} {{label}}', requiresNoMoreThan: 'ห้ามมีเกิน {{count}} {{label}}', requiresTwoNumbers: 'ต้องมีตัวเลข 2 ค่า', shorterThanMax: 'ค่าต้องมีความยาวน้อยกว่า {{maxLength}} ตัวอักษร', diff --git a/packages/translations/src/_generatedFiles_/api/tr.js b/packages/translations/src/_generatedFiles_/api/tr.js index 0b8f6e58b..d5ccd4c8b 100644 --- a/packages/translations/src/_generatedFiles_/api/tr.js +++ b/packages/translations/src/_generatedFiles_/api/tr.js @@ -46,6 +46,8 @@ export default { deletedSuccessfully: 'Başarıyla silindi.', email: 'E-posta', notFound: 'Bulunamadı', + row: 'Satır', + rows: 'Satır', successfullyCreated: '{{label}} başarıyla oluşturuldu.', successfullyDuplicated: '{{label}} başarıyla kopyalandı.', thisLanguage: 'Türkçe', @@ -74,6 +76,7 @@ export default { longerThanMin: 'Bu değer minimum {{minLength}} karakterden uzun olmalıdır.', notValidDate: '"{{value}}" geçerli bir tarih değil.', required: 'Bu alan gereklidir.', + requiresAtLeast: 'Bu alan en az {{count}} adet {{label}} gerektirmektedir.', requiresNoMoreThan: 'Bu alana {{count}} adetten fazla {{label}} girilemez.', requiresTwoNumbers: 'Bu alana en az iki rakam girilmesi zorunludur.', shorterThanMax: 'Bu alan {{maxLength}} karakterden daha kısa olmalıdır.', diff --git a/packages/translations/src/_generatedFiles_/api/ua.js b/packages/translations/src/_generatedFiles_/api/ua.js index 1691af1cb..8717cf382 100644 --- a/packages/translations/src/_generatedFiles_/api/ua.js +++ b/packages/translations/src/_generatedFiles_/api/ua.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Успішно видалено.', email: 'Email', notFound: 'Не знайдено', + row: 'Рядок', + rows: 'Рядки', successfullyCreated: '{{label}} успішно створено.', successfullyDuplicated: '{{label}} успішно продубльовано.', thisLanguage: 'Українська', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Це значення має бути більше, ніж мінімальна довжина {{minLength}} characters.', notValidDate: '"{{value}}" - некоректна дата.', required: "Це поле є обов'язковим.", + requiresAtLeast: 'Це поле потребує не менше {{count}} {{label}}.', requiresNoMoreThan: 'Це поле потребує не більше {{count}} {{label}}.', requiresTwoNumbers: 'У цьому полі потрібно ввести два числа.', shorterThanMax: 'Це значення має бути меншим за максимальну довжину символів {{maxLength}}.', diff --git a/packages/translations/src/_generatedFiles_/api/vi.js b/packages/translations/src/_generatedFiles_/api/vi.js index e81ef1a25..5d813e900 100644 --- a/packages/translations/src/_generatedFiles_/api/vi.js +++ b/packages/translations/src/_generatedFiles_/api/vi.js @@ -45,6 +45,8 @@ export default { deletedSuccessfully: 'Đã xoá thành công.', email: 'Email', notFound: 'Không tìm thấy', + row: 'Hàng', + rows: 'Những hàng', successfullyCreated: '{{label}} đã được tạo thành công.', successfullyDuplicated: '{{label}} đã được sao chép thành công.', thisLanguage: 'Vietnamese (Tiếng Việt)', @@ -73,6 +75,7 @@ export default { longerThanMin: 'Giá trị này cần có độ dài tối thiểu {{minLength}} ký tự.', notValidDate: '"{{value}}" không phải là một ngày (date) hợp lệ.', required: 'Field này cần được diền.', + requiresAtLeast: 'Field này cần tối thiểu {{count}} {{label}}.', requiresNoMoreThan: 'Field này không thể vượt quá {{count}} {{label}}.', requiresTwoNumbers: 'Field này cần tối thiểu 2 chữ số.', shorterThanMax: 'Giá trị phải ngắn hơn hoặc bằng {{maxLength}} ký tự.', diff --git a/packages/translations/src/_generatedFiles_/api/zh-tw.js b/packages/translations/src/_generatedFiles_/api/zh-tw.js index 070177df6..6fb7434cf 100644 --- a/packages/translations/src/_generatedFiles_/api/zh-tw.js +++ b/packages/translations/src/_generatedFiles_/api/zh-tw.js @@ -43,6 +43,8 @@ export default { deletedSuccessfully: '已成功刪除。', email: '電子郵件', notFound: '未找到', + row: '行', + rows: '行', successfullyCreated: '成功建立{{label}}', successfullyDuplicated: '成功複製{{label}}', thisLanguage: '中文 (繁體)', @@ -71,6 +73,7 @@ export default { longerThanMin: '該值必須大於{{minLength}}字串的最小長度', notValidDate: '"{{value}}"不是一個有效的日期。', required: '該字串為必填項目。', + requiresAtLeast: '該字串至少需要 {{count}} 個 {{label}}。', requiresNoMoreThan: '該字串要求不超過 {{count}} 個 {{label}。', requiresTwoNumbers: '該字串需要兩個數字。', shorterThanMax: '該值長度必須小於{{maxLength}}個字元', diff --git a/packages/translations/src/_generatedFiles_/api/zh.js b/packages/translations/src/_generatedFiles_/api/zh.js index fcb545e5c..354b606f6 100644 --- a/packages/translations/src/_generatedFiles_/api/zh.js +++ b/packages/translations/src/_generatedFiles_/api/zh.js @@ -43,6 +43,8 @@ export default { deletedSuccessfully: '已成功删除。', email: '电子邮件', notFound: '未找到', + row: '行', + rows: '行', successfullyCreated: '成功创建{{label}}', successfullyDuplicated: '成功复制{{label}}', thisLanguage: '中文 (简体)', @@ -71,6 +73,7 @@ export default { longerThanMin: '该值必须大于{{minLength}}字符的最小长度', notValidDate: '"{{value}}"不是一个有效的日期。', required: '该字段为必填项目。', + requiresAtLeast: '该字段至少需要{{count}} {{label}}。', requiresNoMoreThan: '该字段要求不超过{{count}} {{label}。', requiresTwoNumbers: '该字段需要两个数字。', shorterThanMax: '该值必须小于{{maxLength}}字符的最大长度', diff --git a/packages/translations/writeTranslationFiles.ts b/packages/translations/writeTranslationFiles.ts index a8969ba8b..24a48d048 100644 --- a/packages/translations/writeTranslationFiles.ts +++ b/packages/translations/writeTranslationFiles.ts @@ -1,10 +1,12 @@ +/* eslint-disable no-console */ +import { exec } from 'child_process' import * as fs from 'fs' import * as path from 'path' import { fileURLToPath } from 'url' -import { ensureDirectoryExists } from './src/utilities/ensureDirExists.js' -import { copyFile } from './src/utilities/copyFile.js' + import { translations } from './src/all/index.js' -import { exec } from 'child_process' +import { copyFile } from './src/utilities/copyFile.js' +import { ensureDirectoryExists } from './src/utilities/ensureDirExists.js' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) @@ -45,6 +47,8 @@ const serverTranslationKeys = [ 'general:updatedSuccessfully', 'general:updatedCountSuccessfully', 'general:value', + 'general:row', + 'general:rows', 'error:deletingFile', 'error:emailOrPasswordIncorrect', @@ -74,6 +78,7 @@ const serverTranslationKeys = [ 'validation:longerThanMin', 'validation:notValidDate', 'validation:required', + 'validation:requiresAtLeast', 'validation:requiresNoMoreThan', 'validation:requiresTwoNumbers', 'validation:shorterThanMax', @@ -412,48 +417,54 @@ function sortObject(obj) { return sortedObject } -async function build() { - ensureDirectoryExists(path.resolve(dirname, `${DESTINATION_ROOT}/client`)) - ensureDirectoryExists(path.resolve(dirname, `${DESTINATION_ROOT}/api`)) +function build() { + return new Promise((resolve, reject) => { + ensureDirectoryExists(path.resolve(dirname, `${DESTINATION_ROOT}/client`)) + ensureDirectoryExists(path.resolve(dirname, `${DESTINATION_ROOT}/api`)) - // build up the client and server translation files - for (const [locale, values] of Object.entries(translations)) { - const dest1 = path.resolve(dirname, `${DESTINATION_ROOT}/client/${locale}.js`) + try { + // build up the client and server translation files + for (const [locale, values] of Object.entries(translations)) { + const dest1 = path.resolve(dirname, `${DESTINATION_ROOT}/client/${locale}.js`) - const clientTranslations = sortObject(filterKeys(values, '', clientTranslationKeys)) + const clientTranslations = sortObject(filterKeys(values, '', clientTranslationKeys)) - fs.writeFileSync(dest1, 'export default ' + JSON.stringify(clientTranslations, null, 2), { - flag: 'w+', - }) + fs.writeFileSync(dest1, 'export default ' + JSON.stringify(clientTranslations, null, 2), { + flag: 'w+', + }) - const serverTranslations = sortObject(filterKeys(values, '', serverTranslationKeys)) - const dest2 = path.resolve(dirname, `${DESTINATION_ROOT}/api/${locale}.js`) + const serverTranslations = sortObject(filterKeys(values, '', serverTranslationKeys)) + const dest2 = path.resolve(dirname, `${DESTINATION_ROOT}/api/${locale}.js`) - fs.writeFileSync(dest2, 'export default ' + JSON.stringify(serverTranslations, null, 2), { - flag: 'w+', - }) + fs.writeFileSync(dest2, 'export default ' + JSON.stringify(serverTranslations, null, 2), { + flag: 'w+', + }) - console.info('Rebuilt:', filename) - } + console.info('Rebuilt:', filename) + } - // copy barrel file to both client and api folders - copyFile( - path.resolve(dirname, `${SOURCE_DIR}/index.ts`), - path.resolve(dirname, `${DESTINATION_ROOT}/api/index.ts`), - ) - copyFile( - path.resolve(dirname, `${SOURCE_DIR}/index.ts`), - path.resolve(dirname, `${DESTINATION_ROOT}/client/index.ts`), - ) + // Copy barrel file to both client and api folders + copyFile( + path.resolve(dirname, `${SOURCE_DIR}/index.ts`), + path.resolve(dirname, `${DESTINATION_ROOT}/api/index.ts`), + ) + copyFile( + path.resolve(dirname, `${SOURCE_DIR}/index.ts`), + path.resolve(dirname, `${DESTINATION_ROOT}/client/index.ts`), + ) - // Run prettier from CLI so that files pass the pre-commit hook: - console.info('Running prettier...') - exec('prettier --write "**/*.js"', (err, stdout, stderr) => { - if (err) { - console.error(err) - return + // Run prettier from CLI so that files pass the pre-commit hook: + console.info('Running prettier...') + exec('prettier --write "**/*.js"', (err, stdout) => { + if (err) { + console.error(err) + } else { + console.info(stdout) + } + }) + } catch (error) { + reject(error) } - console.info(stdout) }) } diff --git a/packages/ui/src/elements/Status/index.tsx b/packages/ui/src/elements/Status/index.tsx index 62b1212b5..e8566384b 100644 --- a/packages/ui/src/elements/Status/index.tsx +++ b/packages/ui/src/elements/Status/index.tsx @@ -95,8 +95,10 @@ export const Status: React.FC = () => { data = json.doc } + // eslint-disable-next-line @typescript-eslint/no-floating-promises resetForm(data) toast.success(json.message) + // eslint-disable-next-line @typescript-eslint/no-floating-promises getVersions() } else { toast.error(t('error:unPublishingDocument')) diff --git a/packages/ui/src/elements/WhereBuilder/Condition/Relationship/index.tsx b/packages/ui/src/elements/WhereBuilder/Condition/Relationship/index.tsx index 507b5ba15..5105c00d4 100644 --- a/packages/ui/src/elements/WhereBuilder/Condition/Relationship/index.tsx +++ b/packages/ui/src/elements/WhereBuilder/Condition/Relationship/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ import type { PaginatedDocs } from 'payload/database' import React, { useCallback, useEffect, useReducer, useState } from 'react' @@ -48,6 +49,7 @@ export const RelationshipField: React.FC = (props) => { lastFullyLoadedRelation: lastFullyLoadedRelationArg, lastLoadedPage: lastLoadedPageArg, search: searchArg, + // eslint-disable-next-line @typescript-eslint/require-await }) => { let lastLoadedPageToUse = typeof lastLoadedPageArg !== 'undefined' ? lastLoadedPageArg : 1 const lastFullyLoadedRelationToUse = @@ -187,6 +189,7 @@ export const RelationshipField: React.FC = (props) => { const data = await response.json() addOptions({ docs: [data] }, relation) } else { + // eslint-disable-next-line no-console console.error(t('error:loadingDocument', { id })) } } diff --git a/packages/ui/src/forms/Error/index.tsx b/packages/ui/src/forms/Error/index.tsx index 6c25e38b9..50af44278 100644 --- a/packages/ui/src/forms/Error/index.tsx +++ b/packages/ui/src/forms/Error/index.tsx @@ -1,4 +1,5 @@ 'use client' + import type { ErrorProps } from 'payload/types' import React from 'react' diff --git a/packages/ui/src/forms/Form/initContextState.ts b/packages/ui/src/forms/Form/initContextState.ts index 7f0b455e5..5f1ca8e0f 100644 --- a/packages/ui/src/forms/Form/initContextState.ts +++ b/packages/ui/src/forms/Form/initContextState.ts @@ -25,7 +25,7 @@ const setSubmitted: SetSubmitted = () => undefined const reset: Reset = () => undefined export const initContextState: Context = { - addFieldRow: async () => undefined, + addFieldRow: () => undefined, buildRowErrors: () => undefined, createFormData, disabled: false, @@ -38,7 +38,7 @@ export const initContextState: Context = { getFields: (): FormState => ({}), getSiblingData, removeFieldRow: () => undefined, - replaceFieldRow: async () => undefined, + replaceFieldRow: () => undefined, replaceState: () => undefined, reset, setModified, diff --git a/packages/ui/src/providers/ComponentMap/buildComponentMap/mapActions.tsx b/packages/ui/src/providers/ComponentMap/buildComponentMap/mapActions.tsx index 95f04351d..56c3cc592 100644 --- a/packages/ui/src/providers/ComponentMap/buildComponentMap/mapActions.tsx +++ b/packages/ui/src/providers/ComponentMap/buildComponentMap/mapActions.tsx @@ -39,6 +39,7 @@ export const mapActions = (args: { listActions.forEach((action) => { const Action = action if (typeof Action === 'function') { + // eslint-disable-next-line @typescript-eslint/no-floating-promises result.List = [...result.List, ] } }) diff --git a/packages/ui/src/providers/ComponentMap/buildComponentMap/mapFields.tsx b/packages/ui/src/providers/ComponentMap/buildComponentMap/mapFields.tsx index 745b02c62..b194be7dd 100644 --- a/packages/ui/src/providers/ComponentMap/buildComponentMap/mapFields.tsx +++ b/packages/ui/src/providers/ComponentMap/buildComponentMap/mapFields.tsx @@ -569,6 +569,7 @@ export const mapFields = (args: { name: field.name, className: field.admin?.className, disabled: field.admin?.disabled, + hasMany: field.hasMany, maxLength: field.maxLength, minLength: field.minLength, placeholder: field.admin?.placeholder, diff --git a/test/admin/collections/Posts.ts b/test/admin/collections/Posts.ts index ac992965b..5fa558341 100644 --- a/test/admin/collections/Posts.ts +++ b/test/admin/collections/Posts.ts @@ -1,7 +1,7 @@ -import { slateEditor } from '@payloadcms/richtext-slate' - import type { CollectionConfig } from 'payload/types' +import { slateEditor } from '@payloadcms/richtext-slate' + import { DemoUIFieldCell } from '../components/DemoUIField/Cell.js' import { DemoUIField } from '../components/DemoUIField/Field.js' import { diff --git a/test/admin/components/views/CustomViewWithParam/index.tsx b/test/admin/components/views/CustomViewWithParam/index.tsx index 27830052e..52d1ba229 100644 --- a/test/admin/components/views/CustomViewWithParam/index.tsx +++ b/test/admin/components/views/CustomViewWithParam/index.tsx @@ -1,3 +1,4 @@ +import { Button } from '@payloadcms/ui' import LinkImport from 'next/link.js' import React from 'react' diff --git a/test/auth/custom-strategy/int.spec.ts b/test/auth/custom-strategy/int.spec.ts index bf7b9b9e8..a5c7d03a1 100644 --- a/test/auth/custom-strategy/int.spec.ts +++ b/test/auth/custom-strategy/int.spec.ts @@ -1,6 +1,7 @@ import type { Payload } from 'payload' import { getPayload } from 'payload' + import { NextRESTClient } from '../../helpers/NextRESTClient.js' import { startMemoryDB } from '../../startMemoryDB.js' import configPromise from './config.js' diff --git a/test/auth/removed-token/int.spec.ts b/test/auth/removed-token/int.spec.ts index 4ed86fca0..4a51dfe04 100644 --- a/test/auth/removed-token/int.spec.ts +++ b/test/auth/removed-token/int.spec.ts @@ -1,6 +1,7 @@ import type { Payload } from 'payload' import { getPayload } from 'payload' + import { devUser } from '../../credentials.js' import { NextRESTClient } from '../../helpers/NextRESTClient.js' import { startMemoryDB } from '../../startMemoryDB.js' diff --git a/test/field-error-states/collections/Upload/index.ts b/test/field-error-states/collections/Upload/index.ts index 03a73093c..e16fe9916 100644 --- a/test/field-error-states/collections/Upload/index.ts +++ b/test/field-error-states/collections/Upload/index.ts @@ -1,7 +1,7 @@ -import path from 'path' - import type { CollectionConfig } from 'payload/types' +import path from 'path' + const Uploads: CollectionConfig = { slug: 'uploads', upload: { diff --git a/test/fields/collections/Array/LabelComponent.tsx b/test/fields/collections/Array/LabelComponent.tsx index 234716d05..f5c79ae76 100644 --- a/test/fields/collections/Array/LabelComponent.tsx +++ b/test/fields/collections/Array/LabelComponent.tsx @@ -1,8 +1,13 @@ +'use client' + import type { RowLabelComponent } from 'payload/types' import React from 'react' -export const ArrayRowLabel: RowLabelComponent = ({ data }) => { +import { useRowLabel } from '../../../../packages/ui/src/forms/RowLabel/Context/index.js' + +export const ArrayRowLabel: RowLabelComponent = () => { + const { data } = useRowLabel<{ title: string }>() return (
{data.title || 'Untitled'}
) diff --git a/test/fields/collections/Array/index.ts b/test/fields/collections/Array/index.ts index 9e3d6cdac..16a69b163 100644 --- a/test/fields/collections/Array/index.ts +++ b/test/fields/collections/Array/index.ts @@ -112,22 +112,6 @@ const ArrayFields: CollectionConfig = { ], type: 'array', }, - { - name: 'rowLabelAsFunction', - admin: { - components: { - RowLabel: ({ data }) => data.title, - }, - description: 'Row labels rendered from a function.', - }, - fields: [ - { - name: 'title', - type: 'text', - }, - ], - type: 'array', - }, { name: 'rowLabelAsComponent', admin: { diff --git a/test/fields/collections/Array/shared.ts b/test/fields/collections/Array/shared.ts index c5c2bcb8e..23055c92e 100644 --- a/test/fields/collections/Array/shared.ts +++ b/test/fields/collections/Array/shared.ts @@ -1,7 +1,19 @@ import type { ArrayField } from '../../payload-types.js' export const arrayDoc: Partial = { - title: 'array doc 1', + arrayWithMinRows: [ + { + text: 'first row', + }, + { + text: 'second row', + }, + ], + collapsedArray: [ + { + text: 'initialize collapsed', + }, + ], items: [ { text: 'first row', @@ -22,11 +34,10 @@ export const arrayDoc: Partial = { text: 'sixth row', }, ], - collapsedArray: [ - { - text: 'initialize collapsed', - }, - ], + title: 'array doc 1', +} + +export const anotherArrayDoc: Partial = { arrayWithMinRows: [ { text: 'first row', @@ -35,10 +46,11 @@ export const arrayDoc: Partial = { text: 'second row', }, ], -} - -export const anotherArrayDoc: Partial = { - title: 'array doc 2', + collapsedArray: [ + { + text: 'initialize collapsed', + }, + ], items: [ { text: 'first row', @@ -50,17 +62,5 @@ export const anotherArrayDoc: Partial = { text: 'third row', }, ], - collapsedArray: [ - { - text: 'initialize collapsed', - }, - ], - arrayWithMinRows: [ - { - text: 'first row', - }, - { - text: 'second row', - }, - ], + title: 'array doc 2', } diff --git a/test/fields/collections/Lexical/index.ts b/test/fields/collections/Lexical/index.ts index 449999aa6..9dad3e711 100644 --- a/test/fields/collections/Lexical/index.ts +++ b/test/fields/collections/Lexical/index.ts @@ -7,6 +7,7 @@ import { UploadFeature, lexicalEditor, } from '@payloadcms/richtext-lexical' + import { lexicalFieldsSlug } from '../../slugs.js' import { ConditionalLayoutBlock, diff --git a/test/fields/collections/LexicalMigrate/index.ts b/test/fields/collections/LexicalMigrate/index.ts index 1316070a1..832d9b697 100644 --- a/test/fields/collections/LexicalMigrate/index.ts +++ b/test/fields/collections/LexicalMigrate/index.ts @@ -10,6 +10,7 @@ import { lexicalEditor, lexicalHTML, } from '@payloadcms/richtext-lexical' + import { lexicalMigrateFieldsSlug } from '../../slugs.js' import { getSimpleLexicalData } from './data.js' diff --git a/test/fields/collections/RichText/index.ts b/test/fields/collections/RichText/index.ts index a3b0aaa87..a742e966c 100644 --- a/test/fields/collections/RichText/index.ts +++ b/test/fields/collections/RichText/index.ts @@ -1,6 +1,5 @@ import type { CollectionConfig } from 'payload/types' -import { lexicalHTML } from '../../../../packages/richtext-lexical/src/field/features/converters/html/field/index.js' import { BlocksFeature, HTMLConverterFeature, @@ -10,6 +9,8 @@ import { lexicalEditor, } from '@payloadcms/richtext-lexical' import { slateEditor } from '@payloadcms/richtext-slate' + +import { lexicalHTML } from '../../../../packages/richtext-lexical/src/field/features/converters/html/field/index.js' import { richTextFieldsSlug } from '../../slugs.js' import { RelationshipBlock, SelectFieldBlock, TextBlock, UploadAndRichTextBlock } from './blocks.js' diff --git a/test/fields/collections/Upload/index.ts b/test/fields/collections/Upload/index.ts index d87212d48..1e769e4fd 100644 --- a/test/fields/collections/Upload/index.ts +++ b/test/fields/collections/Upload/index.ts @@ -1,8 +1,8 @@ +import type { CollectionConfig } from 'payload/types' + import path from 'path' import { fileURLToPath } from 'url' -import type { CollectionConfig } from 'payload/types' - import { uploadsSlug } from '../../slugs.js' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) diff --git a/test/fields/collections/Upload2/index.ts b/test/fields/collections/Upload2/index.ts index 232f9e2e9..2ae577c7d 100644 --- a/test/fields/collections/Upload2/index.ts +++ b/test/fields/collections/Upload2/index.ts @@ -1,8 +1,8 @@ +import type { CollectionConfig } from 'payload/types' + import path from 'path' import { fileURLToPath } from 'url' -import type { CollectionConfig } from 'payload/types' - import { uploads2Slug } from '../../slugs.js' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) diff --git a/test/fields/collections/Uploads3/index.ts b/test/fields/collections/Uploads3/index.ts index 767a53dc3..d30d70594 100644 --- a/test/fields/collections/Uploads3/index.ts +++ b/test/fields/collections/Uploads3/index.ts @@ -1,8 +1,8 @@ +import type { CollectionConfig } from 'payload/types' + import path from 'path' import { fileURLToPath } from 'url' -import type { CollectionConfig } from 'payload/types' - import { uploads3Slug } from '../../slugs.js' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) diff --git a/test/fields/e2e.spec.ts b/test/fields/e2e.spec.ts index abb4a1a4a..a2bf8b519 100644 --- a/test/fields/e2e.spec.ts +++ b/test/fields/e2e.spec.ts @@ -234,7 +234,9 @@ describe('fields', () => { await page.keyboard.press('Enter') await page.click('#action-save', { delay: 100 }) - await expect(page.locator('.Toastify')).toContainText('Please correct invalid fields') + await expect(page.locator('.Toastify')).toContainText( + 'The following field is invalid: withMinRows', + ) }) }) @@ -698,17 +700,6 @@ describe('fields', () => { await expect(field).toHaveValue('defaultValue') }) - test('should render RowLabel using a function', async () => { - const label = 'custom row label as function' - await page.goto(url.create) - await page.locator('#field-rowLabelAsFunction >> .array-field__add-row').click() - - await page.locator('#field-rowLabelAsFunction__0__title').fill(label) - await wait(100) - const customRowLabel = page.locator('#rowLabelAsFunction-row-0 >> .row-label') - await expect(customRowLabel).toContainText(label) - }) - test('should render RowLabel using a component', async () => { const label = 'custom row label as component' await page.goto(url.create) @@ -717,7 +708,7 @@ describe('fields', () => { await page.locator('#field-rowLabelAsComponent__0__title').fill(label) await wait(100) const customRowLabel = page.locator( - '#rowLabelAsComponent-row-0 >> .row-label :text("custom row label")', + '#rowLabelAsComponent-row-0 >> .array-field__row-header > :text("custom row label")', ) await expect(customRowLabel).toHaveCSS('text-transform', 'uppercase') }) @@ -733,7 +724,9 @@ describe('fields', () => { await page.locator('#field-arrayWithMinRows >> .array-field__add-row').click() await page.click('#action-save', { delay: 100 }) - await expect(page.locator('.Toastify')).toContainText('Please correct invalid fields') + await expect(page.locator('.Toastify')).toContainText( + 'The following field is invalid: arrayWithMinRows', + ) }) describe('row manipulation', () => { @@ -744,11 +737,16 @@ describe('fields', () => { const assertText3 = 'array row 3' const assertGroupText3 = 'text in group in row 3' await page.goto(url.create) + await page.locator('#field-potentiallyEmptyArray').scrollIntoViewIfNeeded() + await wait(300) // Add 3 rows await page.locator('#field-potentiallyEmptyArray > .array-field__add-row').click() + await wait(300) await page.locator('#field-potentiallyEmptyArray > .array-field__add-row').click() + await wait(300) await page.locator('#field-potentiallyEmptyArray > .array-field__add-row').click() + await wait(300) // Fill out row 1 await page.locator('#field-potentiallyEmptyArray__0__text').fill(assertText0) @@ -870,7 +868,7 @@ describe('fields', () => { await page.goto(url.list) await page.waitForSelector('.table > table > tbody > tr td.cell-title') const rows = page.locator('.table > table > tbody > tr', { - has: page.locator('td.cell-title span', { + has: page.locator('td.cell-title a', { hasText: 'for test', }), }) @@ -880,31 +878,34 @@ describe('fields', () => { await rows .nth(i) .locator('td.cell-_select .checkbox-input__input > input[type="checkbox"]') - .check() + .click() } await page.locator('.edit-many__toggle').click() await page.locator('.field-select .rs__control').click() const arrayOption = page.locator('.rs__option', { - hasText: exactText('Items'), + hasText: 'Items', }) await expect(arrayOption).toBeVisible() await arrayOption.click() - const addRowButton = page.locator('#field-items > .btn.array-field__add-row') + await wait(200) + + const addRowButton = page.locator('#field-items > .array-field__add-row') await expect(addRowButton).toBeVisible() await addRowButton.click() + await wait(200) - const targetInput = page.locator('#field-items__0__text') + const targetInput = page.locator('#field-items__2__text') await expect(targetInput).toBeVisible() await targetInput.fill(bulkText) - await page.locator('.form-submit button[type="submit"].edit-many__publish').click() + await page.locator('#edit-array-fields .form-submit .edit-many__save').click() await expect(page.locator('.Toastify__toast--success')).toContainText( 'Updated 3 Array Fields successfully.', ) diff --git a/test/live-preview/collections/Pages.ts b/test/live-preview/collections/Pages.ts index 836097563..6115159f2 100644 --- a/test/live-preview/collections/Pages.ts +++ b/test/live-preview/collections/Pages.ts @@ -2,6 +2,7 @@ import type { CollectionConfig } from 'payload/types' import { lexicalEditor } from '@payloadcms/richtext-lexical' import { slateEditor } from '@payloadcms/richtext-slate' + import { Archive } from '../blocks/ArchiveBlock/index.js' import { CallToAction } from '../blocks/CallToAction/index.js' import { Content } from '../blocks/Content/index.js' diff --git a/test/live-preview/startLivePreviewDemo.ts b/test/live-preview/startLivePreviewDemo.ts index 529b387cf..3fffa74c4 100644 --- a/test/live-preview/startLivePreviewDemo.ts +++ b/test/live-preview/startLivePreviewDemo.ts @@ -1,10 +1,9 @@ import type { ChildProcessWithoutNullStreams } from 'child_process' +import type { Payload } from 'payload' import { spawn } from 'child_process' import path from 'path' import { fileURLToPath } from 'url' - -import type { Payload } from 'payload' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) diff --git a/test/plugin-redirects/seed/index.ts b/test/plugin-redirects/seed/index.ts index dbef0454b..73b09efba 100644 --- a/test/plugin-redirects/seed/index.ts +++ b/test/plugin-redirects/seed/index.ts @@ -1,4 +1,5 @@ import type { Payload } from 'payload' + import type { PayloadRequest } from '../../../packages/payload/types.js' export const seed = async (payload: Payload): Promise => { diff --git a/test/plugin-seo/collections/Media.ts b/test/plugin-seo/collections/Media.ts index 1b024b802..7829f4e81 100644 --- a/test/plugin-seo/collections/Media.ts +++ b/test/plugin-seo/collections/Media.ts @@ -1,8 +1,8 @@ +import type { CollectionConfig } from 'payload/types' + import path from 'path' import { fileURLToPath } from 'url' -import type { CollectionConfig } from 'payload/types' - import { mediaSlug } from '../shared.js' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) diff --git a/test/uploads/collections/Upload1/index.ts b/test/uploads/collections/Upload1/index.ts index c51a07a47..498889ddf 100644 --- a/test/uploads/collections/Upload1/index.ts +++ b/test/uploads/collections/Upload1/index.ts @@ -1,7 +1,7 @@ -import path from 'path' - import type { CollectionConfig } from 'payload/types' +import path from 'path' + export const Uploads1: CollectionConfig = { slug: 'uploads-1', upload: { diff --git a/test/uploads/collections/Upload2/index.ts b/test/uploads/collections/Upload2/index.ts index dd7aa8cff..6f2134457 100644 --- a/test/uploads/collections/Upload2/index.ts +++ b/test/uploads/collections/Upload2/index.ts @@ -1,7 +1,7 @@ -import path from 'path' - import type { CollectionConfig } from 'payload/types' +import path from 'path' + export const Uploads2: CollectionConfig = { slug: 'uploads-2', upload: { diff --git a/test/uploads/collections/admin-thumbnail/index.ts b/test/uploads/collections/admin-thumbnail/index.ts index bb41805d0..39be4e792 100644 --- a/test/uploads/collections/admin-thumbnail/index.ts +++ b/test/uploads/collections/admin-thumbnail/index.ts @@ -1,7 +1,7 @@ -import path from 'path' - import type { CollectionConfig } from 'payload/types' +import path from 'path' + import { RegisterAdminThumbnailFn } from './RegisterThumbnailFn.js' export const AdminThumbnailCol: CollectionConfig = { diff --git a/test/versions/int.spec.ts b/test/versions/int.spec.ts index cb9693fbd..08576a348 100644 --- a/test/versions/int.spec.ts +++ b/test/versions/int.spec.ts @@ -1,4 +1,5 @@ import type { Payload } from 'payload' + import type { NextRESTClient } from '../helpers/NextRESTClient.js' import { devUser } from '../credentials.js'