mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-03-09 14:37:15 +00:00
FEATURE: improve blank page syndrome (#168)
This commit is contained in:
parent
55cb184f7e
commit
473c530018
@ -1,6 +1,14 @@
|
|||||||
import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
|
import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
|
||||||
|
import I18n from "I18n";
|
||||||
|
|
||||||
export default UserActivityStreamRoute.extend({
|
export default UserActivityStreamRoute.extend({
|
||||||
userActionType: 15,
|
userActionType: 15,
|
||||||
noContentHelpKey: "solved.no_solutions",
|
noContentHelpKey: "solved.no_solutions",
|
||||||
|
|
||||||
|
emptyState() {
|
||||||
|
return {
|
||||||
|
title: I18n.t("solved.no_solved_topics_title"),
|
||||||
|
body: I18n.t("solved.no_solved_topics_body"),
|
||||||
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -24,6 +24,8 @@ en:
|
|||||||
all: "all"
|
all: "all"
|
||||||
solved: "solved"
|
solved: "solved"
|
||||||
unsolved: "unsolved"
|
unsolved: "unsolved"
|
||||||
|
no_solved_topics_title: "You haven’t solved any topics yet"
|
||||||
|
no_solved_topics_body: "When you provide a helpful reply to a topic, your reply might be selected as the solution by the topic owner or staff."
|
||||||
|
|
||||||
topic_statuses:
|
topic_statuses:
|
||||||
solved:
|
solved:
|
||||||
|
28
test/javascripts/acceptance/user-activity-solved-test.js.es6
Normal file
28
test/javascripts/acceptance/user-activity-solved-test.js.es6
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
|
||||||
|
import { test } from "qunit";
|
||||||
|
import { visit } from "@ember/test-helpers";
|
||||||
|
|
||||||
|
acceptance(
|
||||||
|
"Discourse Solved Plugin | activity/solved | empty state",
|
||||||
|
function (needs) {
|
||||||
|
needs.user();
|
||||||
|
|
||||||
|
needs.pretender((server, helper) => {
|
||||||
|
const emptyResponse = { user_actions: [] };
|
||||||
|
|
||||||
|
server.get("/user_actions.json", () => {
|
||||||
|
return helper.response(emptyResponse);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("When looking at own activity it renders the empty state panel", async function (assert) {
|
||||||
|
await visit("/u/eviltrout/activity/solved");
|
||||||
|
assert.ok(exists("div.empty-state"));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("When looking at another user's activity it renders the 'No activity' message", async function (assert) {
|
||||||
|
await visit("/u/charlie/activity/solved");
|
||||||
|
assert.ok(exists("div.alert-info"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user