Skip to content

Commit

Permalink
Fixes a problem with Whitecubes Flexible Content package where the de…
Browse files Browse the repository at this point in the history
…pendency container would do nothing #93 whitecube/nova-flexible-content#87
  • Loading branch information
wize-wiz committed Dec 1, 2019
1 parent 4bce19b commit d408149
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<br />

### Releases
- [v1.2.10](https://github.com/epartment/nova-dependency-container/releases/tag/1.2.10)
- Fixes a problem with [Whitecubes Flexible Content](https://github.com/whitecube/nova-flexible-content) package where the dependency container would do nothing #93 [whitecube/nova-flexible-content#87](https://github.com/whitecube/nova-flexible-content/issues/87)
- [v1.2.9](https://github.com/epartment/nova-dependency-container/releases/tag/1.2.9)
- Support BelongsToMany field when depending on the seleced resource #52
- [v1.2.8](https://github.com/epartment/nova-dependency-container/releases/tag/1.2.8)
Expand Down
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
value = (value && value.value) || null;
}
this.dependencyValues[component.field.attribute] = value;
// @todo: changed value as argument for `updateDependencyStatus`
// @todo: change value as argument for `updateDependencyStatus`
this.updateDependencyStatus()
}, {immediate: true});
Expand Down Expand Up @@ -97,7 +97,8 @@
}
for (let dependency of this.field.dependencies) {
if(component.field.attribute === dependency.field) {
// #93 compatability with flexible-content, which adds a generated attribute for each field
if(component.field.attribute === (this.field.attribute + dependency.field)) {
return true;
}
}
Expand All @@ -109,7 +110,8 @@
updateDependencyStatus() {
for (let dependency of this.field.dependencies) {
let dependencyValue = this.dependencyValues[dependency.field];
// #93 compatability with flexible-content, which adds a generated attribute for each field
let dependencyValue = this.dependencyValues[(this.field.attribute + dependency.field)];
if(dependency.hasOwnProperty('empty') && !dependencyValue) {
this.dependenciesSatisfied = true;
return;
Expand Down

0 comments on commit d408149

Please sign in to comment.