Skip to content

Commit eda2b5d

Browse files
committed
Resolve build && fix some actions
1 parent f1fa36a commit eda2b5d

30 files changed

+26883
-585
lines changed

Diff for: .gitignore

100644100755
File mode changed.

Diff for: README.md

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use Laravel\Nova\Fields\Text;
3131
use Laravel\Nova\Fields\Gravatar;
3232
use Laravel\Nova\Fields\Password;
3333
// Add use statement here.
34-
use Yassi\NestedForm\NestedForm;
34+
use Handleglobal\NestedForm\NestedForm;
3535

3636
class User extends Resource
3737
{

Diff for: composer.json

100644100755
+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"name": "yassi/nova-nested-form",
2+
"name": "handleglobal/nova-nested-form",
33
"description": "A Laravel Nova package that allows you to create/update/delete nested related fields from a parent form.",
44
"keywords": [
55
"laravel",
66
"nova",
7+
"nova 4",
78
"nested",
89
"relationship",
910
"form"
@@ -20,13 +21,13 @@
2021
],
2122
"autoload": {
2223
"psr-4": {
23-
"Yassi\\NestedForm\\": "src/"
24+
"Handleglobal\\NestedForm\\": "src/"
2425
}
2526
},
2627
"extra": {
2728
"laravel": {
2829
"providers": [
29-
"Yassi\\NestedForm\\FieldServiceProvider"
30+
"Handleglobal\\NestedForm\\FieldServiceProvider"
3031
]
3132
}
3233
},
@@ -36,6 +37,6 @@
3637
"minimum-stability": "dev",
3738
"prefer-stable": true,
3839
"require-dev": {
39-
"laravel/nova": "^3.0"
40+
"laravel/nova": "^4.0"
4041
}
4142
}

Diff for: dist/js/field.js

100644100755
+26,204-2
Large diffs are not rendered by default.

Diff for: dist/js/field.js.LICENSE.txt

100644100755
+3-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
/*!
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
2+
* vuex v4.0.2
3+
* (c) 2021 Evan You
4+
* @license MIT
155
*/

Diff for: dist/js/field.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/js/manifest.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/js/manifest.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/js/vendor.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/js/vendor.js.LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*!
2+
* Determine if an object is a Buffer
3+
*
4+
* @author Feross Aboukhadijeh <https://feross.org>
5+
* @license MIT
6+
*/
7+
8+
/*!
9+
* vuex v4.0.2
10+
* (c) 2021 Evan You
11+
* @license MIT
12+
*/
13+
14+
/**
15+
* @license
16+
* Lodash <https://lodash.com/>
17+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
18+
* Released under MIT license <https://lodash.com/license>
19+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
20+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
21+
*/

Diff for: dist/js/vendor.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/mix-manifest.json

100644100755
File mode changed.

Diff for: mix.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
const mix = require('laravel-mix')
2+
const webpack = require('webpack')
3+
const path = require('path')
4+
5+
class NovaExtension {
6+
name() {
7+
return 'nova-extension'
8+
}
9+
10+
register(name) {
11+
this.name = name
12+
}
13+
14+
webpackPlugins() {
15+
return new webpack.ProvidePlugin({
16+
Errors: 'form-backend-validation',
17+
})
18+
}
19+
20+
webpackConfig(webpackConfig) {
21+
webpackConfig.externals = {
22+
vue: 'Vue',
23+
}
24+
25+
webpackConfig.resolve.alias = {
26+
...(webpackConfig.resolve.alias || {}),
27+
'@': path.resolve(__dirname, './vendor/laravel/nova/resources/js/'),
28+
'laravel-nova': path.join(__dirname, 'vendor/laravel/nova/resources/js/mixins/packages.js'),
29+
}
30+
31+
webpackConfig.output = {
32+
uniqueName: this.name,
33+
}
34+
}
35+
}
36+
37+
mix.extend('nova', new NovaExtension())
38+
39+
// let mix = require('laravel-mix')
40+
// let path = require('path')
41+
//
42+
// mix
43+
// .js('resources/js/field.js', 'js')
44+
// .vue({version: 3})
45+
// .sourceMaps()
46+
// .extract()
47+
// .setPublicPath('dist')
48+
// .alias({'@': path.join(__dirname, './vendor/laravel/nova/resources/js/')})

Diff for: package.json

100644100755
+38-29
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
11
{
2-
"private": true,
3-
"publishConfig": {
4-
"registry": "https://npm.pkg.github.com/"
5-
},
6-
"scripts": {
7-
"commit": "git-cz",
8-
"dev": "npm run development",
9-
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
10-
"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",
11-
"watch-poll": "npm run watch -- --watch-poll",
12-
"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",
13-
"prod": "npm run production",
14-
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
15-
},
16-
"devDependencies": {
17-
"acorn": "^8.0.4",
18-
"cross-env": "^7.0.3",
19-
"git-cz": "^4.7.6",
20-
"laravel-mix": "^5.0.9",
21-
"laravel-nova": "^1.6.0",
22-
"laravel-vapor": "^0.4.2",
23-
"minimist": "^1.2.2",
24-
"resolve-url-loader": "^3.1.2",
25-
"serialize-javascript": "^5.0.1",
26-
"vue-template-compiler": "^2.6.12"
27-
},
28-
"dependencies": {
29-
"vue": "^2.6.12"
30-
}
2+
"private": true,
3+
"publishConfig": {
4+
"registry": "https://npm.pkg.github.com/"
5+
},
6+
"scripts": {
7+
"dev": "npm run development",
8+
"development": "mix",
9+
"watch": "mix watch",
10+
"watch-poll": "mix watch -- --watch-options-poll=1000",
11+
"hot": "mix watch --hot",
12+
"prod": "npm run production",
13+
"production": "mix --production"
14+
},
15+
"devDependencies": {
16+
"@inertiajs/inertia": "^0.11.0",
17+
"@vue/babel-plugin-jsx": "^1.1.1",
18+
"acorn": "^8.0.4",
19+
"axios": "^0.26.1",
20+
"cross-env": "^7.0.3",
21+
"git-cz": "^4.7.6",
22+
"laravel-mix": "^6.0.43",
23+
"laravel-nova": "^1.6.0",
24+
"laravel-vapor": "^0.4.2",
25+
"minimist": "^1.2.2",
26+
"resolve-url-loader": "^3.1.2",
27+
"serialize-javascript": "^5.0.1",
28+
"tailwindcss": "^3.0.0",
29+
"uid": "^2.0.0",
30+
"vue-loader": "^17.0.0",
31+
"vue-template-compiler": "^2.6.14",
32+
"vuex": "^4.0.2"
33+
},
34+
"dependencies": {
35+
"form-backend-validation": "^2.4.0",
36+
"postcss-import": "^14.1.0",
37+
"terser-webpack-plugin": "^5.3.1",
38+
"vue": "^3"
39+
}
3140
}

