Skip to content

Commit

Permalink
fix :Update btn disabled in Edit posting/ publishing drawer - EXO-65317
Browse files Browse the repository at this point in the history
 (#891)

Prior to this change, when open action menu of the news, click on , publish btn, disable publish toggle btn, reclick on action menu and enable publish toggle btn, the update btn is disabled. To fix this problem, when disabled the publish news and save it is also necessary to save the new targets of the news and add a condition in publish to change the state of btn update. After this change, as there is a state change the update btn should be enabled.

(cherry picked from commit 9fcb3fb)
  • Loading branch information
akhanfir authored and Jihed525 committed Jul 24, 2023
1 parent 3e89a0c commit 356b0f2
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,20 @@ export default {
this.disabled = true;
} else {
this.disabled = false;
}
if (this.publish && this.news.targets && this.selectedTargets !== this.news.targets) {
this.selectedTargets = this.news.targets;
this.disabled = false;
if (this.news.published) {
this.disabled = true;
}
}
},
selectedTargets(newVal, oldVal) {
if (this.publish && newVal.length === 0) {
this.disabled = true;
} else if (newVal !== oldVal) {
} else if (this.publish && this.selectedTargets !== this.news.targets && newVal !== oldVal) {
this.disabled = false;
} else {
this.disabled = true;
}
},
},
Expand Down Expand Up @@ -211,9 +216,7 @@ export default {
this.editingNews = true;
this.news.published = this.publish;
this.news.activityPosted = !this.isActivityPosted;
if (this.selectedTargets.length > 0) {
this.news.targets = this.selectedTargets;
}
this.news.targets = this.selectedTargets;
if (this.publish) {
this.news.audience = this.selectedAudience === this.$t('news.composer.stepper.audienceSection.allUsers') ? 'all' : 'space';
}
Expand Down

0 comments on commit 356b0f2

Please sign in to comment.