Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files_sharing): file request followups #46589

Merged
merged 17 commits into from
Jul 19, 2024

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Jul 17, 2024

Sans.titre.mp4

Todo

  • Some design adjusting based on design team request
  • Simplified email validation based on groupware team feedback
  • Use share label as title and destination if provided
  • Prompt guest nickname to upload files in subfolder

Followups

  • Think about name conflicts
  • Add warning when a share without READ gets change with READ
  • Add time left on public page
  • Add list of file requests in Navigation

* @param View $view
*/
public function setView($view) {
public function setView(View $view) {

Check notice

Code scanning / Psalm

MissingReturnType Note

Method OCA\DAV\Files\Sharing\FilesDropPlugin::setView does not have a return type, expecting void
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch 2 times, most recently from c8e6edd to 45c9298 Compare July 17, 2024 17:47
@skjnldsv skjnldsv self-assigned this Jul 17, 2024
@skjnldsv skjnldsv added this to the Nextcloud 30 milestone Jul 17, 2024
@@ -16,16 +19,13 @@
*/
class FilesDropPlugin extends ServerPlugin {

/** @var View */
private $view;
private View $view;

Check notice

Code scanning / Psalm

MissingConstructor Note

OCA\DAV\Files\Sharing\FilesDropPlugin has an uninitialized property OCA\DAV\Files\Sharing\FilesDropPlugin::$view, but no constructor
apps/dav/lib/Files/Sharing/FilesDropPlugin.php Dismissed Show dismissed Hide dismissed
}

// We need a valid nickname for file requests
if ($isFileRequest && (!$nickName || trim($nickName) === '')) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
// If this is a file request we need to create a folder for the user
if ($isFileRequest) {
// Check if the folder already exists
if (!$this->view->file_exists($nickName)) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type bool|mixed contains type mixed, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch 2 times, most recently from 71f5f64 to cb95dc9 Compare July 18, 2024 06:00
// If this is a file request we need to create a folder for the user
if ($isFileRequest) {
// Check if the folder already exists
if (!$this->view->file_exists($nickName) === true) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type bool|mixed contains type mixed, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
// If this is a file request we need to create a folder for the user
if ($isFileRequest) {
// Check if the folder already exists
if (!$this->view->file_exists($nickName) === true) {

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method file_exists on possibly null value
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch from cb95dc9 to bcc8923 Compare July 18, 2024 06:29
@skjnldsv

This comment was marked as resolved.

@skjnldsv

This comment was marked as resolved.

@skjnldsv

This comment was marked as resolved.

}

// If this is a file request we need to create a folder for the user
if ($isFileRequest && $nickName !== null) {

Check failure

Code scanning / Psalm

RedundantCondition Error

string can never contain null
// If this is a file request we need to create a folder for the user
if ($isFileRequest && $nickName !== null) {
// Check if the folder already exists
if (!($this->view->file_exists($nickName) === true)) {

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method file_exists on possibly null value
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch from bcc8923 to 6051047 Compare July 18, 2024 11:07
}

// If this is a file request we need to create a folder for the user
if ($isFileRequest && $nickName) {

Check failure

Code scanning / Psalm

RedundantCondition Error

Operand of type non-falsy-string is always truthy
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch 2 times, most recently from a5a34b0 to f5871b1 Compare July 18, 2024 11:37
@skjnldsv skjnldsv removed the 2. developing Work in progress label Jul 18, 2024
@skjnldsv skjnldsv requested a review from artonge July 18, 2024 14:54
$shareManager = \OCP\Server::get(IManager::class);
$token = $this->getToken($request);
$share = $shareManager->getShareByToken($token);
if ($share === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

OCP\Share\IShare does not contain null
$isFileRequest = false;
try {
$share = $this->shareManager->getShareByToken($token);
if ($share === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

OCP\Share\IShare does not contain null
skjnldsv added 9 commits July 18, 2024 19:47
…ttings

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
…isplay

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
…available

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch 3 times, most recently from 25911a3 to 98f17a1 Compare July 18, 2024 17:57
skjnldsv added 7 commits July 18, 2024 20:15
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
…vent

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch from 98f17a1 to 481551e Compare July 18, 2024 18:15
@skjnldsv skjnldsv enabled auto-merge July 18, 2024 19:03
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/files_sharing-file-request-followup branch from e578a8c to 725736a Compare July 19, 2024 05:35
@skjnldsv skjnldsv merged commit 0bde47a into master Jul 19, 2024
166 checks passed
@skjnldsv skjnldsv deleted the fix/files_sharing-file-request-followup branch July 19, 2024 07:14
@blizzz blizzz mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

4 participants