Submission Form Allows Deletion of All Repeating Item Entries

Đang mở Phù hợp với người mới
#6,511 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Rowan-McKereghan đang làm issue này rồi.

Từ ngày 6/11/2026.

  • #6520 của @Rowan-McKereghan — đang mở
  • #6522 của @Rowan-McKereghan — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
angular, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Nút xóa được gắn với removeItem() trong src/app/shared/form/form.component.ts, mà báo cáo liên kết ở phiên bản 8.4 và 10.1 để so sánh. Hãy bắt đầu từ đó, sau đó tái hiện trong một trường lặp lại của biểu mẫu gửi: thêm một mục, xóa mục đầu tiên và kiểm tra mục còn lại. Hoàn thành khi mục còn lại duy nhất không có nút xóa, mục cuối cùng không thể bị gỡ bỏ và nút thêm mục vẫn hiển thị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

affects: 8.x affects: 9.x bug component: submission help wanted

Describe the bug

When clicking the "Add More" button in a submission form, and then deleting the first item in the array of two, the trash / deletion button remains next to the single item, allowing deletion of all items in the array, and removing the add more button, forcing the user to reload the page if they want to add values to that submission form input. Running DSpace 8.4, appears on both Chrome and Safari.

After investigation, this bug does not appear in the newest stable release of DSpace (10.1), and I believe this is because the removeItem() function that the delete button calls was changed in version 10.x – see the difference between version 8.4 and version 10.1 here, where in the latter, the function checks the form array length and only removes the input if it is greater than 1.

I haven't tested it, but I therefore believe this issue affects all DSpace versions 8.x and 9.x, since this code only exists in 10.x.

To Reproduce

  1. Begin the submission process
  2. Type something into a repeatable form element
  3. Click 'Add More'
  4. Delete the first element where a value exists
  5. The empty element should have a delete button that allows removal of all inputs

Expected behavior

Single elements in repeatable input arrays should not have the delete button appear.

Related work

TBD

Ngôn ngữ chính
TypeScript
Star
180
Fork
577
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
112

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DSpace/dspace-angular

Tất cả issue của DSpace/dspace-angular

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.