File picker offers "New" even without create permission or quota

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

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
frontend

調査の方向性

lib/components/FilePicker/FilePicker.vueから始め、特に28〜29行目付近のメニュー表示と322行目付近のonCreateFolder()を確認してください。ピッカーが現在のフォルダーの作成権限とクォータをどのように公開しているかを調べ、作成権限がないフォルダー、または利用可能なクォータがゼロのフォルダーを対象とするテストを追加または更新してください。該当する場合に「New」メニューが非表示または無効になれば完了です。

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

説明

bug
Describe the bug

The file picker always shows the "New" (create folder) menu, independent of whether the user may create something in the current folder (no create permission, or no quota left):

https://github.com/nextcloud-libraries/nextcloud-dialogs/blob/636c9a8ea2700380d4cd8d1b0b1d57d50850ab29/lib/components/FilePicker/FilePicker.vue#L28-L29

Only noMenu hides it. onCreateFolder() then simply tries to create the folder and shows the resulting error:

https://github.com/nextcloud-libraries/nextcloud-dialogs/blob/636c9a8ea2700380d4cd8d1b0b1d57d50850ab29/lib/components/FilePicker/FilePicker.vue#L322

Originally reported in nextcloud/server#57440 (file picker of Photos, Collectives and others with an account whose quota is 0 B).

To Reproduce
  1. Set an account's quota to 0 B (or open a read-only shared folder in the picker).
  2. Open any file picker (e.g. "Move or copy", or the folder picker in Photos).
  3. The "New" menu is offered; creating a folder fails with an error.
Expected behavior

The "New" menu is hidden or disabled when the current folder lacks the create permission or quota-available-bytes is 0 (similar to how the Files app hides its "New" button), with a test.

主要言語
TypeScript
スター
19
フォーク
10
平均マージ
17時間 4分
マージ済み PR(30日)
30

環境構築

はじめの一歩

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

nextcloud-libraries/nextcloud-dialogs のほかの issue

nextcloud-libraries/nextcloud-dialogs の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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