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

Sharing feature for Nextmcloud #4858

Closed

Conversation

TSI-pranalideshpande
Copy link

In this ,we have harmonized the permission settings for sharing. Currently we have different options for internal, external and link shares as well as different option for files and folders.

  1. We have added a radio button group containing the options for user(External) & sharelink for files and folder:
    "Read only" (Nur Lesen)
    "Can edit" (Kann bearbeiten)
    we removed "can create", "can delete",

2.for link share on folder we have added one more option "Filedrop only"

3.Added dropdown containing the options of the radio button group for files and folder on user and share link
"Read only" (Nur Lesen)
"Can edit" (Kann bearbeiten)

  1. Sample screenshot of added dropdown is herewith

  2. Its only UI related changes , we have covered actual changes on ticket Adjust theme to nextcloud #3&NextCloud client unable to connect to server #4 for sharing , we will raised PR for same very soon.

Copy link
Collaborator

@claucambra claucambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the contributions are appreciated and this is something we might be interested in merging at some point, Unfortunately, this PR needs significant changes before that can be considered.

Chiefly, there are 3 major problems:

  1. Style -- the style of the changes is inconsistent and often makes the code difficult to read. Please adapt your code to follow the style of the rest of the desktop client
  2. Unrelated and unneeded changes -- I am not sure if this was caused by something such as a bad rebase of the branch, but this PR contains a significant amount of additions and changes that do not seem relevant to the changes mentioned in the description. Some of the changes that do seem related to the PR are also unclear (for instance, minute changes to window sizing in UI files). Please address this as at the moment this code is unmergeable and the CI pipelines for this PR are failing
  3. Screenshots -- just looking at the code it is very difficult to tell how the UI has changed. Please provide media such as screenshots and screen recordings to demonstrate the changes so that reviewers on both the Desktop Client team and the Design Team can review the visual changes, per the PR template

Comment on lines +1 to +54
On Error goto 0

Const HKEY_LOCAL_MACHINE = &H80000002

Const strObjRegistry = "winmgmts:\\.\root\default:StdRegProv"

Function RegistryDeleteKeyRecursive(regRoot, strKeyPath)
Set objRegistry = GetObject(strObjRegistry)
objRegistry.EnumKey regRoot, strKeyPath, arrSubkeys
If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
RegistryDeleteKeyRecursive regRoot, strKeyPath & "\" & strSubkey
Next
End If
objRegistry.DeleteKey regRoot, strKeyPath
End Function

Function RegistryListSubkeys(regRoot, strKeyPath)
Set objRegistry = GetObject(strObjRegistry)
objRegistry.EnumKey regRoot, strKeyPath, arrSubkeys
RegistryListSubkeys = arrSubkeys
End Function

Function GetUserSID()
Dim objWshNetwork, objUserAccount

Set objWshNetwork = CreateObject("WScript.Network")

Set objUserAccount = GetObject("winmgmts://" & objWshNetwork.UserDomain & "/root/cimv2").Get("Win32_UserAccount.Domain='" & objWshNetwork.ComputerName & "',Name='" & objWshNetwork.UserName & "'")
GetUserSID = objUserAccount.SID
End Function

Function RegistryCleanupSyncRootManager()
strSyncRootManagerKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager"

arrSubKeys = RegistryListSubkeys(HKEY_LOCAL_MACHINE, strSyncRootManagerKeyPath)

If IsArray(arrSubkeys) Then
arrSubkeys=Filter(arrSubkeys, Session.Property("APPNAME"))
End If
If IsArray(arrSubkeys) Then
arrSubkeys=Filter(arrSubkeys, GetUserSID())
End If

If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
RegistryDeleteKeyRecursive HKEY_LOCAL_MACHINE, strSyncRootManagerKeyPath & "\" & strSubkey
Next
End If
End Function

Function RegistryCleanup()
RegistryCleanupSyncRootManager()
End Function
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem unrelated

Comment on lines +1 to +53
[General]
Branch = master
ShallowClone = True

# Variables defined here override the default value
# The variable names are casesensitive
[Variables]
#Values need to be overwritten to create a chache
UseCache = True
CreateCache = False

# Settings applicable for all Crafts matrices
# Settings are Category/key=value
# Category is case sensitive
[GeneralSettings]

## This is the location of your python installation.
## This value must be set.
Paths/Python = C:\Python39-x64
Paths/Python27 = C:\Python27-x64

Compile/BuildType = RelWithDebInfo

Compile/UseNinja = True

Paths/downloaddir = ${Variables:Root}\downloads
ShortPath/Enabled = False
ShortPath/EnableJunctions = True
ShortPath/JunctionDir = C:\CM-SP\

; Packager/RepositoryUrl = https://files.kde.org/craft/
Packager/PackageType = NullsoftInstallerPackager
Packager/RepositoryUrl = http://ftp.acc.umu.se/mirror/kde.org/files/craft/master/

ContinuousIntegration/Enabled = True

## This option can be used to override the default make program
## change the value to the path of the executable you want to use instead.
Compile/MakeProgram = jom

