diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard-next.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard-next.js.es6 index 433558917b5..f65e2f04fdc 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard-next.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard-next.js.es6 @@ -23,18 +23,6 @@ export default Ember.Controller.extend({ return this.currentUser.get("admin") && (problemsLength || 0) > 0; }, - @computed("foundProblems") - thereWereProblems(foundProblems) { - if (!this.currentUser.get("admin")) { return false; } - - if (foundProblems) { - this.set("hadProblems", true); - return true; - } else { - return this.get("hadProblems") || false; - } - }, - fetchDashboard() { if (this.get("isLoading")) return; diff --git a/app/assets/javascripts/admin/templates/dashboard-problems.hbs b/app/assets/javascripts/admin/templates/dashboard-problems.hbs index 94f878bc9e9..81bee62b289 100644 --- a/app/assets/javascripts/admin/templates/dashboard-problems.hbs +++ b/app/assets/javascripts/admin/templates/dashboard-problems.hbs @@ -1,36 +1,27 @@ {{#if foundProblems}} -
-
- {{#conditional-loading-spinner condition=loadingProblems}} -
-

- {{d-icon "exclamation-triangle"}} - {{i18n 'admin.dashboard.problems_found'}}

-
    +
    +
    +

    + {{d-icon "exclamation-triangle"}} + {{i18n 'admin.dashboard.problems_found'}} +

    +
    + +
    + {{#conditional-loading-section isLoading=loadingProblems}} +
    +
      {{#each problems as |problem|}}
    • {{{problem}}}
    • {{/each}}
    +

    {{i18n 'admin.dashboard.last_checked'}}: {{problemsTimestamp}} {{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}}

    - {{/conditional-loading-spinner}} + {{/conditional-loading-section}}
    -
    -{{else}} - {{#if thereWereProblems}} -
    -
     
    -
    -

    - {{i18n 'admin.dashboard.no_problems'}} - {{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}} -

    -
    -
    -
    - {{/if}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/dashboard_next.hbs b/app/assets/javascripts/admin/templates/dashboard_next.hbs index 1608d6238ce..4930c46bf00 100644 --- a/app/assets/javascripts/admin/templates/dashboard_next.hbs +++ b/app/assets/javascripts/admin/templates/dashboard_next.hbs @@ -1,14 +1,14 @@ {{plugin-outlet name="admin-dashboard-top"}} -
    - {{#if showVersionChecks}} -
    +{{#if showVersionChecks}} +
    +
    {{partial 'admin/templates/version-checks'}} - {{partial 'admin/templates/dashboard-problems'}} +
    - {{/if}} -
    -
    +{{/if}} + +{{partial 'admin/templates/dashboard-problems'}}
    diff --git a/app/assets/stylesheets/common/admin/dashboard_next.scss b/app/assets/stylesheets/common/admin/dashboard_next.scss index 78e4cdf0c0b..53d5da44f30 100644 --- a/app/assets/stylesheets/common/admin/dashboard_next.scss +++ b/app/assets/stylesheets/common/admin/dashboard_next.scss @@ -177,6 +177,18 @@ } } } + + .dashboard-problems { + margin-bottom: 2em; + + .d-icon-exclamation-triangle { + color: $danger; + } + + .actions { + margin: 0; + } + } } .dashboard-mini-chart { diff --git a/test/javascripts/acceptance/dashboard-next-test.js.es6 b/test/javascripts/acceptance/dashboard-next-test.js.es6 index 46d50d0087a..56aef0402b6 100644 --- a/test/javascripts/acceptance/dashboard-next-test.js.es6 +++ b/test/javascripts/acceptance/dashboard-next-test.js.es6 @@ -1,7 +1,4 @@ -import { - acceptance -} -from "helpers/qunit-helpers"; +import { acceptance } from "helpers/qunit-helpers"; acceptance("Dashboard Next", { loggedIn: true @@ -11,12 +8,33 @@ QUnit.test("Visit dashboard next page", assert => { visit("/admin"); andThen(() => { - assert.ok($('.dashboard-next').length, "has dashboard-next class"); + assert.ok($(".dashboard-next").length, "has dashboard-next class"); - assert.ok($('.dashboard-mini-chart.signups').length, "has a signups chart"); - assert.ok($('.dashboard-mini-chart.posts').length, "has a posts chart"); - assert.ok($('.dashboard-mini-chart.dau_by_mau').length, "has a dau_by_mau chart"); - assert.ok($('.dashboard-mini-chart.daily_engaged_users').length, "has a daily_engaged_users chart"); - assert.ok($('.dashboard-mini-chart.new_contributors').length, "has a new_contributors chart"); + assert.ok($(".dashboard-mini-chart.signups").length, "has a signups chart"); + + assert.ok($(".dashboard-mini-chart.posts").length, "has a posts chart"); + + assert.ok( + $(".dashboard-mini-chart.dau_by_mau").length, + "has a dau_by_mau chart" + ); + + assert.ok( + $(".dashboard-mini-chart.daily_engaged_users").length, + "has a daily_engaged_users chart" + ); + + assert.ok( + $(".dashboard-mini-chart.new_contributors").length, + "has a new_contributors chart" + ); + + assert.equal( + $(".section.dashboard-problems .problem-messages ul li:first-child") + .html() + .trim(), + "Houston...", + "displays problems" + ); }); }); diff --git a/test/javascripts/fixtures/problems.js.es6 b/test/javascripts/fixtures/problems.js.es6 index d9f77979fdb..7e188ee5830 100644 --- a/test/javascripts/fixtures/problems.js.es6 +++ b/test/javascripts/fixtures/problems.js.es6 @@ -1,4 +1,5 @@ export default { "/admin/dashboard/problems.json": { + problems: ["Houston..."] } };