Skip to content

Commit dfe4cde

Browse files
committed
Merge branch 'development' into release
2 parents d11144d + 41689a1 commit dfe4cde

File tree

375 files changed

+14161
-8871
lines changed

Some content is hidden

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

375 files changed

+14161
-8871
lines changed

.github/ISSUE_TEMPLATE/api_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: New API Endpoint or API Ability
22
description: Request a new endpoint or API feature be added
3-
title: "[API Request]: "
43
labels: [":nut_and_bolt: API Request"]
54
body:
65
- type: textarea

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Bug Report
22
description: Create a report to help us improve or fix things
3-
title: "[Bug Report]: "
43
labels: [":bug: Bug"]
54
body:
65
- type: textarea

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Feature Request
2-
description: Request a new language to be added to CrowdIn for you to translate
3-
title: "[Feature Request]: "
2+
description: Request a new feature or idea to be added to BookStack
43
labels: [":hammer: Feature Request"]
54
body:
65
- type: textarea
@@ -13,8 +12,42 @@ body:
1312
- type: textarea
1413
id: benefits
1514
attributes:
16-
label: Describe the benefits this feature would bring to BookStack users
17-
description: Explain the measurable benefits this feature would achieve for existing BookStack users
15+
label: Describe the benefits this would bring to existing BookStack users
16+
description: |
17+
Explain the measurable benefits this feature would achieve for existing BookStack users.
18+
These benefits should details outcomes in terms of what this request solves/achieves, and should not be specific to implementation.
19+
This helps us understand the core desired goal so that a variety of potential implementations could be explored.
20+
This field is important. Lack if input here may lead to early issue closure.
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: already_achieved
25+
attributes:
26+
label: Can the goal of this request already be achieved via other means?
27+
description: |
28+
Yes/No. If yes, please describe how the requested approach fits in with the existing method.
29+
validations:
30+
required: true
31+
- type: checkboxes
32+
id: confirm-search
33+
attributes:
34+
label: Have you searched for an existing open/closed issue?
35+
description: |
36+
To help us keep these issues under control, please ensure you have first [searched our issue list](https://github.com/BookStackApp/BookStack/issues?q=is%3Aissue)
37+
for any existing issues that cover the fundemental benefit/goal of your request.
38+
options:
39+
- label: I have searched for existing issues and none cover my fundemental request
40+
required: true
41+
- type: dropdown
42+
id: existing_usage
43+
attributes:
44+
label: How long have you been using BookStack?
45+
options:
46+
- Not using yet, just scoping
47+
- 0 to 6 months
48+
- 6 months to 1 year
49+
- 1 to 5 years
50+
- Over 5 years
1851
validations:
1952
required: true
2053
- type: textarea

.github/ISSUE_TEMPLATE/language_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Language Request
22
description: Request a new language to be added to CrowdIn for you to translate
3-
title: "[Language Request]: "
43
labels: [":earth_africa: Translations"]
54
assignees:
65
- ssddanbrown

.github/ISSUE_TEMPLATE/support_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Support Request
22
description: Request support for a specific problem you have not been able to solve yourself
3-
title: "[Support Request]: "
43
labels: [":dog2: Support"]
54
body:
65
- type: checkboxes

.github/translators.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ HenrijsS :: Latvian
158158
Pascal R-B (pborgner) :: German
159159
Boris (Ginfred) :: Russian
160160
Jonas Anker Rasmussen (jonasanker) :: Danish
161-
Gerwin de Keijzer (gdekeijzer) :: Dutch; German; German Informal
161+
Gerwin de Keijzer (gdekeijzer) :: Dutch; German Informal; German
162162
kometchtech :: Japanese
163163
Auri (Atalonica) :: Catalan
164164
Francesco Franchina (ffranchina) :: Italian
@@ -215,3 +215,18 @@ Saeed (saeed205) :: Persian
215215
Julesdevops :: French
216216
peter cerny (posli.to.semka) :: Slovak
217217
Pavel Karlin (pavelkarlin) :: Russian
218+
SmokingCrop :: Dutch
219+
Maciej Lebiest (Szwendacz) :: Polish
220+
DiscordDigital :: German; German Informal
221+
Gábor Marton (dodver) :: Hungarian
222+
Jasell :: Swedish
223+
Ghost_chu (ghostchu) :: Chinese Simplified
224+
Ravid Shachar (ravidshachar) :: Hebrew
225+
Helga Guchshenskaya (guchshenskaya) :: Russian
226+
daniel chou (chou0214) :: Chinese Traditional
227+
Manolis PATRIARCHE (m.patriarche) :: French
228+
Mohammed Haboubi (haboubi92) :: Arabic
229+
roncallyt :: Portuguese, Brazilian
230+
goegol :: Dutch
231+
msevgen :: Turkish
232+
Khroners :: French

.github/workflows/phpstan.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
name: phpstan
22

3-
on:
4-
push:
5-
branches-ignore:
6-
- l10n_development
7-
pull_request:
8-
branches-ignore:
9-
- l10n_development
3+
on: [push, pull_request]
104

115
jobs:
126
build:
7+
if: ${{ github.ref != 'refs/heads/l10n_development' }}
138
runs-on: ubuntu-20.04
149
strategy:
1510
matrix:
16-
php: ['7.3']
11+
php: ['7.4']
1712
steps:
1813
- uses: actions/checkout@v1
1914

.github/workflows/phpunit.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
name: phpunit
22

3-
on:
4-
push:
5-
branches-ignore:
6-
- l10n_development
7-
pull_request:
8-
branches-ignore:
9-
- l10n_development
3+
on: [push, pull_request]
104

115
jobs:
126
build:
7+
if: ${{ github.ref != 'refs/heads/l10n_development' }}
138
runs-on: ubuntu-20.04
149
strategy:
1510
matrix:
16-
php: ['7.3', '7.4', '8.0', '8.1']
11+
php: ['7.4', '8.0', '8.1']
1712
steps:
1813
- uses: actions/checkout@v1
1914

.github/workflows/test-migrations.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
name: test-migrations
22

3-
on:
4-
push:
5-
branches-ignore:
6-
- l10n_development
7-
pull_request:
8-
branches-ignore:
9-
- l10n_development
3+
on: [push, pull_request]
104

115
jobs:
126
build:
7+
if: ${{ github.ref != 'refs/heads/l10n_development' }}
138
runs-on: ubuntu-20.04
149
strategy:
1510
matrix:
16-
php: ['7.3', '7.4', '8.0', '8.1']
11+
php: ['7.4', '8.0', '8.1']
1712
steps:
1813
- uses: actions/checkout@v1
1914

app/Api/ApiDocsGenerator.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
namespace BookStack\Api;
44

55
use BookStack\Http\Controllers\Api\ApiController;
6+
use Exception;
67
use Illuminate\Contracts\Container\BindingResolutionException;
78
use Illuminate\Support\Collection;
89
use Illuminate\Support\Facades\Cache;
910
use Illuminate\Support\Facades\Route;
1011
use Illuminate\Support\Str;
12+
use Illuminate\Validation\Rules\Password;
1113
use ReflectionClass;
1214
use ReflectionException;
1315
use ReflectionMethod;
@@ -100,11 +102,37 @@ protected function getBodyParamsFromClass(string $className, string $methodName)
100102
$this->controllerClasses[$className] = $class;
101103
}
102104

103-
$rules = $class->getValdationRules()[$methodName] ?? [];
105+
$rules = collect($class->getValidationRules()[$methodName] ?? [])->map(function ($validations) {
106+
return array_map(function ($validation) {
107+
return $this->getValidationAsString($validation);
108+
}, $validations);
109+
})->toArray();
104110

105111
return empty($rules) ? null : $rules;
106112
}
107113

114+
/**
115+
* Convert the given validation message to a readable string.
116+
*/
117+
protected function getValidationAsString($validation): string
118+
{
119+
if (is_string($validation)) {
120+
return $validation;
121+
}
122+
123+
if (is_object($validation) && method_exists($validation, '__toString')) {
124+
return strval($validation);
125+
}
126+
127+
if ($validation instanceof Password) {
128+
return 'min:8';
129+
}
130+
131+
$class = get_class($validation);
132+
133+
throw new Exception("Cannot provide string representation of rule for class: {$class}");
134+
}
135+
108136
/**
109137
* Parse out the description text from a class method comment.
110138
*/

0 commit comments

Comments
 (0)