Skip to content

Commit b6d22f3

Browse files
authored
Merge pull request #57648 from nextcloud/chore/drop-jquery
chore!: drop jQuery UI and jQuery
2 parents 867ef52 + 0b37d37 commit b6d22f3

File tree

192 files changed

+538
-6001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+538
-6001
lines changed

apps/files_sharing/src/collaborationresourceshandler.js

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { getCSPNonce } from '@nextcloud/auth'
7+
import { FilePickerType, getFilePickerBuilder } from '@nextcloud/dialogs'
8+
import { t } from '@nextcloud/l10n'
9+
10+
__webpack_nonce__ = getCSPNonce()
11+
12+
window.OCP.Collaboration.registerType('file', {
13+
typeString: t('files_sharing', 'Link to a file'),
14+
typeIconClass: 'icon-files-dark',
15+
async action() {
16+
const filePicker = getFilePickerBuilder(t('files_sharing', 'Link to a file'))
17+
.setType(FilePickerType.Choose)
18+
.allowDirectories(true)
19+
.build()
20+
21+
try {
22+
const [node] = await filePicker.pickNodes()
23+
return node!.fileid
24+
} catch {
25+
throw new Error('Cannot get fileinfo')
26+
}
27+
},
28+
})

apps/files_sharing/src/services/FileInfo.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import type { Attribute, INode } from '@nextcloud/files'
77

8+
import { Permission } from '@nextcloud/files'
9+
810
interface RawLegacyFileInfo {
911
id: number
1012
path: string
@@ -57,13 +59,31 @@ export default function(node: INode): LegacyFileInfo {
5759
attributes: node.attributes,
5860
}
5961

60-
const fileInfo = new OC.Files.FileInfo(rawFileInfo)
61-
6262
// TODO remove when no more legacy backbone is used
63-
fileInfo.get = (key) => fileInfo[key]
64-
fileInfo.isDirectory = () => fileInfo.mimetype === 'httpd/unix-directory'
65-
fileInfo.canEdit = () => Boolean(fileInfo.permissions & OC.PERMISSION_UPDATE)
66-
fileInfo.node = node
63+
const fileInfo: LegacyFileInfo = {
64+
...rawFileInfo,
65+
node,
66+
67+
get(key) {
68+
return this[key]
69+
},
70+
isDirectory() {
71+
return this.mimetype === 'httpd/unix-directory'
72+
},
73+
canEdit() {
74+
return Boolean(this.permissions & Permission.UPDATE)
75+
},
76+
canDownload() {
77+
for (const i in this.shareAttributes) {
78+
const attr = this.shareAttributes[i]
79+
if (attr.scope === 'permissions' && attr.key === 'download') {
80+
return attr.value === true
81+
}
82+
}
83+
84+
return true
85+
},
86+
}
6787

6888
return fileInfo
6989
}

apps/workflowengine/lib/Listener/LoadAdditionalSettingsScriptsListener.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
/** @template-implements IEventListener<LoadSettingsScriptsEvent> */
1919
class LoadAdditionalSettingsScriptsListener implements IEventListener {
2020
public function handle(Event $event): void {
21-
Util::addScript('core', 'files_fileinfo');
22-
Util::addScript('core', 'files_client');
2321
Util::addScript('core', 'systemtags');
2422
Util::addScript(Application::APP_ID, 'workflowengine');
2523
}

build/eslint-baseline-legacy.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@
6060
"count": 1
6161
}
6262
},
63-
"core/src/OC/dialogs.js": {
64-
"camelcase": {
65-
"count": 33
66-
},
67-
"no-undef": {
68-
"count": 1
69-
}
70-
},
7163
"core/src/views/Login.vue": {
7264
"vue/multi-word-component-names": {
7365
"count": 1

0 commit comments

Comments
 (0)