Packager/UseCache = ${Variables:UseCache}
Packager/CreateCache = ${Variables:CreateCache}
Packager/CacheDir = ${Variables:Root}\cache

[BlueprintSettings]
# don't try to pip install on the ci
python-modules.ignored = True
nextcloud-client.buildTests = True
binary/mysql.useMariaDB = False

[windows-msvc2019_64-cl]
QtSDK/Compiler = msvc2019_64
General/ABI = windows-msvc2019_64-cl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes also seem unrelated, it looks like there has been a mistake somewhere, maybe rebasing the branch?

Comment on lines +1 to +42
version: '{build}-{branch}'

image: Visual Studio 2019

branches:
only:
- master

clone_depth: 1

init:
- ps: |
function craft() {
cmd /C "echo %PATH%"
& "C:\Python39-x64\python.exe" "C:\CraftMaster\CraftMaster\CraftMaster.py" --config "$env:APPVEYOR_BUILD_FOLDER\appveyor.ini" --variables "APPVEYOR_BUILD_FOLDER=$env:APPVEYOR_BUILD_FOLDER" --target $env:TARGET -c $args
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}
function crafttests() {
cmd /C "echo %PATH%"
& "C:\Python39-x64\python.exe" "C:\CraftMaster\CraftMaster\CraftMaster.py" --config "$env:APPVEYOR_BUILD_FOLDER\appveyor.ini" --variables "APPVEYOR_BUILD_FOLDER=$env:APPVEYOR_BUILD_FOLDER" --target $env:TARGET -c $args
}

install:
- ps: |
#use cmd to silence powershell behaviour for stderr
& cmd /C "git clone -q --depth=1 https://invent.kde.org/packaging/craftmaster.git C:\CraftMaster\CraftMaster 2>&1"
craft --add-blueprint-repository [git]https://github.com/nextcloud/desktop-client-blueprints.git
craft craft
craft --install-deps nextcloud-client
craft nsis

build_script:
- ps: |
craft --src-dir $env:APPVEYOR_BUILD_FOLDER nextcloud-client

test_script:
- ps: |
crafttests --test --src-dir $env:APPVEYOR_BUILD_FOLDER nextcloud-client

environment:
matrix:
- TARGET: windows-msvc2019_64-cl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once more these seem unrelated

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>385</width>
<height>400</height>
<height>404</height>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why the four extra pixels are needed here

Comment on lines -198 to +199
<width>359</width>
<height>320</height>
<width>361</width>
<height>314</height>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not sure why these tiny adjustments to the dialog size are needed?


} else if (action == _allowUploadLinkAction && state) {
perm = SharePermissionCreate;
_linkShare->setPermissions(perm);
_ui->currentPermission_3->setText(action->text());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ui->currentPermission_3->setText(action->text());
_ui->currentPermission_3->setText(action->text());

Comment on lines -201 to +217
_allowUploadLinkAction = permissionsGroup->addAction(tr("File drop (upload only)"));
_allowUploadLinkAction = permissionsGroup->addAction(tr("File drop"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous string was better, more descriptive

Comment on lines +489 to +490
// QString menuStyle("QMenu::item:checked{color: #e20074;}");
// permissionMenu->setStyleSheet(menuStyle);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not needed please remove

// QString menuStyle("QMenu::item:checked{color: #e20074;}");
// permissionMenu->setStyleSheet(menuStyle);


_permissionReshare= new QAction(tr("Can reshare"), this);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_permissionReshare= new QAction(tr("Can reshare"), this);
_permissionReshare = new QAction(tr("Can reshare"), this);

@@ -589,7 +607,7 @@ ShareUserLine::ShareUserLine(AccountPtr account, QSharedPointer<UserGroupShare>
* https://github.com/owncloud/client/issues/4996
*/
if (share->getShareType() == Share::TypeRemote
&& share->account()->serverVersionInt() < Account::makeServerVersion(9, 1, 0)) {
&& share->account()->serverVersionInt() < Account::makeServerVersion(9, 1, 0)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

@codecov
Copy link

codecov bot commented Aug 19, 2022

Codecov Report

Merging #4858 (81f6ddb) into master (a8b296c) will not change coverage.
The diff coverage is n/a.

❗ Current head 81f6ddb differs from pull request most recent head 3095d5f. Consider uploading reports for the commit 3095d5f to get more accurate results

@@           Coverage Diff           @@
##           master    #4858   +/-   ##
=======================================
  Coverage   57.21%   57.21%           
=======================================
  Files         138      138           
  Lines       17144    17144           
=======================================
  Hits         9809     9809           
  Misses       7335     7335           
Impacted Files Coverage Δ
src/libsync/propagatedownload.cpp 65.18% <0.00%> (ø)

@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-4858-3095d5f8cc4f54ef6a5d2694c53548676af4f645-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@TSI-pranalideshpande
Copy link
Author

Hi ,Thanks for the review , I observed some issues in rebasing and while creating pull request for this branch some files are unnecesarily raised for PR , I am planing to create new branch and then will raise pr for that.

@claucambra
Copy link
Collaborator

Closing now that #4929 has been merged and this is not compatible

@claucambra claucambra closed this Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants