mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-01 06:59:52 +00:00
Merge branch 'v21.05.x'
This commit is contained in:
commit
c429cf7818
12 changed files with 318 additions and 277 deletions
12
.github/workflows/phpunit.yml
vendored
12
.github/workflows/phpunit.yml
vendored
|
@ -2,15 +2,11 @@ name: phpunit
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches-ignore:
|
||||||
- master
|
- l10n_master
|
||||||
- release
|
|
||||||
- gh_actions_update
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches-ignore:
|
||||||
- '*'
|
- l10n_master
|
||||||
- '*/*'
|
|
||||||
- '!l10n_master'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
12
.github/workflows/test-migrations.yml
vendored
12
.github/workflows/test-migrations.yml
vendored
|
@ -2,15 +2,11 @@ name: test-migrations
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches-ignore:
|
||||||
- master
|
- l10n_master
|
||||||
- release
|
|
||||||
- gh_actions_update
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches-ignore:
|
||||||
- '*'
|
- l10n_master
|
||||||
- '*/*'
|
|
||||||
- '!l10n_master'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
525
composer.lock
generated
525
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -27,6 +27,7 @@ class DropdownSearch {
|
||||||
this.runLocalSearch(input);
|
this.runLocalSearch(input);
|
||||||
} else {
|
} else {
|
||||||
this.toggleLoading(true);
|
this.toggleLoading(true);
|
||||||
|
this.listContainerElem.innerHTML = '';
|
||||||
this.runAjaxSearch(input);
|
this.runAjaxSearch(input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,14 @@
|
||||||
class SubmitOnChange {
|
class SubmitOnChange {
|
||||||
|
|
||||||
setup() {
|
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');
|
const form = this.$el.closest('form');
|
||||||
if (form) {
|
if (form) {
|
||||||
form.submit();
|
form.submit();
|
||||||
|
|
|
@ -3,7 +3,6 @@ import {onChildEvent} from "../services/dom";
|
||||||
class UserSelect {
|
class UserSelect {
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
|
||||||
this.input = this.$refs.input;
|
this.input = this.$refs.input;
|
||||||
this.userInfoContainer = this.$refs.userInfo;
|
this.userInfoContainer = this.$refs.userInfo;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import 'codemirror/mode/rust/rust';
|
||||||
import 'codemirror/mode/shell/shell';
|
import 'codemirror/mode/shell/shell';
|
||||||
import 'codemirror/mode/sql/sql';
|
import 'codemirror/mode/sql/sql';
|
||||||
import 'codemirror/mode/toml/toml';
|
import 'codemirror/mode/toml/toml';
|
||||||
|
import 'codemirror/mode/vb/vb';
|
||||||
import 'codemirror/mode/vbscript/vbscript';
|
import 'codemirror/mode/vbscript/vbscript';
|
||||||
import 'codemirror/mode/xml/xml';
|
import 'codemirror/mode/xml/xml';
|
||||||
import 'codemirror/mode/yaml/yaml';
|
import 'codemirror/mode/yaml/yaml';
|
||||||
|
@ -87,6 +88,8 @@ const modeMap = {
|
||||||
sql: 'text/x-sql',
|
sql: 'text/x-sql',
|
||||||
vbs: 'vbscript',
|
vbs: 'vbscript',
|
||||||
vbscript: 'vbscript',
|
vbscript: 'vbscript',
|
||||||
|
'vb.net': 'text/x-vb',
|
||||||
|
vbnet: 'text/x-vb',
|
||||||
xml: 'xml',
|
xml: 'xml',
|
||||||
yaml: 'yaml',
|
yaml: 'yaml',
|
||||||
yml: 'yaml',
|
yml: 'yaml',
|
||||||
|
|
|
@ -629,7 +629,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-editor .lang-options {
|
.code-editor .lang-options {
|
||||||
max-width: 480px;
|
max-width: 540px;
|
||||||
margin-bottom: $-s;
|
margin-bottom: $-s;
|
||||||
a {
|
a {
|
||||||
margin-inline-end: $-xs;
|
margin-inline-end: $-xs;
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
<a refs="code-editor@languageLink" data-lang="shell">Shell/Bash</a>
|
<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="SQL">SQL</a>
|
||||||
<a refs="code-editor@languageLink" data-lang="VBScript">VBScript</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="XML">XML</a>
|
||||||
<a refs="code-editor@languageLink" data-lang="YAML">YAML</a>
|
<a refs="code-editor@languageLink" data-lang="YAML">YAML</a>
|
||||||
</small>
|
</small>
|
||||||
|
|
|
@ -41,7 +41,9 @@
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@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>
|
<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])
|
@include('components.user-select', ['user' => $listDetails['user'] ? \BookStack\Auth\User::query()->find($listDetails['user']) : null, 'name' => 'user', 'compact' => true])
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
<h2 id="recent-pages" class="list-heading">
|
<h2 id="recent-pages" class="list-heading">
|
||||||
{{ trans('entities.recently_created_pages') }}
|
{{ trans('entities.recently_created_pages') }}
|
||||||
@if (count($recentlyCreated['pages']) > 0)
|
@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
|
@endif
|
||||||
</h2>
|
</h2>
|
||||||
@if (count($recentlyCreated['pages']) > 0)
|
@if (count($recentlyCreated['pages']) > 0)
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<h2 id="recent-chapters" class="list-heading">
|
<h2 id="recent-chapters" class="list-heading">
|
||||||
{{ trans('entities.recently_created_chapters') }}
|
{{ trans('entities.recently_created_chapters') }}
|
||||||
@if (count($recentlyCreated['chapters']) > 0)
|
@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
|
@endif
|
||||||
</h2>
|
</h2>
|
||||||
@if (count($recentlyCreated['chapters']) > 0)
|
@if (count($recentlyCreated['chapters']) > 0)
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
<h2 id="recent-books" class="list-heading">
|
<h2 id="recent-books" class="list-heading">
|
||||||
{{ trans('entities.recently_created_books') }}
|
{{ trans('entities.recently_created_books') }}
|
||||||
@if (count($recentlyCreated['books']) > 0)
|
@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
|
@endif
|
||||||
</h2>
|
</h2>
|
||||||
@if (count($recentlyCreated['books']) > 0)
|
@if (count($recentlyCreated['books']) > 0)
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
<h2 id="recent-shelves" class="list-heading">
|
<h2 id="recent-shelves" class="list-heading">
|
||||||
{{ trans('entities.recently_created_shelves') }}
|
{{ trans('entities.recently_created_shelves') }}
|
||||||
@if (count($recentlyCreated['shelves']) > 0)
|
@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
|
@endif
|
||||||
</h2>
|
</h2>
|
||||||
@if (count($recentlyCreated['shelves']) > 0)
|
@if (count($recentlyCreated['shelves']) > 0)
|
||||||
|
|
|
@ -85,6 +85,23 @@ class UserProfileTest extends BrowserKitTest
|
||||||
->see($newUser->name);
|
->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()
|
public function test_guest_profile_shows_limited_form()
|
||||||
{
|
{
|
||||||
$this->asAdmin()
|
$this->asAdmin()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue