test: passing array fields test suite (#5383)
* test: array tests passing except bulk update * test: passing array fields test suite
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import type { Data } from './Form.js'
|
||||
|
||||
export type RowLabelComponent = React.ComponentType
|
||||
|
||||
export type RowLabel = Record<string, string> | RowLabelComponent | string
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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}} أحرف.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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ů.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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}} واژه باشد.',
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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}} 文字以下にする必要があります。',
|
||||
|
||||
@@ -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}}자보다 짧아야 합니다.',
|
||||
|
||||
@@ -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}} လုံး၏ အမြင့်ဆုံးအရှည်ထက် ပိုတိုရပါမည်။',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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}}.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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}} карактера',
|
||||
|
||||
@@ -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}}.',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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}} ตัวอักษร',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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}}.',
|
||||
|
||||
@@ -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ự.',
|
||||
|
||||
@@ -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}}個字元',
|
||||
|
||||
@@ -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}}字符的最大长度',
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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> = (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> = (props) => {
|
||||
const data = await response.json()
|
||||
addOptions({ docs: [data] }, relation)
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(t('error:loadingDocument', { id }))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
'use client'
|
||||
|
||||
import type { ErrorProps } from 'payload/types'
|
||||
|
||||
import React from 'react'
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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, <Action />]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Button } from '@payloadcms/ui'
|
||||
import LinkImport from 'next/link.js'
|
||||
import React from 'react'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'path'
|
||||
|
||||
import type { CollectionConfig } from 'payload/types'
|
||||
|
||||
import path from 'path'
|
||||
|
||||
const Uploads: CollectionConfig = {
|
||||
slug: 'uploads',
|
||||
upload: {
|
||||
|
||||
@@ -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 (
|
||||
<div style={{ color: 'coral', textTransform: 'uppercase' }}>{data.title || 'Untitled'}</div>
|
||||
)
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
import type { ArrayField } from '../../payload-types.js'
|
||||
|
||||
export const arrayDoc: Partial<ArrayField> = {
|
||||
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<ArrayField> = {
|
||||
text: 'sixth row',
|
||||
},
|
||||
],
|
||||
collapsedArray: [
|
||||
{
|
||||
text: 'initialize collapsed',
|
||||
},
|
||||
],
|
||||
title: 'array doc 1',
|
||||
}
|
||||
|
||||
export const anotherArrayDoc: Partial<ArrayField> = {
|
||||
arrayWithMinRows: [
|
||||
{
|
||||
text: 'first row',
|
||||
@@ -35,10 +46,11 @@ export const arrayDoc: Partial<ArrayField> = {
|
||||
text: 'second row',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
export const anotherArrayDoc: Partial<ArrayField> = {
|
||||
title: 'array doc 2',
|
||||
collapsedArray: [
|
||||
{
|
||||
text: 'initialize collapsed',
|
||||
},
|
||||
],
|
||||
items: [
|
||||
{
|
||||
text: 'first row',
|
||||
@@ -50,17 +62,5 @@ export const anotherArrayDoc: Partial<ArrayField> = {
|
||||
text: 'third row',
|
||||
},
|
||||
],
|
||||
collapsedArray: [
|
||||
{
|
||||
text: 'initialize collapsed',
|
||||
},
|
||||
],
|
||||
arrayWithMinRows: [
|
||||
{
|
||||
text: 'first row',
|
||||
},
|
||||
{
|
||||
text: 'second row',
|
||||
},
|
||||
],
|
||||
title: 'array doc 2',
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
UploadFeature,
|
||||
lexicalEditor,
|
||||
} from '@payloadcms/richtext-lexical'
|
||||
|
||||
import { lexicalFieldsSlug } from '../../slugs.js'
|
||||
import {
|
||||
ConditionalLayoutBlock,
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
lexicalEditor,
|
||||
lexicalHTML,
|
||||
} from '@payloadcms/richtext-lexical'
|
||||
|
||||
import { lexicalMigrateFieldsSlug } from '../../slugs.js'
|
||||
import { getSimpleLexicalData } from './data.js'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.',
|
||||
)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Payload } from 'payload'
|
||||
|
||||
import type { PayloadRequest } from '../../../packages/payload/types.js'
|
||||
|
||||
export const seed = async (payload: Payload): Promise<boolean> => {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Payload } from 'payload'
|
||||
|
||||
import type { NextRESTClient } from '../helpers/NextRESTClient.js'
|
||||
|
||||
import { devUser } from '../credentials.js'
|
||||
|
||||
Reference in New Issue
Block a user