mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
CLEANUP: remove 'contains_messages' leftover 💩
This commit is contained in:
@@ -22,7 +22,6 @@ export default ComboboxView.extend({
|
||||
return categories.filter(c => {
|
||||
if (scopedCategoryId && c.get('id') !== scopedCategoryId && c.get('parent_category_id') !== scopedCategoryId) { return false; }
|
||||
if (c.get('isUncategorizedCategory')) { return false; }
|
||||
if (c.get('contains_messages')) { return false; }
|
||||
return c.get('permission') === PermissionType.FULL;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -90,12 +90,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||
this.set('selectedReplies', []);
|
||||
}.on('init'),
|
||||
|
||||
@computed("model.isPrivateMessage", "model.category_id")
|
||||
showCategoryChooser(isPrivateMessage, categoryId) {
|
||||
const category = Discourse.Category.findById(categoryId);
|
||||
const containsMessages = category && category.get("contains_messages");
|
||||
return !isPrivateMessage && !containsMessages;
|
||||
},
|
||||
showCategoryChooser: Ember.computed.not("model.isPrivateMessage"),
|
||||
|
||||
gotoInbox(name) {
|
||||
var url = '/users/' + this.get('currentUser.username_lower') + '/messages';
|
||||
|
||||
@@ -87,7 +87,6 @@ const Category = RestModel.extend({
|
||||
custom_fields: this.get('custom_fields'),
|
||||
topic_template: this.get('topic_template'),
|
||||
suppress_from_homepage: this.get('suppress_from_homepage'),
|
||||
contains_messages: this.get("contains_messages"),
|
||||
},
|
||||
type: this.get('id') ? 'PUT' : 'POST'
|
||||
});
|
||||
|
||||
@@ -67,12 +67,10 @@ const Composer = RestModel.extend({
|
||||
creatingPrivateMessage: Em.computed.equal('action', PRIVATE_MESSAGE),
|
||||
notCreatingPrivateMessage: Em.computed.not('creatingPrivateMessage'),
|
||||
|
||||
@computed("privateMessage", "archetype.hasOptions", "categoryId")
|
||||
showCategoryChooser(isPrivateMessage, hasOptions, categoryId) {
|
||||
@computed("privateMessage", "archetype.hasOptions")
|
||||
showCategoryChooser(isPrivateMessage, hasOptions) {
|
||||
const manyCategories = Discourse.Category.list().length > 1;
|
||||
const category = Discourse.Category.findById(categoryId);
|
||||
const containsMessages = category && category.get("contains_messages");
|
||||
return !isPrivateMessage && !containsMessages && (hasOptions || manyCategories);
|
||||
return !isPrivateMessage && (hasOptions || manyCategories);
|
||||
},
|
||||
|
||||
privateMessage: function(){
|
||||
|
||||
@@ -20,12 +20,6 @@
|
||||
</section>
|
||||
|
||||
{{#if emailInEnabled}}
|
||||
<section class='field'>
|
||||
<label>
|
||||
{{input type="checkbox" checked=category.contains_messages}}
|
||||
{{i18n 'category.contains_messages'}}
|
||||
</label>
|
||||
</section>
|
||||
<section class='field'>
|
||||
<label>
|
||||
{{input type="checkbox" checked=category.email_in_allow_strangers}}
|
||||
|
||||
@@ -178,7 +178,6 @@ class CategoriesController < ApplicationController
|
||||
:position,
|
||||
:email_in,
|
||||
:email_in_allow_strangers,
|
||||
:contains_messages,
|
||||
:suppress_from_homepage,
|
||||
:parent_category_id,
|
||||
:auto_close_hours,
|
||||
|
||||
@@ -474,7 +474,6 @@ end
|
||||
# auto_close_based_on_last_post :boolean default(FALSE)
|
||||
# topic_template :text
|
||||
# suppress_from_homepage :boolean default(FALSE)
|
||||
# contains_messages :boolean default(FALSE), not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
||||
@@ -544,7 +544,6 @@ class Topic < ActiveRecord::Base
|
||||
|
||||
def change_category_to_id(category_id)
|
||||
return false if private_message?
|
||||
return false if category.try(:contains_messages)
|
||||
|
||||
new_category_id = category_id.to_i
|
||||
# if the category name is blank, reset the attribute
|
||||
|
||||
@@ -19,8 +19,7 @@ class BasicCategorySerializer < ApplicationSerializer
|
||||
:background_url,
|
||||
:can_edit,
|
||||
:topic_template,
|
||||
:has_children,
|
||||
:contains_messages
|
||||
:has_children
|
||||
|
||||
def include_parent_category_id?
|
||||
parent_category_id
|
||||
|
||||
Reference in New Issue
Block a user