aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornfebe <fenn25.fn@gmail.com>2025-05-03 10:34:21 +0100
committernfebe <fenn25.fn@gmail.com>2025-05-06 14:28:01 +0100
commitf471bd292fa70937050f971cba3b07e8ca3ae9d2 (patch)
tree8a1cbb8cdad0d19e68e495677fcba6cf0867bf9c
parent4c241d4f4b8f329528b381ab4717316fe7fbbf1f (diff)
downloadnextcloud-server-f471bd292fa70937050f971cba3b07e8ca3ae9d2.tar.gz
nextcloud-server-f471bd292fa70937050f971cba3b07e8ca3ae9d2.zip
fix(files_sharing): Move `ConfigLexicon` to Config dir, update sharing input
- Fix autoloading for new `ConfigLexicon` - Ensure that sharing input in sharing tab respect `show-federated-shares-as-internal`: This is important, because when federated shares are shown as internal the users should add them from the internal shares section Signed-off-by: nfebe <fenn25.fn@gmail.com>
-rw-r--r--apps/files_sharing/composer/composer/autoload_classmap.php1
-rw-r--r--apps/files_sharing/composer/composer/autoload_static.php1
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php6
-rw-r--r--apps/files_sharing/lib/Config/ConfigLexicon.php (renamed from apps/files_sharing/lib/AppInfo/ConfigLexicon.php)2
-rw-r--r--apps/files_sharing/lib/Listener/LoadSidebarListener.php5
-rw-r--r--apps/files_sharing/src/components/SharingInput.vue6
-rw-r--r--apps/files_sharing/src/services/ConfigService.ts4
-rw-r--r--apps/files_sharing/src/views/SharingTab.vue1
8 files changed, 15 insertions, 11 deletions
diff --git a/apps/files_sharing/composer/composer/autoload_classmap.php b/apps/files_sharing/composer/composer/autoload_classmap.php
index 8682fd5f238..92751ead730 100644
--- a/apps/files_sharing/composer/composer/autoload_classmap.php
+++ b/apps/files_sharing/composer/composer/autoload_classmap.php
@@ -29,6 +29,7 @@ return array(
'OCA\\Files_Sharing\\Command\\ExiprationNotification' => $baseDir . '/../lib/Command/ExiprationNotification.php',
'OCA\\Files_Sharing\\Command\\FixShareOwners' => $baseDir . '/../lib/Command/FixShareOwners.php',
'OCA\\Files_Sharing\\Command\\ListShares' => $baseDir . '/../lib/Command/ListShares.php',
+ 'OCA\\Files_Sharing\\Config\\ConfigLexicon' => $baseDir . '/../lib/Config/ConfigLexicon.php',
'OCA\\Files_Sharing\\Controller\\AcceptController' => $baseDir . '/../lib/Controller/AcceptController.php',
'OCA\\Files_Sharing\\Controller\\DeletedShareAPIController' => $baseDir . '/../lib/Controller/DeletedShareAPIController.php',
'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => $baseDir . '/../lib/Controller/ExternalSharesController.php',
diff --git a/apps/files_sharing/composer/composer/autoload_static.php b/apps/files_sharing/composer/composer/autoload_static.php
index 3bf5bcdffda..6ca952007a1 100644
--- a/apps/files_sharing/composer/composer/autoload_static.php
+++ b/apps/files_sharing/composer/composer/autoload_static.php
@@ -44,6 +44,7 @@ class ComposerStaticInitFiles_Sharing
'OCA\\Files_Sharing\\Command\\ExiprationNotification' => __DIR__ . '/..' . '/../lib/Command/ExiprationNotification.php',
'OCA\\Files_Sharing\\Command\\FixShareOwners' => __DIR__ . '/..' . '/../lib/Command/FixShareOwners.php',
'OCA\\Files_Sharing\\Command\\ListShares' => __DIR__ . '/..' . '/../lib/Command/ListShares.php',
+ 'OCA\\Files_Sharing\\Config\\ConfigLexicon' => __DIR__ . '/..' . '/../lib/Config/ConfigLexicon.php',
'OCA\\Files_Sharing\\Controller\\AcceptController' => __DIR__ . '/..' . '/../lib/Controller/AcceptController.php',
'OCA\\Files_Sharing\\Controller\\DeletedShareAPIController' => __DIR__ . '/..' . '/../lib/Controller/DeletedShareAPIController.php',
'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => __DIR__ . '/..' . '/../lib/Controller/ExternalSharesController.php',
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 1fdd042869f..8ddb3afaf33 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -13,6 +13,7 @@ use OC\User\DisplayNameCache;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCA\Files_Sharing\Capabilities;
+use OCA\Files_Sharing\Config\ConfigLexicon;
use OCA\Files_Sharing\External\Manager;
use OCA\Files_Sharing\External\MountProvider as ExternalMountProvider;
use OCA\Files_Sharing\Helper;
@@ -38,7 +39,6 @@ use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
-use OCP\AppFramework\Services\IInitialState;
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudIdManager;
@@ -49,7 +49,6 @@ use OCP\Files\Events\Node\BeforeNodeReadEvent;
use OCP\Group\Events\GroupChangedEvent;
use OCP\Group\Events\GroupDeletedEvent;
use OCP\Group\Events\UserAddedEvent;
-use OCP\IAppConfig;
use OCP\IDBConnection;
use OCP\IGroup;
use OCP\Share\Events\ShareCreatedEvent;
@@ -116,9 +115,6 @@ class Application extends App implements IBootstrap {
public function boot(IBootContext $context): void {
$context->injectFn([$this, 'registerMountProviders']);
$context->injectFn([$this, 'registerEventsScripts']);
- $context->injectFn(function (IInitialState $initialState, IAppConfig $appConfig) {
- $initialState->provideInitialState('showFederatedSharesAsInternal', $appConfig->getValueBool(self::APP_ID, ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL));
- });
Helper::registerHooks();
diff --git a/apps/files_sharing/lib/AppInfo/ConfigLexicon.php b/apps/files_sharing/lib/Config/ConfigLexicon.php
index 90739fac633..a463b4e7ef2 100644
--- a/apps/files_sharing/lib/AppInfo/ConfigLexicon.php
+++ b/apps/files_sharing/lib/Config/ConfigLexicon.php
@@ -6,7 +6,7 @@ declare(strict_types=1);
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-namespace OCA\Files_Sharing\AppInfo;
+namespace OCA\Files_Sharing\Config;
use NCU\Config\Lexicon\ConfigLexiconEntry;
use NCU\Config\Lexicon\ConfigLexiconStrictness;
diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php
index b00e937d675..9f0eee9159a 100644
--- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php
+++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php
@@ -11,9 +11,12 @@ namespace OCA\Files_Sharing\Listener;
use OCA\Files\Event\LoadSidebar;
use OCA\Files_Sharing\AppInfo\Application;
+use OCA\Files_Sharing\Config\ConfigLexicon;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
+use OCP\IAppConfig;
+use OCP\Server;
use OCP\Share\IManager;
use OCP\Util;
@@ -33,6 +36,8 @@ class LoadSidebarListener implements IEventListener {
return;
}
+ $appConfig = Server::get(IAppConfig::class);
+ $this->initialState->provideInitialState('showFederatedSharesAsInternal', $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL));
Util::addScript(Application::APP_ID, 'files_sharing_tab', 'files');
}
}
diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue
index a7d5ed73eaf..b886ba95a17 100644
--- a/apps/files_sharing/src/components/SharingInput.vue
+++ b/apps/files_sharing/src/components/SharingInput.vue
@@ -196,7 +196,7 @@ export default {
const remoteTypes = [ShareType.Remote, ShareType.RemoteGroup]
- if (this.isExternal) {
+ if (this.isExternal && !this.config.showFederatedSharesAsInternal) {
shareType.push(...remoteTypes)
} else {
shareType = shareType.concat([
@@ -214,6 +214,10 @@ export default {
}
}
+ if (getCapabilities().files_sharing.public.enabled === true && this.isExternal) {
+ shareType.push(ShareType.Email)
+ }
+
let request = null
try {
request = await axios.get(generateOcsUrl('apps/files_sharing/api/v1/sharees'), {
diff --git a/apps/files_sharing/src/services/ConfigService.ts b/apps/files_sharing/src/services/ConfigService.ts
index b92887d18b6..2114e2d1bae 100644
--- a/apps/files_sharing/src/services/ConfigService.ts
+++ b/apps/files_sharing/src/services/ConfigService.ts
@@ -312,9 +312,7 @@ export default class Config {
* @return {boolean}
*/
get showFederatedSharesAsInternal(): boolean {
- const showFederatedSharesAsInternal = loadState('files_sharing', 'showFederatedSharesAsInternal', false)
-
- return !!showFederatedSharesAsInternal
+ return loadState('files_sharing', 'showFederatedSharesAsInternal', false)
}
}
diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue
index f9b7737f1ef..1b5275bcf7e 100644
--- a/apps/files_sharing/src/views/SharingTab.vue
+++ b/apps/files_sharing/src/views/SharingTab.vue
@@ -460,7 +460,6 @@ export default {
} else {
this.externalShares.unshift(share)
}
- this.externalShares.unshift(share)
} else {
this.shares.unshift(share)
}