-
Notifications
You must be signed in to change notification settings - Fork 643
fix conditional fields in image editor #5022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3227f66
bd20216
f02a007
87d68ea
59b620c
ca840cf
6217991
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,7 @@ | |
| :trigger-validation="triggerValidation" | ||
| :doc-id="docFields.data._id" | ||
| :following-values="followingValues()" | ||
| :conditional-fields="conditionalFields" | ||
| :server-errors="serverErrors" | ||
| @validate="triggerValidate" | ||
| @reset="$emit('modified', false)" | ||
|
|
@@ -231,6 +232,7 @@ export default { | |
| 'docFields.data': { | ||
| deep: true, | ||
| handler(newData, oldData) { | ||
| this.evaluateConditions(); | ||
| this.$nextTick(() => { | ||
| // If either old or new state are an empty object, it's not | ||
| // "modified." | ||
|
|
@@ -252,8 +254,8 @@ export default { | |
| } | ||
| } | ||
| }, | ||
| media(newVal) { | ||
| this.updateActiveDoc(newVal); | ||
| async media(newVal) { | ||
| await this.updateActiveDoc(newVal); | ||
|
Comment on lines
+257
to
+258
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| }, | ||
| mounted() { | ||
|
|
@@ -271,6 +273,8 @@ export default { | |
| this.restoreOnly = !!this.activeMedia.archived; | ||
| this.original = klona(newMedia); | ||
| this.docFields.data = klona(newMedia); | ||
| this.evaluateConditions(); | ||
| await this.evaluateExternalConditions(); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Evaluate external conditions when selecting an image for edition. |
||
| this.generateLipKey(); | ||
| await this.unlock(); | ||
| // Distinguish between an actual doc and an empty placeholder | ||
|
|
@@ -402,7 +406,7 @@ export default { | |
| } | ||
|
|
||
| await this.cancel(); | ||
| this.updateActiveDoc(this.activeMedia); | ||
| await this.updateActiveDoc(this.activeMedia); | ||
| } | ||
| apos.bus.$emit('admin-menu-click', { | ||
| itemName: '@apostrophecms/i18n:localize', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-evaluate when a field is changed