Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set file search by certain number of characters in config.php #12065

Closed
wants to merge 237 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 26, 2018

I could not push it to branch, coz "access denied", so i try it this way.

server/config/config.php

<?php
$CONFIG = array(
...
    'searchby' => 2, //file search starts after this number of characters is typed
);

server/core/templates/layout.user.php

<div class="header-right">
				<form class="searchbox" action="#" method="post" role="search" novalidate>
					<label for="searchbox" class="hidden-visually">
						<?php p($l->t('Search'));?>
                        <input id="searchby" type="hidden" value="<?php p(\OC::$server->getConfig()->getSystemValue('searchby')) ?>"> //add this line
					</label>
					<input id="searchbox" type="search" name="query"
						value="" required class="hidden icon-search-white"
						autocomplete="off">
					<button class="icon-close-white" type="reset"><span class="hidden-visually"><?php p($l->t('Reset search'));?></span></button>
				</form>`

server/core/search/js/search.js

            /**
             * Search
             */
            this.search = function(event) {
                event.preventDefault();
                var query = document.getElementById('searchbox').value;
                var searchby = document.getElementById('searchby').value;  //add this line
                if (query.length >= searchby) {
                    self.searchCallback(query);
                } else {
                    self.resetCallback();
                }
            };

weeman1337 and others added 30 commits September 3, 2018 21:13
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
[stable14] Updates logo scss to regard default values
…rameters

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
[stable14] remove LogicException, because it's also triggered with legitimate pa…
Visually it makes no difference, but as the ".avatar" element is inside
a "span" element it can not be a block element to be compliant with the
HTML specification.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The avatar should be shown immediately after the avatar to be able to
accurately define the space between them using only CSS rules.

Note that in the case of the "atwho" menu it is not really needed, as a
whitespace removal seems to be done automatically by the plugin, but it
was modified for its displayed elements too for consistency.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Different browsers use different font weights for strong elements
(Chromium uses "bold", but Firefox uses "bolder", which is relative to
the font weight of the parent), so now the user name in mentions is
explicitly shown with a bold weight.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Like done in Talk, mentions to the current user are now shown with the
primary colors to make them more prominent.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When the cursor is on an avatar wrapper the cursor is shown as a pointer
to inform the user that it can be clicked (which will either show the
contacts menu or insert a mention, depending on the case); the cursor
must be explicitly defined for the "img" element that shows the avatar
too, or otherwise the default cursor would be shown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Most of the properties of the rule are not needed for mentions, so the
rule is no longer applied to them; the only needed property was moved to
the main rule for mentions.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Otherwise a line break could be added between the avatar and the user
name when the wrapper is close to the right border of the message.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Fixes #10584

We deleted the main token when using the login flow else mutliple tokens
would show up for a single user.

However in the case of OAuth this is perfectly fine as the
authentication happens really in your browser:

1. You are already logged in, no need to log you out
2. You are not logged in yet, but since you log in into the exact same
browser the expected behavior is to stay logged in.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Just to be sure that the field is also not 0

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
…ogress

Fixes the upload progress bar layout - 14 backport
[stable14] Do not invalidate main token on OAuth
Signed-off-by: Robin Appelman <robin@icewind.nl>
[14] fix js files client for user names with spaces
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
…ken-with-integer-only-users

[stable14] Fix user and group listing with users that have an integer user id
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
fix check for more users

after a refactor users et al were undefined. The check condition was moved.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

don't user a higher paging size than max autocomplete entries are set

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

adjust and extend js unit tests

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
danxuliu and others added 22 commits October 23, 2018 16:44
When a section is open in the Files app a "show" event is triggered.
File list objects handle that event by reloading themselves, but only
if the file list was shown at least once. However, the file list objects
of plugins are created when the "show" event is triggered for the first
time for their section; as the file list objects register their handler
for the "show" event when they are created they never handle the first
triggered "show" event, as the handler is set while that event is being
already handled. Therefore, from the point of view of the handler, the
second time that a "show" event was triggered it was seen as if the file
list was shown for the first time, and thus it was not reloaded. Now the
"shown" property is explicitly set for those file lists that are created
while handling a "show" event, which causes them to be reloaded as
expected when opening their section again.

Note that it is not possible to just reload the file list whenever it is
shown; the file list is reloaded also when the directory changes, and
this can happen when the web page is initially loaded and the URL is
parsed. In that case, if file lists were reloaded when shown for the
first time then it could be reloaded twice, one with the default
parameters due to the "show" event and another one with the proper
parameters once the URL was parsed, and the files that appeard in the
list would depend on which response from the server was received the
last.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The custom handler for "URL changed" events were added to reload the
file list whenever the sections for favorites and shares were opened;
this was used to fix the problem of not reloading the file lists when
opening them for a second time. However, besides that the handlers were
not really necessary, and as the root of the bug was fixed in the
previous commit those handlers are now removed.

The file list for tags uses the handler for a different purpose, though,
so that one was kept.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Robin Appelman <robin@icewind.nl>
[14] Do not emit preHooks twice on non-part-storage
lazy open first source stream in assemblystream
…-section-again-in-the-files-app

[stable14] Fix opening a section again in the Files app
In 2f87fb6 this header was introduced. The referenced documentation says:

> When delivered with a response from https://example.com/clear, the following header will cause cookies associated with the origin https://example.com to be cleared, as well as cookies on any origin in the same registered domain (e.g. https://www.example.com/ and https://more.subdomains.example.com/).

This also applies if `https://nextcloud.example.com/` sends the `Clear-Site-Data: "cookies"` header.
This is not the behavior we want at this point!