Diff for: resources/js/components/CustomFields/BelongsToField.vue

100644100755
+23-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<script>
2-
import BelongsToField from '@/components/Form/BelongsToField.vue'
2+
import BelongsToField from '@/fields/Form/BelongsToField.vue'
33
import storage from '@/storage/BelongsToFieldStorage'
44
55
export default {
6-
mixins: [BelongsToField],
7-
methods: {
8-
/**
9-
* Get the resources that may be related to this resource.
10-
*/
11-
getAvailableResources() {
12-
return storage
13-
.fetchAvailableResources(
14-
this.resourceName,
15-
this.field.originalAttribute,
16-
this.queryParams
17-
)
18-
.then(({ data: { resources, softDeletes, withTrashed } }) => {
19-
if (this.initializingWithExistingResource || !this.isSearchable) {
20-
this.withTrashed = withTrashed
21-
}
22-
this.initializingWithExistingResource = false
23-
this.availableResources = resources
24-
this.softDeletes = softDeletes
25-
})
6+
mixins: [BelongsToField],
7+
methods: {
8+
/**
9+
* Get the resources that may be related to this resource.
10+
*/
11+
getAvailableResources() {
12+
return storage
13+
.fetchAvailableResources(
14+
this.resourceName,
15+
this.field.originalAttribute,
16+
this.queryParams
17+
)
18+
.then(({data: {resources, softDeletes, withTrashed}}) => {
19+
if (this.initializingWithExistingResource || !this.isSearchable) {
20+
this.withTrashed = withTrashed
21+
}
22+
this.initializingWithExistingResource = false
23+
this.availableResources = resources
24+
this.softDeletes = softDeletes
25+
})
26+
}
2627
}
27-
}
2828
}
29-
</script>
29+
</script>

Diff for: resources/js/components/CustomFields/FileField.vue

100644100755
+32-32
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
<script>
2-
import FileField from '@/components/Form/FileField.vue'
3-
import { Errors } from 'laravel-nova'
2+
import FileField from '@/fields/Form/FileField.vue'
3+
import {Errors} from 'laravel-nova'
44
55
export default {
6-
mixins: [FileField],
7-
methods: {
8-
/**
9-
* Remove the linked file from storage
10-
*/
11-
async removeFile() {
12-
this.uploadErrors = new Errors()
6+
mixins: [FileField],
7+
methods: {
8+
/**
9+
* Remove the linked file from storage
10+
*/
11+
async removeFile() {
12+
this.uploadErrors = new Errors()
1313
14-
const {
15-
resourceName,
16-
resourceId,
17-
relatedResourceName,
18-
relatedResourceId,
19-
viaRelationship
20-
} = this
14+
const {
15+
resourceName,
16+
resourceId,
17+
relatedResourceName,
18+
relatedResourceId,
19+
viaRelationship
20+
} = this
2121
22-
const attribute = this.field.originalAttribute
22+
const attribute = this.field.originalAttribute
2323
24-
const uri = this.viaRelationship
25-
? `/nova-api/${resourceName}/${resourceId}/${relatedResourceName}/${relatedResourceId}/field/${attribute}?viaRelationship=${viaRelationship}`
26-
: `/nova-api/${resourceName}/${resourceId}/field/${attribute}`
24+
const uri = this.viaRelationship
25+
? `/nova-api/${resourceName}/${resourceId}/${relatedResourceName}/${relatedResourceId}/field/${attribute}?viaRelationship=${viaRelationship}`
26+
: `/nova-api/${resourceName}/${resourceId}/field/${attribute}`
2727
28-
try {
29-
await Nova.request().delete(uri)
30-
this.closeRemoveModal()
31-
this.deleted = true
32-
this.$emit('file-deleted')
33-
} catch (error) {
34-
this.closeRemoveModal()
35-
if (error.response.status == 422) {
36-
this.uploadErrors = new Errors(error.response.data.errors)
28+
try {
29+
await Nova.request().delete(uri)
30+
this.closeRemoveModal()
31+
this.deleted = true
32+
this.$emit('file-deleted')
33+
} catch (error) {
34+
this.closeRemoveModal()
35+
if (error.response.status == 422) {
36+
this.uploadErrors = new Errors(error.response.data.errors)
37+
}
38+
}
3739
}
38-
}
3940
}
40-
}
4141
}
42-
</script>
42+
</script>

0 commit comments

Comments
 (0)