-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into release
- Loading branch information
Showing
501 changed files
with
8,722 additions
and
3,826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace BookStack\Actions\Queries; | ||
|
||
use BookStack\Actions\Webhook; | ||
use BookStack\Util\SimpleListOptions; | ||
use Illuminate\Pagination\LengthAwarePaginator; | ||
|
||
/** | ||
* Get all the webhooks in the system in a paginated format. | ||
*/ | ||
class WebhooksAllPaginatedAndSorted | ||
{ | ||
public function run(int $count, SimpleListOptions $listOptions): LengthAwarePaginator | ||
{ | ||
$query = Webhook::query()->select(['*']) | ||
->withCount(['trackedEvents']) | ||
->orderBy($listOptions->getSort(), $listOptions->getOrder()); | ||
|
||
if ($listOptions->getSearch()) { | ||
$term = '%' . $listOptions->getSearch() . '%'; | ||
$query->where(function ($query) use ($term) { | ||
$query->where('name', 'like', $term) | ||
->orWhere('endpoint', 'like', $term); | ||
}); | ||
} | ||
|
||
return $query->paginate($count); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace BookStack\Auth\Queries; | ||
|
||
use BookStack\Auth\Role; | ||
use BookStack\Util\SimpleListOptions; | ||
use Illuminate\Pagination\LengthAwarePaginator; | ||
|
||
/** | ||
* Get all the roles in the system in a paginated format. | ||
*/ | ||
class RolesAllPaginatedAndSorted | ||
{ | ||
public function run(int $count, SimpleListOptions $listOptions): LengthAwarePaginator | ||
{ | ||
$sort = $listOptions->getSort(); | ||
if ($sort === 'created_at') { | ||
$sort = 'users.created_at'; | ||
} | ||
|
||
$query = Role::query()->select(['*']) | ||
->withCount(['users', 'permissions']) | ||
->orderBy($sort, $listOptions->getOrder()); | ||
|
||
if ($listOptions->getSearch()) { | ||
$term = '%' . $listOptions->getSearch() . '%'; | ||
$query->where(function ($query) use ($term) { | ||
$query->where('display_name', 'like', $term) | ||
->orWhere('description', 'like', $term); | ||
}); | ||
} | ||
|
||
return $query->paginate($count); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.