Merge branch 'v21.05.x'

This commit is contained in:
Dan Brown 2021-08-04 21:32:29 +01:00
commit c429cf7818
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
12 changed files with 318 additions and 277 deletions

View File

@ -2,15 +2,11 @@ name: phpunit
on:
push:
branches:
- master
- release
- gh_actions_update
branches-ignore:
- l10n_master
pull_request:
branches:
- '*'
- '*/*'
- '!l10n_master'
branches-ignore:
- l10n_master
jobs:
build:

View File

@ -2,15 +2,11 @@ name: test-migrations
on:
push:
branches:
- master
- release
- gh_actions_update
branches-ignore:
- l10n_master
pull_request:
branches:
- '*'
- '*/*'
- '!l10n_master'
branches-ignore:
- l10n_master
jobs:
build:

525
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,7 @@ class DropdownSearch {
this.runLocalSearch(input);
} else {
this.toggleLoading(true);
this.listContainerElem.innerHTML = '';
this.runAjaxSearch(input);
}
}

View File

@ -6,7 +6,14 @@
class SubmitOnChange {
setup() {
this.$el.addEventListener('change', () => {
this.filter = this.$opts.filter;
this.$el.addEventListener('change', (event) => {
if (this.filter && !event.target.matches(this.filter)) {
return;
}
const form = this.$el.closest('form');
if (form) {
form.submit();

View File

@ -3,7 +3,6 @@ import {onChildEvent} from "../services/dom";
class UserSelect {
setup() {
this.input = this.$refs.input;
this.userInfoContainer = this.$refs.userInfo;

View File

@ -26,6 +26,7 @@ import 'codemirror/mode/rust/rust';
import 'codemirror/mode/shell/shell';
import 'codemirror/mode/sql/sql';
import 'codemirror/mode/toml/toml';
import 'codemirror/mode/vb/vb';
import 'codemirror/mode/vbscript/vbscript';
import 'codemirror/mode/xml/xml';
import 'codemirror/mode/yaml/yaml';
@ -87,6 +88,8 @@ const modeMap = {
sql: 'text/x-sql',
vbs: 'vbscript',
vbscript: 'vbscript',
'vb.net': 'text/x-vb',
vbnet: 'text/x-vb',
xml: 'xml',
yaml: 'yaml',
yml: 'yaml',

View File

@ -629,7 +629,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
}
.code-editor .lang-options {
max-width: 480px;
max-width: 540px;
margin-bottom: $-s;
a {
margin-inline-end: $-xs;

View File

@ -35,6 +35,7 @@
<a refs="code-editor@languageLink" data-lang="shell">Shell/Bash</a>
<a refs="code-editor@languageLink" data-lang="SQL">SQL</a>
<a refs="code-editor@languageLink" data-lang="VBScript">VBScript</a>
<a refs="code-editor@languageLink" data-lang="VB.NET">VB.NET</a>
<a refs="code-editor@languageLink" data-lang="XML">XML</a>
<a refs="code-editor@languageLink" data-lang="YAML">YAML</a>
</small>

View File

@ -41,7 +41,9 @@
</div>
@endforeach
<div class="form-group ml-auto" component="submit-on-change">
<div class="form-group ml-auto"
component="submit-on-change"
option:submit-on-change:filter='[name="user"]'>
<label for="owner">{{ trans('settings.audit_table_user') }}</label>
@include('components.user-select', ['user' => $listDetails['user'] ? \BookStack\Auth\User::query()->find($listDetails['user']) : null, 'name' => 'user', 'compact' => true])
</div>

View File

@ -60,7 +60,7 @@
<h2 id="recent-pages" class="list-heading">
{{ trans('entities.recently_created_pages') }}
@if (count($recentlyCreated['pages']) > 0)
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:page}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->slug.'} {type:page}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
@endif
</h2>
@if (count($recentlyCreated['pages']) > 0)
@ -74,7 +74,7 @@
<h2 id="recent-chapters" class="list-heading">
{{ trans('entities.recently_created_chapters') }}
@if (count($recentlyCreated['chapters']) > 0)
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:chapter}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->slug.'} {type:chapter}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
@endif
</h2>
@if (count($recentlyCreated['chapters']) > 0)
@ -88,7 +88,7 @@
<h2 id="recent-books" class="list-heading">
{{ trans('entities.recently_created_books') }}
@if (count($recentlyCreated['books']) > 0)
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:book}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->slug.'} {type:book}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
@endif
</h2>
@if (count($recentlyCreated['books']) > 0)
@ -102,7 +102,7 @@
<h2 id="recent-shelves" class="list-heading">
{{ trans('entities.recently_created_shelves') }}
@if (count($recentlyCreated['shelves']) > 0)
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:bookshelf}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
<a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->slug.'} {type:bookshelf}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
@endif
</h2>
@if (count($recentlyCreated['shelves']) > 0)

View File

@ -85,6 +85,23 @@ class UserProfileTest extends BrowserKitTest
->see($newUser->name);
}
public function test_profile_has_search_links_in_created_entity_lists()
{
$user = $this->getEditor();
$resp = $this->actingAs($this->getAdmin())->visit('/user/' . $user->slug);
$expectedLinks = [
'/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Apage%7D',
'/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Achapter%7D',
'/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Abook%7D',
'/search?term=%7Bcreated_by%3A' . $user->slug . '%7D+%7Btype%3Abookshelf%7D',
];
foreach ($expectedLinks as $link) {
$resp->seeInElement('[href$="' . $link . '"]', 'View All');
}
}
public function test_guest_profile_shows_limited_form()
{
$this->asAdmin()