aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/unified-search.ts
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/unified-search.ts')
-rw-r--r--core/src/unified-search.ts30
1 files changed, 7 insertions, 23 deletions
diff --git a/core/src/unified-search.ts b/core/src/unified-search.ts
index 24571f149a4..a13b1036da1 100644
--- a/core/src/unified-search.ts
+++ b/core/src/unified-search.ts
@@ -1,27 +1,10 @@
/**
- * @copyright Copyright (c) 2024 Fon E. Noel NFEBE <opensource@nfebe.com>
- *
- * @author Fon E. Noel NFEBE <opensource@nfebe.com>
- *
- * @license AGPL-3.0-or-later
- *
- * 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/>.
- *
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { getLoggerBuilder } from '@nextcloud/logger'
-import { getRequestToken } from '@nextcloud/auth'
+import { getCSPNonce } from '@nextcloud/auth'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import { createPinia, PiniaVuePlugin } from 'pinia'
import Vue from 'vue'
@@ -30,7 +13,7 @@ import UnifiedSearch from './views/UnifiedSearch.vue'
import { useSearchStore } from '../src/store/unified-search-external-filters.js'
// eslint-disable-next-line camelcase
-__webpack_nonce__ = btoa(getRequestToken())
+__webpack_nonce__ = getCSPNonce()
const logger = getLoggerBuilder()
.setApp('unified-search')
@@ -53,6 +36,7 @@ Vue.mixin({
interface UnifiedSearchAction {
id: string;
appId: string;
+ searchFrom: string;
label: string;
icon: string;
callback: () => void;
@@ -61,9 +45,9 @@ interface UnifiedSearchAction {
// Register the add/register filter action API globally
window.OCA = window.OCA || {}
window.OCA.UnifiedSearch = {
- registerFilterAction: ({ id, appId, label, callback, icon }: UnifiedSearchAction) => {
+ registerFilterAction: ({ id, appId, searchFrom, label, callback, icon }: UnifiedSearchAction) => {
const searchStore = useSearchStore()
- searchStore.registerExternalFilter({ id, appId, label, callback, icon })
+ searchStore.registerExternalFilter({ id, appId, searchFrom, label, callback, icon })
},
}