FIX: New Topic button regression in tag page (#12613)

This commit is contained in:
Penar Musaraj 2021-04-06 09:31:49 -04:00 committed by GitHub
parent e026af11ac
commit f56a22bd2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 18 deletions

View File

@ -112,9 +112,6 @@ CategoryList.reopenClass({
categories: this.categoriesFrom(store, result),
can_create_category: result.category_list.can_create_category,
can_create_topic: result.category_list.can_create_topic,
draft_key: result.category_list.draft_key,
draft: result.category_list.draft,
draft_sequence: result.category_list.draft_sequence,
});
}
);

View File

@ -184,9 +184,6 @@ TopicList.reopenClass({
json.inserted = json.inserted || [];
json.can_create_topic = json.topic_list.can_create_topic;
json.more_topics_url = json.topic_list.more_topics_url;
json.draft_key = json.topic_list.draft_key;
json.draft_sequence = json.topic_list.draft_sequence;
json.draft = json.topic_list.draft;
json.for_period = json.topic_list.for_period;
json.loaded = true;
json.per_page = json.topic_list.per_page;

View File

@ -64,9 +64,6 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
topics: TopicList.topicsFrom(this.store, topicsList),
can_create_category: categoriesList.can_create_category,
can_create_topic: categoriesList.can_create_topic,
draft_key: categoriesList.draft_key,
draft: categoriesList.draft,
draft_sequence: categoriesList.draft_sequence,
});
}
// Otherwise, return the ajax result
@ -80,9 +77,6 @@ const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
topics: TopicList.topicsFrom(this.store, result),
can_create_category: result.category_list.can_create_category,
can_create_topic: result.category_list.can_create_topic,
draft_key: result.category_list.draft_key,
draft: result.category_list.draft,
draft_sequence: result.category_list.draft_sequence,
});
});
});

View File

@ -189,8 +189,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
.open({
categoryId: controller.get("category.id"),
action: Composer.CREATE_TOPIC,
draftKey: controller.get("list.draft_key"),
draftSequence: controller.get("list.draft_sequence"),
draftKey: Composer.NEW_TOPIC_KEY,
})
.then(() => {
// Pre-fill the tags input field

View File

@ -69,8 +69,6 @@ export function applyDefaultHandlers(pretender) {
if (loggedIn()) {
// Stuff to let us post
json.topic_list.can_create_topic = true;
json.topic_list.draft_key = "new_topic";
json.topic_list.draft_sequence = 1;
}
return response(json);
});
@ -81,8 +79,6 @@ export function applyDefaultHandlers(pretender) {
if (loggedIn()) {
// Stuff to let us post
json.topic_list.can_create_topic = true;
json.topic_list.draft_key = "new_topic";
json.topic_list.draft_sequence = 1;
}
return response(json);
});