Skip to content

Commit 093b4ab

Browse files
authored
Merge pull request #2 from mitydigital/feature/statamic-6
Support for Statamic 6
2 parents 24d5784 + eb5d8b6 commit 093b4ab

11 files changed

Lines changed: 36 additions & 29 deletions

File tree

composer.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
},
2727
"require": {
2828
"php": "^8.2",
29-
"statamic/cms": "^5.0",
29+
"statamic/cms": "^6.0",
3030
"ext-intl": "*"
3131
},
3232
"require-dev": {
33-
"pestphp/pest": "^2.9",
34-
"orchestra/testbench": "^8.5",
35-
"laravel/pint": "^1.10",
33+
"orchestra/testbench": "^10.0",
34+
"pestphp/pest": "^4.0",
35+
"laravel/pint": "^1.16",
36+
"pestphp/pest-plugin-laravel": "^4.0",
3637
"spatie/pest-plugin-test-time": "^2.0",
37-
"pestphp/pest-plugin-laravel": "^2.1",
3838
"spatie/laravel-ray": "^1.33"
3939
},
4040
"scripts": {
@@ -50,5 +50,7 @@
5050
"pestphp/pest-plugin": true,
5151
"pixelfear/composer-dist-plugin": true
5252
}
53-
}
53+
},
54+
"minimum-stability": "dev",
55+
"prefer-stable": true
5456
}

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
"build": "vite build"
66
},
77
"devDependencies": {
8-
"@vitejs/plugin-vue2": "^2.2.0",
9-
"autoprefixer": "^10.4.14",
10-
"laravel-vite-plugin": "^0.7.2",
11-
"tailwindcss": "^3.3.3",
12-
"vite": "^4.0.0"
8+
"@statamic/cms": "file:./vendor/statamic/cms/resources/js/package",
9+
"laravel-vite-plugin": "^1.2.0",
10+
"vite": "^6.3.4"
1311
},
1412
"type": "module"
1513
}

resources/dist/build/assets/cp-d0b6376f.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

resources/dist/build/assets/cp-j_PjJc2l.js

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

resources/dist/build/manifest.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"resources/js/cp.js": {
3-
"file": "assets/cp-d0b6376f.js",
4-
"isEntry": true,
5-
"src": "resources/js/cp.js"
3+
"file": "assets/cp-j_PjJc2l.js",
4+
"name": "cp",
5+
"src": "resources/js/cp.js",
6+
"isEntry": true
67
}
78
}

resources/js/fieldtypes/VariableNumber.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
</template>
77

88
<script>
9+
10+
import {FieldtypeMixin} from '@statamic/cms';
11+
912
export default {
10-
mixins: [Fieldtype],
13+
mixins: [FieldtypeMixin],
1114
1215
computed: {
1316
message() {

resources/js/fieldtypes/VariableNumberIndex.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
</template>
66

77
<script>
8+
9+
import {IndexFieldtypeMixin} from '@statamic/cms';
10+
811
export default {
9-
mixins: [IndexFieldtype],
12+
mixins: [IndexFieldtypeMixin],
1013
}
1114
</script>

src/Fieldtypes/VariableNumberFieldtype.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected function configFieldItems(): array
217217

218218
'if' => [
219219
'allow_custom' => 'equals true',
220-
//'layout' => '=== radio',
220+
// 'layout' => '=== radio',
221221
],
222222
],
223223

tests/Fieldtypes/VariableNumberFieldtypeTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
//
218218
// USE DEFAULT OPTIONS
219219
//
220-
request()->setLaravelSession(session());
220+
request()->setLaravelSession(app('session.store'));
221221
$this->withSession(['_old_input.'.$field->handle() => 5]);
222222

223223
$extra = $field->fieldtype()->extraRenderableFieldData();
@@ -240,15 +240,15 @@
240240
});
241241
app()->instance('request', $request);
242242

243-
request()->setLaravelSession(session());
243+
request()->setLaravelSession(app('session.store'));
244244
$this->withSession(['_old_input.'.$field->handle() => 3]);
245245

246246
$extra = $field->fieldtype()->extraRenderableFieldData();
247247

248248
expect($extra['init']['option'])->toBe(3.0);
249249

250250
// attempt a custom value, but not have it configured to allow it
251-
request()->setLaravelSession(session());
251+
request()->setLaravelSession(app('session.store'));
252252
$this->withSession(['_old_input.'.$field->handle() => 5]);
253253

254254
$extra = $field->fieldtype()->extraRenderableFieldData();
@@ -261,14 +261,13 @@
261261
$config['allow_custom'] = true;
262262
$field->setConfig($config);
263263

264-
request()->setLaravelSession(session());
264+
request()->setLaravelSession(app('session.store'));
265265
$this->withSession(['_old_input.'.$field->handle() => 5]);
266266

267267
$extra = $field->fieldtype()->extraRenderableFieldData();
268268

269269
expect($extra['init']['option'])->toBeNull()
270270
->and($extra['init']['custom'])->toBe(5);
271-
272271
});
273272

274273
it('correctly sets the placeholder', function () {
@@ -362,7 +361,7 @@
362361
$blueprint = Blueprint::find('collections/pages/article');
363362

364363
// set the parent
365-
$blueprint->setParent(new Entry());
364+
$blueprint->setParent(new Entry);
366365

367366
// get the variable number
368367
$field = $blueprint->field('variable_number');

tests/Tags/VariableNumberTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
it('outputs a variable number partial with fields from the tag\'s context', function () {
88
// create the tag
9-
$tag = new VariableNumber();
9+
$tag = new VariableNumber;
1010

1111
// load fields from the form blueprint
1212
$blueprint = Blueprint::find('forms/has_variable_number');
@@ -22,7 +22,7 @@
2222

2323
it('outputs a variable number partial with form from the tag\'s params', function () {
2424
// create the tag
25-
$tag = new VariableNumber();
25+
$tag = new VariableNumber;
2626

2727
// load form
2828
$form = Form::find('has_variable_number');
@@ -40,7 +40,7 @@
4040

4141
it('outputs nothing when the blueprint does not contain a variable number fieldtype', function () {
4242
// create the tag
43-
$tag = new VariableNumber();
43+
$tag = new VariableNumber;
4444

4545
// load fields from the form blueprint
4646
$blueprint = Blueprint::find('forms/no_variable_number');

0 commit comments

Comments
 (0)