Skip to content

Commit

Permalink
Fixes Slug field inside tab doesn't work since Nova 4.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone authored Oct 11, 2022
1 parent 68d7630 commit 42a5f63
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/workflows/update-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
workflow_dispatch:
push:
branches: [master]
pull_request:

jobs:
update:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"license": "MIT",
"require": {
"php": "^7.4|^8",
"laravel/nova": "^4.12",
"nova-kit/nova-packages-tool": "^1.3",
"laravel/nova": "^4.14",
"nova-kit/nova-packages-tool": "^1.3.4",
"ext-json": "*"
},
"require-dev": {
Expand Down
9 changes: 3 additions & 6 deletions resources/js/components/DetailTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ import HasTabs from "../mixins/HasTabs";
export default {
mixins: [BehavesAsPanel, HasTabs],
props: {
mode: {
type: String,
default: 'detail',
},
}
data: () => ({
tabMode: 'detail',
}),
};
</script>
9 changes: 3 additions & 6 deletions resources/js/components/FormTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ import HasTabs from "../mixins/HasTabs";
export default {
mixins: [BehavesAsPanel, HasTabs],
props: {
mode: {
type: String,
default: 'form',
},
}
data: () => ({
tabMode: 'form',
}),
};
</script>
4 changes: 2 additions & 2 deletions resources/js/mixins/HasTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default {
Nova.store.tabsListenerRegistered = true;
}

if (this.mode === 'form') {
if (this.tabMode === 'form') {
this.$watch('validationErrors', (newErrors) => {
if (newErrors.errors) {
Object.entries(newErrors.errors).forEach(error => {
Expand Down Expand Up @@ -227,7 +227,7 @@ export default {
*/
getComponentName(field) {
return field.prefixComponent
? this.mode + '-' + field.component
? this.tabMode + '-' + field.component
: field.component
},

Expand Down

0 comments on commit 42a5f63

Please sign in to comment.