Skip to content

Commit b24d65b

Browse files
committed
fix issue with relatable fields in nova 3.21+
1 parent 4ac92c2 commit b24d65b

File tree

8 files changed

+41
-17
lines changed

8 files changed

+41
-17
lines changed

dist/js/field.js

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

dist/js/field.js.LICENSE.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*!
2+
* Determine if an object is a Buffer
3+
*
4+
* @author Feross Aboukhadijeh <https://feross.org>
5+
* @license MIT
6+
*/
7+
8+
/**
9+
* @license
10+
* Lodash <https://lodash.com/>
11+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
12+
* Released under MIT license <https://lodash.com/license>
13+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
14+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15+
*/

dist/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"/js/field.js": "/js/field.js"
3-
}
3+
}

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"private": true,
33
"scripts": {
4-
"dev": "npm run development",
5-
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6-
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
7-
"watch-poll": "npm run watch -- --watch-poll",
8-
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9-
"prod": "npm run production",
10-
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
4+
"development": "mix",
5+
"watch": "mix watch",
6+
"watch-poll": "mix watch -- --watch-options-poll=1000",
7+
"hot": "mix watch --hot",
8+
"production": "mix --production"
119
},
1210
"devDependencies": {
13-
"cross-env": "^5.0.0",
14-
"laravel-mix": "^1.0",
15-
"laravel-nova": "^1.0",
16-
"logipar": "^0.4.0"
11+
"cross-env": "^7.0.3",
12+
"laravel-mix": "^6.0.11",
13+
"laravel-nova": "^1.9.0",
14+
"logipar": "^0.4.0",
15+
"postcss": "^8.2.6",
16+
"vue-loader": "^15.9.6",
17+
"vue-template-compiler": "^2.6.12"
1718
},
1819
"dependencies": {
19-
"vue": "^2.5.0"
20+
"vue": "^2.6.12"
2021
}
2122
}

resources/js/components/FormField.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
:via-resource="viaResource"
1919
:via-resource-id="viaResourceId"
2020
:via-relationship="viaRelationship"
21+
:show-help-text="childField.helpText != null"
2122
/>
2223

2324
</div>

resources/js/field.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import FormField from './components/FormField'
2+
13
Nova.booting((Vue, router, store) => {
2-
Vue.component('form-conditional-container', require('./components/FormField'))
4+
Vue.component('form-conditional-container', FormField)
35
})

src/HasConditionalContainer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
trait HasConditionalContainer
2626
{
2727

28+
public function hasRelatableField(NovaRequest $request, $attribute)
29+
{
30+
return $this->availableFields($request)->whereInstanceOf(RelatableField::class);
31+
}
32+
2833
/**
2934
* Get the panels that are available for the given detail request.
3035
*

webpack.mix.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
const mix = require('laravel-mix')
22

3-
mix.setPublicPath('dist')
4-
.js('resources/js/field.js', 'js')
3+
mix.setPublicPath('dist').vue().js('resources/js/field.js', 'js')

0 commit comments

Comments
 (0)