aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2023-09-21 17:33:44 +0200
committerGitHub <noreply@github.com>2023-09-21 17:33:44 +0200
commit472440b296f405a159fc3363bd0ea250fda4f972 (patch)
tree7f1ccc37569261bf08785aadb66d2aa62138013b /apps/files_external
parentef87ff18487d4d78a392f7e44cd9f094a0a73371 (diff)
parentbf467ad7f78c681c45649034cc443a53ebe41cfc (diff)
downloadnextcloud-server-472440b296f405a159fc3363bd0ea250fda4f972.tar.gz
nextcloud-server-472440b296f405a159fc3363bd0ea250fda4f972.zip
Merge pull request #40551 from nextcloud/fix/init-script
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Listener/LoadAdditionalListener.php2
-rw-r--r--apps/files_external/src/actions/enterCredentialsAction.ts4
-rw-r--r--apps/files_external/src/actions/inlineStorageCheckAction.ts4
-rw-r--r--apps/files_external/src/actions/openInFilesAction.ts4
-rw-r--r--apps/files_external/src/init.ts (renamed from apps/files_external/src/main.ts)16
5 files changed, 16 insertions, 14 deletions
diff --git a/apps/files_external/lib/Listener/LoadAdditionalListener.php b/apps/files_external/lib/Listener/LoadAdditionalListener.php
index e5cb5e96d0a..5f56a14c4ce 100644
--- a/apps/files_external/lib/Listener/LoadAdditionalListener.php
+++ b/apps/files_external/lib/Listener/LoadAdditionalListener.php
@@ -50,6 +50,8 @@ class LoadAdditionalListener implements IEventListener {
$allowUserMounting = $this->config->getAppValue('files_external', 'allow_user_mounting', 'no') === 'yes';
$this->initialState->provideInitialState('allowUserMounting', $allowUserMounting);
+
+ Util::addInitScript(Application::APP_ID, 'init');
Util::addScript(Application::APP_ID, 'main', 'files');
}
}
diff --git a/apps/files_external/src/actions/enterCredentialsAction.ts b/apps/files_external/src/actions/enterCredentialsAction.ts
index 49b0ab4076e..eeb2f5f8793 100644
--- a/apps/files_external/src/actions/enterCredentialsAction.ts
+++ b/apps/files_external/src/actions/enterCredentialsAction.ts
@@ -31,7 +31,7 @@ import axios from '@nextcloud/axios'
import LoginSvg from '@mdi/svg/svg/login.svg?raw'
import Vue from 'vue'
-import { registerFileAction, FileAction, DefaultType } from '@nextcloud/files'
+import { FileAction, DefaultType } from '@nextcloud/files'
import { STORAGE_STATUS, isMissingAuthConfig } from '../utils/credentialsUtils'
import { isNodeExternalStorage } from '../utils/externalStorageUtils'
@@ -106,5 +106,3 @@ export const action = new FileAction({
default: DefaultType.DEFAULT,
inline: () => true,
})
-
-registerFileAction(action)
diff --git a/apps/files_external/src/actions/inlineStorageCheckAction.ts b/apps/files_external/src/actions/inlineStorageCheckAction.ts
index fa2f567b1f7..46e38eab47e 100644
--- a/apps/files_external/src/actions/inlineStorageCheckAction.ts
+++ b/apps/files_external/src/actions/inlineStorageCheckAction.ts
@@ -32,7 +32,7 @@ import '../css/fileEntryStatus.scss'
import { getStatus, type StorageConfig } from '../services/externalStorage'
import { isMissingAuthConfig, STORAGE_STATUS } from '../utils/credentialsUtils'
import { isNodeExternalStorage } from '../utils/externalStorageUtils'
-import { registerFileAction, FileAction } from '@nextcloud/files'
+import { FileAction } from '@nextcloud/files'
export const action = new FileAction({
id: 'check-external-storage',
@@ -92,5 +92,3 @@ export const action = new FileAction({
order: 10,
})
-
-registerFileAction(action)
diff --git a/apps/files_external/src/actions/openInFilesAction.ts b/apps/files_external/src/actions/openInFilesAction.ts
index 0359e81998d..8033caed123 100644
--- a/apps/files_external/src/actions/openInFilesAction.ts
+++ b/apps/files_external/src/actions/openInFilesAction.ts
@@ -25,7 +25,7 @@ import type { StorageConfig } from '../services/externalStorage'
import { generateUrl } from '@nextcloud/router'
import { translate as t } from '@nextcloud/l10n'
-import { registerFileAction, FileAction, DefaultType } from '@nextcloud/files'
+import { FileAction, DefaultType } from '@nextcloud/files'
import { STORAGE_STATUS } from '../utils/credentialsUtils'
export const action = new FileAction({
@@ -71,5 +71,3 @@ export const action = new FileAction({
order: -1000,
default: DefaultType.HIDDEN,
})
-
-registerFileAction(action)
diff --git a/apps/files_external/src/main.ts b/apps/files_external/src/init.ts
index c85dd371f51..ccce2448dfe 100644
--- a/apps/files_external/src/main.ts
+++ b/apps/files_external/src/init.ts
@@ -19,18 +19,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-import { translate as t } from '@nextcloud/l10n'
import { loadState } from '@nextcloud/initial-state'
+import { translate as t } from '@nextcloud/l10n'
+import { View, getNavigation, Column, registerFileAction } from '@nextcloud/files'
import FolderNetworkSvg from '@mdi/svg/svg/folder-network.svg?raw'
-import './actions/enterCredentialsAction'
-import './actions/inlineStorageCheckAction'
-import './actions/openInFilesAction'
+import { action as enterCredentialsAction } from './actions/enterCredentialsAction'
+import { action as inlineStorageCheckAction } from './actions/inlineStorageCheckAction'
+import { action as openInFilesAction } from './actions/openInFilesAction'
import { getContents } from './services/externalStorage'
-import { View, getNavigation, Column } from '@nextcloud/files'
const allowUserMounting = loadState('files_external', 'allowUserMounting', false)
+// Register view
const Navigation = getNavigation()
Navigation.register(new View({
id: 'extstoragemounts',
@@ -73,3 +74,8 @@ Navigation.register(new View({
getContents,
}))
+
+// Register actions
+registerFileAction(enterCredentialsAction)
+registerFileAction(inlineStorageCheckAction)
+registerFileAction(openInFilesAction)