So I removed the deletion of cookies from the header. This has no effect on the logout process as this header is supported only recently and the logout works in old browsers as well.

Signed-off-by: Patrick Conrad <conrad@iza.org>
(cherry picked from commit 1806baa)
Adding a check to see if keyFileContents is empty:

* this fixes a download error and an exception if the data content
  for encryption is empty
* #3958: for recovering encrypted files with a damaged signature
  this is necessary in addition to turning the signature check off

Signed-off-by: Stefan Weiberg <sweiberg@suse.com>
…e-stable14

[stable14] always query the lookup server in a global scale setup
[stable14] Remove cookies from Clear-Site-Data Header
Fixes #11919

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
…s-fallback

[stable14] Forwarded ExpiredTokenException
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
[stable14] Improve encrypt all / decrypt all
@MorrisJobke
Copy link
Member

I could not push it to branch, coz "access denied", so i try it this way.

You need to create a fork on GitHub to which you then have push access and create a pull request based on. But first of all we should discuss if this is something that should be configurable. Best is to have an issue first where we can collect arguments. We should address the underlying issue and not come up with a solution to something where we don't know why it should be added. Could you describe your use case and your reason to solve it that way? Thanks

@ghost
Copy link
Author

ghost commented Oct 27, 2018

Well, at first, thank you for the advice.

This "solution" is for corporate use. They usually have large amount of files in nextcloud so when they search for some files it freezes and the browser crashes. The reason i solve it this way is that i had no other clue how to do it. I understand it is not the best solution.

@MorrisJobke
Copy link
Member

This "solution" is for corporate use. They usually have large amount of files in nextcloud so when they search for some files it freezes and the browser crashes. The reason i solve it this way is that i had no other clue how to do it. I understand it is not the best solution.

Even then it should not freeze.

If you wish to have this feature implemented by the Nextcloud GmbH or wish further corporate support there is the option for consulting work on top of your Nextcloud Enterprise subscription to get your features implemented.

@tomtomas99911
Copy link

I think it is a good function also for personal use. When you have many files in folder you cannot search it effectively - with this function you can.

Why it cannot be implemented into upstream?

@MorrisJobke
Copy link
Member

I think it is a good function also for personal use. When you have many files in folder you cannot search it effectively - with this function you can.

Why it cannot be implemented into upstream?

The question here is why should we add a "feature" (that we need to maintain) if there are other and better solutions to this. That option also needs to be discovered by users that run into the problems. So it is from our point of view better to improve the default behavior than to add a setting for every input field or menu bar. We - as the Nextcloud project - want an easy to use product that works as good as possible out of the box. Adding settings just hides the problems for some users and most users will not benefit from it. Thus we should look into why it doesn't work for you and improve those use cases for everyone and not only when the setting is properly configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.