Browse Source

Fix files app LoadSidebar event

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
tags/v18.0.0beta1
John Molakvoæ (skjnldsv) 4 years ago
parent
commit
241aac9f94

+ 1
- 0
apps/files/composer/composer/autoload_classmap.php View File

@@ -44,6 +44,7 @@ return array(
'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir . '/../lib/Exception/TransferOwnershipException.php',
'OCA\\Files\\Helper' => $baseDir . '/../lib/Helper.php',
'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php',
'OCA\\Files\\Migration\\Version11301Date20191113195931' => $baseDir . '/../lib/Migration/Version11301Date20191113195931.php',
'OCA\\Files\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
'OCA\\Files\\Service\\DirectEditingService' => $baseDir . '/../lib/Service/DirectEditingService.php',

+ 1
- 0
apps/files/composer/composer/autoload_static.php View File

@@ -59,6 +59,7 @@ class ComposerStaticInitFiles
'OCA\\Files\\Exception\\TransferOwnershipException' => __DIR__ . '/..' . '/../lib/Exception/TransferOwnershipException.php',
'OCA\\Files\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => __DIR__ . '/..' . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php',
'OCA\\Files\\Listener\\LoadSidebarListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarListener.php',
'OCA\\Files\\Migration\\Version11301Date20191113195931' => __DIR__ . '/..' . '/../lib/Migration/Version11301Date20191113195931.php',
'OCA\\Files\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
'OCA\\Files\\Service\\DirectEditingService' => __DIR__ . '/..' . '/../lib/Service/DirectEditingService.php',

+ 4
- 4
apps/files/js/dist/sidebar.js
File diff suppressed because it is too large
View File


+ 1
- 1
apps/files/js/dist/sidebar.js.map
File diff suppressed because it is too large
View File


+ 0
- 1
apps/files/js/merged-index.json View File

@@ -1,5 +1,4 @@
[
"dist/sidebar.js",
"app.js",
"breadcrumb.js",
"detailfileinfoview.js",

+ 3
- 2
apps/files/lib/AppInfo/Application.php View File

@@ -27,14 +27,14 @@

namespace OCA\Files\AppInfo;

use OCA\Files\Activity\Helper;
use OCA\Files\Capabilities;
use OCA\Files\Collaboration\Resources\Listener;
use OCA\Files\Collaboration\Resources\ResourceProvider;
use OCA\Files\Controller\ApiController;
use OCA\Files\Controller\ViewController;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCA\Files\Listener\LegacyLoadAdditionalScriptsAdapter;
use OCA\Files\Listener\LoadSidebarListener;
use OCA\Files\Notification\Notifier;
use OCA\Files\Service\TagService;
use OCP\AppFramework\App;
@@ -97,6 +97,7 @@ class Application extends App {
/** @var IEventDispatcher $dispatcher */
$dispatcher = $container->query(IEventDispatcher::class);
$dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LegacyLoadAdditionalScriptsAdapter::class);
$dispatcher->addServiceListener(LoadSidebar::class, LoadSidebarListener::class);

/** @var \OCP\Notification\IManager $notifications */
$notifications = $container->query(\OCP\Notification\IManager::class);

+ 42
- 0
apps/files/lib/Listener/LoadSidebarListener.php View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019, John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\Files\Listener;

use OCA\Files\AppInfo\Application;
use OCA\Files\Event\LoadSidebar;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Util;

class LoadSidebarListener implements IEventListener {
public function handle(Event $event): void {
if (!($event instanceof LoadSidebar)) {
return;
}

Util::addScript(Application::APP_ID, 'dist/sidebar');
}

}

+ 5
- 3
apps/files/src/sidebar.js View File

@@ -32,11 +32,13 @@ Vue.prototype.t = t

window.addEventListener('DOMContentLoaded', () => {
// Init Sidebar Service
if (window.OCA && window.OCA.Files) {
Object.assign(window.OCA.Files, { Sidebar: new Sidebar() })
Object.assign(window.OCA.Files.Sidebar, { Tab })
if (!window.OCA.Files) {
window.OCA.Files = {}
}

Object.assign(window.OCA.Files, { Sidebar: new Sidebar() })
Object.assign(window.OCA.Files.Sidebar, { Tab })

// Make sure we have a proper layout
if (document.getElementById('content')) {


+ 3
- 1
apps/files/src/views/Sidebar.vue View File

@@ -199,6 +199,8 @@ export default {
defaultAction() {
return this.fileInfo
&& OCA.Files && OCA.Files.App && OCA.Files.App.fileList
&& OCA.Files.App.fileList.fileActions
&& OCA.Files.App.fileList.fileActions.getDefaultFileAction
&& OCA.Files.App.fileList
.fileActions.getDefaultFileAction(this.fileInfo.mimetype, this.fileInfo.type, OC.PERMISSION_READ)

@@ -239,7 +241,7 @@ export default {
})
} catch (error) {
this.error = t('files', 'Error while loading the file data')
console.error('Error while loading the file data')
console.error('Error while loading the file data', error)
}
}
}

+ 1
- 1
apps/files_sharing/js/dist/files_sharing_tab.js
File diff suppressed because it is too large
View File


+ 1
- 1
apps/files_sharing/js/dist/files_sharing_tab.js.map
File diff suppressed because it is too large
View File


Loading…
Cancel
Save