required ignored in fields inside a list on i18n translations
- Ngôn ngữ chính
- JavaScript
- Star
- 19.4k
- Fork
- 3.1k
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
**Describe the bug**
`required` on fields inside a `list` field is ignored for i18n transitions.
`required` is only respected in the first translation but is not respected for other translations.
**To Reproduce**
1) Clone the repo
```
git clone https://github.com/surjithctly/neat-starter.git
```
2) Use the config given below
3) Start local netlify proxy
```
npx netlify-cms-proxy-server
```
4) Start local dev server
```
npm run start
```
5) Go to http://localhost:8080/admin
6) Click on `media channels`
7) Click on `Add distribution` on **Writing in ES**
8) Publish while `channel` is empty
**Expected behavior**
Expected to see error message `Channel field is required`
**Actual Behaviour**
Was able to save with empty field
**Screenshots**

**Applicable Versions:**
- netlify-cms-app 2.15.30
- netlify-cms-core 2.46.0
- index.js:27 netlify-cms 2.10.150
- Browser version Chrome 92 on MacOS Big Sur `11.4 `
- Node.JS version: `v16.1.0`
**CMS configuration**
```
i18n:
structure: single_file
locales: [en, es, ar, hi, zh]
default_locale: en
backend:
# Use netlify identity as backend
name: git-gateway
branch: master
### enable below lines for github integration ###
# name: github
# repo: surjithctly/neat-starter
media_folder: "src/static/img"
public_folder: "/static/img"
# Please run "npx netlify-cms-proxy-server" for local backend
local_backend: true
# publish_mode: editorial_workflow
collections:
[
{
label: "Repeated Content Blocks",
name: "generalAreas",
i18n: true,
files:
[
{
name: "media",
label: "Media Channels",
file: "src/_data/channels.json",
i18n: true,
fields:
[
{
label: "Distribution",
name: "distribution",
widget: "list",
required: true,
allow_add: true,
i18n: true,
fields:
[
{
name: "channel",
label: "Channel",
widget: "string",
i18n: true,
required: true,
},
],
},
],
},
],
},
]
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện vấn đề trong cấu hình CMS được cung cấp bằng cách sử dụng src/_data/channels.json, npx netlify-cms-proxy-server và npm run start, sau đó mở /admin và kiểm thử channel trống trong bản dịch ES. Theo dõi quá trình xác thực các trường bắt buộc đối với các trường danh sách trên tất cả bản dịch; hoàn tất khi việc xuất bản bị chặn với “Channel field is required” trong ES và các locale không mặc định khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- frontend, internationalization
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100