Skip to content

Commit 60fcf11

Browse files
authored
Merge branch '3.x' into fix-nested-repeaters
2 parents 49ecfad + 8611299 commit 60fcf11

37 files changed

+170
-142
lines changed

CHANGELOG.md

Lines changed: 115 additions & 80 deletions
Large diffs are not rendered by default.

docs/content/2_guides/1_page-builder-with-blade/4_creating-the-page-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ return new class extends Migration
254254
```
255255

256256
This file will create the minimum required tables and columns that Twill uses to provide the CMS functionality. Later in
257-
the guide we may add some more fields to the database, but will will do that in a new migration.
257+
the guide we may add some more fields to the database, but we will do that in a new migration.
258258

259259
Once you are more experienced with Twill, you may want to add fields at this moment, before you run the migrate command.
260260
That way, you do not have to immediately add a new migration file.

frontend/js/store/modules/buckets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const actions = {
6666
content_type: state.dataSources.selected.value,
6767
page: state.page,
6868
offset: state.offset,
69-
filter: state.filter
69+
filter: JSON.stringify(state.filter)
7070
}, resp => {
7171
commit(BUCKETS.UPDATE_BUCKETS_DATA, resp.source)
7272
commit(BUCKETS.UPDATE_BUCKETS_MAX_PAGE, resp.maxPage)

frontend/js/store/modules/datatable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const actions = {
231231
page: state.page,
232232
offset: state.offset,
233233
columns: getters.visibleColumnsNames,
234-
filter: state.filter
234+
filter: JSON.stringify(state.filter)
235235
}
236236

237237
api.get(params, function (resp) {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@area17/twill",
3-
"version": "3.1.0",
3+
"version": "3.2.1",
44
"private": true,
55
"scripts": {
66
"inspect": "vue-cli-service inspect --mode production",

src/AuthServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace A17\Twill;
44

55
use A17\Twill\Facades\TwillPermissions;
6-
use A17\Twill\Models\User;
76
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
87
use Illuminate\Support\Facades\Gate;
98

@@ -159,7 +158,7 @@ public function boot()
159158

160159
$this->define('publish-user', function ($user) {
161160
return $this->authorize($user, function ($user) {
162-
$editedUserObject = User::find(request('id'));
161+
$editedUserObject = twillModel('user')::find(request('id'));
163162
return $this->userHasRole(
164163
$user,
165164
[TwillPermissions::roles()::ADMIN]

src/Commands/ListBlocks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected function getBlocks(): Collection
104104
// We do not render this.
105105
unset($data['rules'], $data['rulesForTranslatedFields']);
106106

107-
$data['block class'] = $block::class !== 'A17\Twill\Services\Blocks\Block' ? get_class($block) : 'default';
107+
$data['block class'] = $block::class !== Block::class ? get_class($block) : 'default';
108108

109109
$list[] = $data;
110110
}

src/Helpers/helpers.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use A17\Twill\Facades\TwillBlocks;
44
use A17\Twill\Facades\TwillCapsules;
5+
use A17\Twill\Models\Model;
56
use A17\Twill\Services\Blocks\Block;
67
use Illuminate\Filesystem\Filesystem;
78
use Illuminate\Support\Arr;
@@ -208,6 +209,7 @@ function fix_directory_separator($path)
208209
}
209210

210211
if (! function_exists('twillModel')) {
212+
/** @return class-string<Model>|Model It returns a class string but this is for the correct type hints */
211213
function twillModel($model): string
212214
{
213215
return config("twill.models.$model")

src/Http/Controllers/Admin/ModuleController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use A17\Twill\Models\Behaviors\HasSlug;
1010
use A17\Twill\Models\Contracts\TwillModelContract;
1111
use A17\Twill\Models\Contracts\TwillSchedulableModel;
12-
use A17\Twill\Models\Group;
1312
use A17\Twill\Repositories\ModuleRepository;
1413
use A17\Twill\Services\Breadcrumbs\Breadcrumbs;
1514
use A17\Twill\Services\Forms\Fields\BaseFormField;
@@ -2674,7 +2673,7 @@ protected function respondWithJson($message, $variant)
26742673
protected function getGroupUserMapping()
26752674
{
26762675
if (config('twill.enabled.permissions-management')) {
2677-
return Group::with('users')->get()
2676+
return twillModel('group')::with('users')->get()
26782677
->mapWithKeys(function ($group) {
26792678
return [$group->id => $group->users()->pluck('id')->toArray()];
26802679
})->toArray();

0 commit comments

Comments
 (0)