FEATURE: Claim Reviewables by Topic

This is a feature that used to be present in discourse-assign but is
much easier to implement in core. It also allows a topic to be assigned
without it claiming for review and vice versa and allows it to work with
category group reviewers.
This commit is contained in:
Robin Ward
2019-05-08 10:20:51 -04:00
parent 8dfb15a2e5
commit b380ed5282
30 changed files with 448 additions and 47 deletions
@@ -11,7 +11,8 @@ const _moreWidgets = [
const fruits = [
{ id: 1, name: "apple", farmer_id: 1, color_ids: [1, 2], category_id: 4 },
{ id: 2, name: "banana", farmer_id: 1, color_ids: [3], category_id: 3 },
{ id: 3, name: "grape", farmer_id: 2, color_ids: [2], category_id: 5 }
{ id: 3, name: "grape", farmer_id: 2, color_ids: [2], category_id: 5 },
{ id: 4, name: "orange", farmer_id: null, color_ids: [2], category_id: 5 }
];
const farmers = [
@@ -28,8 +29,8 @@ const colors = [
export default function(helpers) {
const { response, success, parsePostData } = helpers;
this.get("/fruits/:id", function() {
const fruit = fruits[0];
this.get("/fruits/:id", function(request) {
const fruit = fruits.find(f => f.id === parseInt(request.params.id));
return response({ __rest_serializer: "1", fruit, farmers, colors });
});
+9 -1
View File
@@ -142,7 +142,7 @@ QUnit.test("destroyRecord when new", function(assert) {
QUnit.test("find embedded", function(assert) {
const store = createStore();
return store.find("fruit", 2).then(function(f) {
return store.find("fruit", 1).then(function(f) {
assert.ok(f.get("farmer"), "it has the embedded object");
const fruitCols = f.get("colors");
@@ -154,6 +154,14 @@ QUnit.test("find embedded", function(assert) {
});
});
QUnit.test("embedded records can be cleared", async assert => {
const store = createStore();
let f = await store.find("fruit", 4);
f.set("farmer", { dummy: "object" });
f = await store.find("fruit", 4);
assert.ok(!f.get("farmer"));
});
QUnit.test("meta types", function(assert) {
const store = createStore();
return store.find("barn", 1).then(function(f) {