rename 'is_support' to 'contains_messages'
This commit is contained in:
parent
e8a6ff4808
commit
ba0df7e4cd
|
@ -21,7 +21,7 @@ export default ComboboxView.extend({
|
||||||
return categories.filter(c => {
|
return categories.filter(c => {
|
||||||
if (scopedCategoryId && c.get('id') !== scopedCategoryId && c.get('parent_category_id') !== scopedCategoryId) { return false; }
|
if (scopedCategoryId && c.get('id') !== scopedCategoryId && c.get('parent_category_id') !== scopedCategoryId) { return false; }
|
||||||
if (c.get('isUncategorizedCategory')) { return false; }
|
if (c.get('isUncategorizedCategory')) { return false; }
|
||||||
if (c.get('is_support')) { return false; }
|
if (c.get('contains_messages')) { return false; }
|
||||||
return c.get('permission') === Discourse.PermissionType.FULL;
|
return c.get('permission') === Discourse.PermissionType.FULL;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -81,8 +81,8 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||||
@computed("model.isPrivateMessage", "model.category_id")
|
@computed("model.isPrivateMessage", "model.category_id")
|
||||||
showCategoryChooser(isPrivateMessage, categoryId) {
|
showCategoryChooser(isPrivateMessage, categoryId) {
|
||||||
const category = Discourse.Category.findById(categoryId);
|
const category = Discourse.Category.findById(categoryId);
|
||||||
const isSupport = category && category.get("is_support");
|
const containsMessages = category && category.get("contains_messages");
|
||||||
return !isPrivateMessage && !isSupport;
|
return !isPrivateMessage && !containsMessages;
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -86,7 +86,7 @@ const Category = RestModel.extend({
|
||||||
custom_fields: this.get('custom_fields'),
|
custom_fields: this.get('custom_fields'),
|
||||||
topic_template: this.get('topic_template'),
|
topic_template: this.get('topic_template'),
|
||||||
suppress_from_homepage: this.get('suppress_from_homepage'),
|
suppress_from_homepage: this.get('suppress_from_homepage'),
|
||||||
is_support: this.get("is_support"),
|
contains_messages: this.get("contains_messages"),
|
||||||
},
|
},
|
||||||
type: this.get('id') ? 'PUT' : 'POST'
|
type: this.get('id') ? 'PUT' : 'POST'
|
||||||
});
|
});
|
||||||
|
|
|
@ -71,8 +71,8 @@ const Composer = RestModel.extend({
|
||||||
showCategoryChooser(isPrivateMessage, hasOptions, categoryId) {
|
showCategoryChooser(isPrivateMessage, hasOptions, categoryId) {
|
||||||
const manyCategories = Discourse.Category.list().length > 1;
|
const manyCategories = Discourse.Category.list().length > 1;
|
||||||
const category = Discourse.Category.findById(categoryId);
|
const category = Discourse.Category.findById(categoryId);
|
||||||
const isSupport = category && category.get("is_support");
|
const containsMessages = category && category.get("contains_messages");
|
||||||
return !isPrivateMessage && !isSupport && (hasOptions || manyCategories);
|
return !isPrivateMessage && !containsMessages && (hasOptions || manyCategories);
|
||||||
},
|
},
|
||||||
|
|
||||||
privateMessage: function(){
|
privateMessage: function(){
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
{{#if emailInEnabled}}
|
{{#if emailInEnabled}}
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
<label>
|
<label>
|
||||||
{{input type="checkbox" checked=category.is_support}}
|
{{input type="checkbox" checked=category.contains_messages}}
|
||||||
{{i18n 'category.email_in_allow_strangers'}}
|
{{i18n 'category.contains_messages'}}
|
||||||
</label>
|
</label>
|
||||||
</section>
|
</section>
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
|
|
|
@ -178,7 +178,7 @@ class CategoriesController < ApplicationController
|
||||||
:position,
|
:position,
|
||||||
:email_in,
|
:email_in,
|
||||||
:email_in_allow_strangers,
|
:email_in_allow_strangers,
|
||||||
:is_support,
|
:contains_messages,
|
||||||
:suppress_from_homepage,
|
:suppress_from_homepage,
|
||||||
:parent_category_id,
|
:parent_category_id,
|
||||||
:auto_close_hours,
|
:auto_close_hours,
|
||||||
|
|
|
@ -540,7 +540,7 @@ class Topic < ActiveRecord::Base
|
||||||
|
|
||||||
def change_category_to_id(category_id)
|
def change_category_to_id(category_id)
|
||||||
return false if private_message?
|
return false if private_message?
|
||||||
return false if category.try(:is_support)
|
return false if category.try(:contains_messages)
|
||||||
|
|
||||||
new_category_id = category_id.to_i
|
new_category_id = category_id.to_i
|
||||||
# if the category name is blank, reset the attribute
|
# if the category name is blank, reset the attribute
|
||||||
|
|
|
@ -20,7 +20,7 @@ class BasicCategorySerializer < ApplicationSerializer
|
||||||
:can_edit,
|
:can_edit,
|
||||||
:topic_template,
|
:topic_template,
|
||||||
:has_children,
|
:has_children,
|
||||||
:is_support
|
:contains_messages
|
||||||
|
|
||||||
def include_parent_category_id?
|
def include_parent_category_id?
|
||||||
parent_category_id
|
parent_category_id
|
||||||
|
|
|
@ -1590,7 +1590,7 @@ en:
|
||||||
email_in_allow_strangers: "Accept emails from anonymous users with no accounts"
|
email_in_allow_strangers: "Accept emails from anonymous users with no accounts"
|
||||||
email_in_disabled: "Posting new topics via email is disabled in the Site Settings. To enable posting new topics via email, "
|
email_in_disabled: "Posting new topics via email is disabled in the Site Settings. To enable posting new topics via email, "
|
||||||
email_in_disabled_click: 'enable the "email in" setting.'
|
email_in_disabled_click: 'enable the "email in" setting.'
|
||||||
is_support: "Transform this category into a private support portal."
|
contains_messages: "Change this category to only contain messages."
|
||||||
suppress_from_homepage: "Suppress this category from the homepage."
|
suppress_from_homepage: "Suppress this category from the homepage."
|
||||||
allow_badges_label: "Allow badges to be awarded in this category"
|
allow_badges_label: "Allow badges to be awarded in this category"
|
||||||
edit_permissions: "Edit Permissions"
|
edit_permissions: "Edit Permissions"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class RenameIsSupportToContainsMessages < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
rename_column :categories, :is_support, :contains_messages
|
||||||
|
end
|
||||||
|
end
|
|
@ -902,7 +902,7 @@ describe TopicsController do
|
||||||
let(:another_category) { Fabricate(:category) }
|
let(:another_category) { Fabricate(:category) }
|
||||||
|
|
||||||
it "cannot change the category of a topic that is in a support category" do
|
it "cannot change the category of a topic that is in a support category" do
|
||||||
@topic.category = Fabricate(:category, is_support: true)
|
@topic.category = Fabricate(:category, contains_messages: true)
|
||||||
@topic.save!
|
@topic.save!
|
||||||
xhr :put, :update, topic_id: @topic.id, slug: @topic.title, category_id: another_category.id
|
xhr :put, :update, topic_id: @topic.id, slug: @topic.title, category_id: another_category.id
|
||||||
expect(response).not_to be_success
|
expect(response).not_to be_success
|
||||||
|
|
Loading…
Reference in New Issue