FEATURE: New 'Reviewable' model to make reviewable items generic

Includes support for flags, reviewable users and queued posts, with REST API
backwards compatibility.

Co-Authored-By: romanrizzi <romanalejandro@gmail.com>
Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
Robin Ward
2019-01-03 12:03:01 -05:00
parent 9a56b398a1
commit b58867b6e9
354 changed files with 8090 additions and 5225 deletions

View File

@@ -1,8 +0,0 @@
export default Discourse.Route.extend({
redirect() {
let segment = this.siteSettings.flags_default_topics
? "topics"
: "postsActive";
this.replaceWith(`adminFlags.${segment}`);
}
});

View File

@@ -1,20 +0,0 @@
import { loadTopicView } from "discourse/models/topic";
export default Ember.Route.extend({
model(params) {
let topicRecord = this.store.createRecord("topic", { id: params.id });
let topic = loadTopicView(topicRecord).then(() => topicRecord);
return Ember.RSVP.hash({
topic,
flaggedPosts: this.store.findAll("flagged-post", {
filter: "active",
topic_id: params.id
})
});
},
setupController(controller, hash) {
controller.setProperties(hash);
}
});

View File

@@ -120,18 +120,6 @@ export default function() {
}
);
this.route(
"adminFlags",
{ path: "/flags", resetNamespace: true },
function() {
this.route("postsActive", { path: "active" });
this.route("postsOld", { path: "old" });
this.route("topics", { path: "topics" }, function() {
this.route("show", { path: ":id" });
});
}
);
this.route(
"adminLogs",
{ path: "/logs", resetNamespace: true },