Merge pull request #29443 from nextcloud/backport/stable21/26841

[stable21] Implement local filtering in file list
This commit is contained in:
Louis 2021-10-26 15:09:29 +02:00 committed by GitHub
commit df8ec07862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 58 additions and 20 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
apps/files/js/dist/main.js vendored Normal file

File diff suppressed because one or more lines are too long

1
apps/files/js/dist/main.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -190,7 +190,7 @@ class ViewController extends Controller {
// Load the files we need
\OCP\Util::addStyle('files', 'merged');
\OCP\Util::addScript('files', 'merged-index');
\OCP\Util::addScript('files', 'dist/templates');
\OCP\Util::addScript('files', 'dist/main');
// mostly for the home storage's free space
// FIXME: Make non static

View file

@ -0,0 +1,42 @@
/*
* @copyright Copyright (c) 2021 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @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/>.
*
*/
import { subscribe } from '@nextcloud/event-bus'
(function() {
const FilesPlugin = {
attach(fileList) {
subscribe('nextcloud:unified-search.search', ({ query }) => {
fileList.setFilter(query)
})
subscribe('nextcloud:unified-search.reset', () => {
this.query = null
fileList.setFilter('')
})
},
}
window.OC.Plugins.register('OCA.Files.FileList', FilesPlugin)
})()

3
apps/files/src/main.js Normal file
View file

@ -0,0 +1,3 @@
import './files-app-settings'
import './templates'
import './legacy/filelistSearch'

View file

@ -1,6 +1,3 @@
<?php
script(\OCA\Files\AppInfo\Application::APP_ID, 'dist/files-app-settings');
?>
<div id="app-navigation">
<ul class="with-icon">

View file

@ -5,7 +5,7 @@
<input type="hidden" name="dir" value="" id="dir">
<div class="nofilterresults hidden">
<div class="nofilterresults emptycontent hidden">
<div class="icon-search"></div>
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
<p></p>

View file

@ -8,7 +8,7 @@
<input type="hidden" name="dir" value="" id="dir">
<div class="nofilterresults hidden">
<div class="nofilterresults emptycontent hidden">
<div class="icon-search"></div>
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
<p></p>

View file

@ -2,9 +2,8 @@ const path = require('path');
module.exports = {
entry: {
main: path.join(__dirname, 'src', 'main.js'),
sidebar: path.join(__dirname, 'src', 'sidebar.js'),
templates: path.join(__dirname, 'src', 'templates.js'),
'files-app-settings': path.join(__dirname, 'src', 'files-app-settings.js'),
'personal-settings': path.join(__dirname, 'src', 'main-personal-settings.js'),
},
output: {

View file

@ -5,7 +5,7 @@
<input type="hidden" name="dir" value="" id="dir">
<div class="nofilterresults hidden">
<div class="nofilterresults emptycontent hidden">
<div class="icon-search"></div>
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
</div>

View file

@ -12,7 +12,7 @@
<input type="hidden" name="dir" value="" id="dir">
<div class="nofilterresults hidden">
<div class="nofilterresults emptycontent hidden">
<div class="icon-search"></div>
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
<p></p>