* FEATURE: Allow choice of category when making a PM public Previously it would default to uncategorized, which was not ideal on some forums. This gives the staff member more choice about what they'd like to do. * Make the optional category more explicit * Joffrey's feedback
27 lines
746 B
JavaScript
27 lines
746 B
JavaScript
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
|
|
|
export default Ember.Controller.extend(ModalFunctionality, {
|
|
publicCategoryId: null,
|
|
saving: true,
|
|
|
|
onShow() {
|
|
this.setProperties({ publicCategoryId: null, saving: false });
|
|
},
|
|
|
|
actions: {
|
|
makePublic() {
|
|
let topic = this.model;
|
|
topic
|
|
.convertTopic("public", { categoryId: this.publicCategoryId })
|
|
.then(() => {
|
|
topic.set("archetype", "regular");
|
|
topic.set("category_id", this.publicCategoryId);
|
|
this.appEvents.trigger("header:show-topic", topic);
|
|
this.send("closeModal");
|
|
})
|
|
.catch(popupAjaxError);
|
|
}
|
|
}
|
|
});
|