mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
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>
This commit is contained in:
parent
4c241d4f4b
commit
f471bd292f
8 changed files with 15 additions and 11 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'), {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,7 +460,6 @@ export default {
|
|||
} else {
|
||||
this.externalShares.unshift(share)
|
||||
}
|
||||
this.externalShares.unshift(share)
|
||||
} else {
|
||||
this.shares.unshift(share)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue