Skip to content

Commit

Permalink
Merge pull request #258 from crynobone/fixes-255
Browse files Browse the repository at this point in the history
Fixes `Slug` field inside tab doesn't work since Nova 4.14.0
  • Loading branch information
marcfil authored Oct 25, 2022
2 parents 68d7630 + a527a91 commit 8a11cd3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 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
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 8a11cd3

Please sign in to comment.