Skip to content

Commit 3aba5b4

Browse files
committed
Merge branch 'main' into handle-uploads-inside-relationships
2 parents 2bb3926 + 0e8cda5 commit 3aba5b4

File tree

10 files changed

+36
-75
lines changed

10 files changed

+36
-75
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"require": {
3838
"laravel/framework": "^10.0",
3939
"prologue/alerts": "^1.0",
40-
"backpack/basset": "^1.0.0",
40+
"backpack/basset": "^1.1.1",
4141
"creativeorange/gravatar": "~1.0",
4242
"doctrine/dbal": "^3.0",
4343
"guzzlehttp/guzzle": "^7.0"

src/BackpackServiceProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class BackpackServiceProvider extends ServiceProvider
2323
\Backpack\CRUD\app\Console\Commands\Install::class,
2424
\Backpack\CRUD\app\Console\Commands\AddMenuContent::class,
2525
\Backpack\CRUD\app\Console\Commands\AddCustomRouteContent::class,
26-
\Backpack\CRUD\app\Console\Commands\PublishAssets::class,
2726
\Backpack\CRUD\app\Console\Commands\Version::class,
2827
\Backpack\CRUD\app\Console\Commands\CreateUser::class,
2928
\Backpack\CRUD\app\Console\Commands\PublishBackpackMiddleware::class,
@@ -276,10 +275,13 @@ public function loadConfigs()
276275

277276
// add the backpack_users password broker to the configuration
278277
$laravelAuthPasswordBrokers = app()->config['auth.passwords'];
278+
$laravelFirstPasswordBroker = is_array($laravelAuthPasswordBrokers) && current($laravelAuthPasswordBrokers) ?
279+
current($laravelAuthPasswordBrokers)['table'] :
280+
'';
279281

280282
$backpackPasswordBrokerTable = config('backpack.base.password_resets_table') ??
281283
config('auth.passwords.users.table') ??
282-
current($laravelAuthPasswordBrokers)['table'];
284+
$laravelFirstPasswordBroker;
283285

284286
app()->config['auth.passwords'] = $laravelAuthPasswordBrokers +
285287
[

src/app/Console/Commands/Install.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function handle()
9393

9494
// Install Backpack Basset
9595
$this->progressBlock('Installing Basset');
96-
$this->executeArtisanProcess('basset:install --no-interaction');
96+
$this->executeArtisanProcess('basset:install --no-check --no-interaction');
9797
$this->closeProgressBlock();
9898

9999
// Optional commands
@@ -113,6 +113,8 @@ public function handle()
113113
$this->closeProgressBlock();
114114
}
115115

116+
//execute basset checks
117+
$this->call('basset:check');
116118
// Done
117119
$url = Str::of(config('app.url'))->finish('/')->append('admin/');
118120
$this->infoBlock('Backpack installation complete.', 'done');

src/app/Console/Commands/PublishAssets.php

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/app/Library/CrudPanel/Traits/FakeFields.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ public function compactFakeFields($requestInput, $model = false, $fields = [])
3232

3333
foreach ($fields as $field) {
3434
// compact fake fields
35-
// cast the field name to array first, to account for array field names
36-
// in fields that send multiple inputs and want them all saved to the database
37-
foreach ((array) $field['name'] as $fieldName) {
35+
// explode the comma delimited names, eg: start,end in a date_range:
36+
$field['name'] = explode(',', $field['name']);
37+
foreach ($field['name'] as $fieldName) {
3838
$fakeFieldKey = isset($field['store_in']) ? $field['store_in'] : 'extras';
3939
$isFakeField = $field['fake'] ?? false;
4040

4141
// field is represented by the subfields
4242
if (isset($field['subfields']) && isset($field['model']) && $field['model'] === get_class($model)) {
4343
foreach ($field['subfields'] as $subfield) {
44-
foreach ((array) $subfield['name'] as $subfieldName) {
44+
// explode the comma delimited names, eg: start,end in a date_range:
45+
$subfield['name'] = explode(',', $subfield['name']);
46+
foreach ($subfield['name'] as $subfieldName) {
4547
$subfieldName = Str::afterLast($subfieldName, '.');
4648
$isSubfieldFake = $subfield['fake'] ?? false;
4749
$subFakeFieldKey = isset($subfield['store_in']) ? $subfield['store_in'] : 'extras';

src/config/backpack/ui.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,17 @@
131131
// 'resources/js/app.js',
132132
],
133133

134+
'classes' => [
135+
/**
136+
* Use this as fallback config for themes to pass classes to the table displayed in List Operation
137+
* It defaults to: "table table-striped table-hover nowrap rounded card-table table-vcenter card-table shadow-xs border-xs".
138+
*/
139+
'table' => null,
140+
141+
/**
142+
* Use this as fallback config for themes to pass classes to the table wrapper component displayed in List Operation.
143+
*/
144+
'tableWrapper' => null,
145+
],
146+
134147
];

src/resources/assets/css/common.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,4 +518,9 @@ form .select2.select2-container {
518518
justify-content: center;
519519
align-items: center;
520520
text-align: center;
521+
}
522+
523+
/* Summernote */
524+
.note-editor.note-frame.fullscreen {
525+
background-color: white;
521526
}

src/resources/views/crud/fields/color.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
@push('crud_fields_styles')
3939
@bassetBlock('backpack/crud/fields/color.css')
4040
<style>
41-
[bp-field-name="color"] input[type="color"] {
41+
[bp-field-type="color"] input[type="color"] {
4242
background-color: unset;
4343
border: 0;
4444
width: 1.8rem;
4545
height: 1.8rem;
4646
}
47-
[bp-field-name="color"] .input-group-text {
47+
[bp-field-type="color"] .input-group-text {
4848
padding: 0 0.4rem;
4949
}
5050
</style>

src/resources/views/crud/fields/summernote.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{{-- FIELD CSS - will be loaded in the after_styles section --}}
3232
@push('crud_fields_styles')
3333
{{-- include summernote css --}}
34-
@basset('https://unpkg.com/[email protected]/dist/summernote-bs4.min.css')
34+
@basset('https://unpkg.com/[email protected]/dist/summernote-lite.min.css')
3535
@basset('https://unpkg.com/[email protected]/dist/font/summernote.woff2', false)
3636
@bassetBlock('backpack/crud/fields/checklist-field.css')
3737
<style type="text/css">
@@ -45,7 +45,7 @@
4545
{{-- FIELD JS - will be loaded in the after_scripts section --}}
4646
@push('crud_fields_scripts')
4747
{{-- include summernote js --}}
48-
@basset('https://unpkg.com/[email protected]/dist/summernote.min.js')
48+
@basset('https://unpkg.com/[email protected]/dist/summernote-lite.min.js')
4949
@bassetBlock('backpack/crud/fields/summernote-field.js')
5050
<script>
5151
function bpFieldInitSummernoteElement(element) {

src/resources/views/crud/inc/datatables_logic.blade.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,6 @@ functionsToRunOnDataTablesDrawEvent: [],
348348
localStorage.setItem('DataTables_crudTable_/{{$crud->getRoute()}}_pageLength', len);
349349
});
350350
351-
// make sure AJAX requests include XSRF token
352-
$.ajaxPrefilter(function(options, originalOptions, xhr) {
353-
var token = $('meta[name="csrf_token"]').attr('content');
354-
355-
if (token) {
356-
return xhr.setRequestHeader('X-XSRF-TOKEN', token);
357-
}
358-
});
359-
360-
361351
$('#crudTable').on( 'page.dt', function () {
362352
localStorage.setItem('page_changed', true);
363353
});

0 commit comments

Comments
 (0)