mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: Groups list does not refresh when query changes. (#6481)
This commit is contained in:

committed by
Régis Hanol

parent
1b0fbc4d30
commit
ded5ff90aa
@ -11,8 +11,6 @@ export default Discourse.Route.extend({
|
|||||||
username: { refreshModel: true }
|
username: { refreshModel: true }
|
||||||
},
|
},
|
||||||
|
|
||||||
refreshQueryWithoutTransition: true,
|
|
||||||
|
|
||||||
model(params) {
|
model(params) {
|
||||||
this._params = params;
|
this._params = params;
|
||||||
return this.store.findAll("group", params);
|
return this.store.findAll("group", params);
|
||||||
|
@ -3,6 +3,10 @@ import { acceptance } from "helpers/qunit-helpers";
|
|||||||
acceptance("Groups");
|
acceptance("Groups");
|
||||||
|
|
||||||
QUnit.test("Browsing Groups", async assert => {
|
QUnit.test("Browsing Groups", async assert => {
|
||||||
|
await visit("/groups?username=eviltrout");
|
||||||
|
|
||||||
|
assert.equal(count(".groups-table-row"), 1, "it displays user's groups");
|
||||||
|
|
||||||
await visit("/groups");
|
await visit("/groups");
|
||||||
|
|
||||||
assert.equal(count(".groups-table-row"), 2, "it displays visible groups");
|
assert.equal(count(".groups-table-row"), 2, "it displays visible groups");
|
||||||
|
@ -50,5 +50,34 @@ export default {
|
|||||||
extras: { group_user_ids: [] },
|
extras: { group_user_ids: [] },
|
||||||
total_rows_groups: 2,
|
total_rows_groups: 2,
|
||||||
load_more_groups: "/groups?page=1"
|
load_more_groups: "/groups?page=1"
|
||||||
|
},
|
||||||
|
"/groups.json?username=eviltrout": {
|
||||||
|
groups: [
|
||||||
|
{
|
||||||
|
id: 41,
|
||||||
|
automatic: false,
|
||||||
|
name: "discourse",
|
||||||
|
user_count: 0,
|
||||||
|
alias_level: 0,
|
||||||
|
visible: true,
|
||||||
|
automatic_membership_email_domains: "",
|
||||||
|
automatic_membership_retroactive: false,
|
||||||
|
primary_group: false,
|
||||||
|
title: null,
|
||||||
|
grant_trust_level: null,
|
||||||
|
has_messages: false,
|
||||||
|
flair_url: null,
|
||||||
|
flair_bg_color: null,
|
||||||
|
flair_color: null,
|
||||||
|
bio_raw: "",
|
||||||
|
bio_cooked: null,
|
||||||
|
public_admission: true,
|
||||||
|
allow_membership_requests: false,
|
||||||
|
full_name: "Awesome Team"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
extras: { group_user_ids: [] },
|
||||||
|
total_rows_groups: 1,
|
||||||
|
load_more_groups: "/groups?page=1"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -350,6 +350,10 @@ export default function() {
|
|||||||
return response(200, fixturesByUrl["/groups.json"]);
|
return response(200, fixturesByUrl["/groups.json"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.get("/groups.json", () => {
|
||||||
|
return response(200, fixturesByUrl["/groups.json?username=eviltrout"]);
|
||||||
|
});
|
||||||
|
|
||||||
this.get("groups/search.json", () => {
|
this.get("groups/search.json", () => {
|
||||||
return response(200, []);
|
return response(200, []);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user