🐛(Bug) Duplicate modal adds a root copy to the tree for link-only editors

オープン 初心者向け
#3,030 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
django, react, typescript
領域
backend, frontend

調査の方向性

src/frontend/apps/impress/src/features/docs/doc-management/components/ConfirmationDuplicateModal.tsxから始め、特にisDuplicateInTreeのチェックと、コピーされたドキュメントが現在のツリーに追加される箇所を確認してください。バックエンドがsrc/backend/core/api/viewsets.pyでアクセスロールをどのように適用するか、またchildren_create権限がどのように計算されるかを読んでください。リンクのみでアクセスする編集者に、コピーはルートドキュメントになり、現在のツリーには追加されないと伝えられれば完了です。

索引モデルが issue の本文から書いたものです。

説明

AI generated frontend

The duplicate modal decides that a sub-doc copy stays in the tree from abilities.partial_update, but the backend makes it a sibling only when the user's access role is editor or above; otherwise the copy becomes a new root doc.
https://github.com/suitenumerique/docs/blob/2869122429ecaf12e509c9b60f79cd0d142d3521/src/frontend/apps/impress/src/features/docs/doc-management/components/ConfirmationDuplicateModal.tsx#L66-L68
A user who edits a sub-doc only through a public or connected link is told the copy goes in the tree, and the new root doc is added to the current tree by mistake.
Suggested fix: base isDuplicateInTree on an ability computed from the access role, e.g. doc.abilities.children_create once it no longer accepts a link definition alone (same rule as duplicate), rather than on partial_update.

主要言語
TypeScript
スター
17k
フォーク
705
平均マージ
4日 13時間
マージ済み PR(30日)
47

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

suitenumerique/docs のほかの issue

suitenumerique/docs の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。