diff --git a/app/components/paginated-table/foot/template.hbs b/app/components/paginated-table/foot/template.hbs
index d4189576c..9f25579b7 100644
--- a/app/components/paginated-table/foot/template.hbs
+++ b/app/components/paginated-table/foot/template.hbs
@@ -4,7 +4,7 @@
{{#if (gt this.pages 1)}}
{{/if}}
- {{pagination-limit page=this.page page_size=this.page_size}}
+
{{yield to='inverse'}}
diff --git a/app/components/sy-toggle/template.hbs b/app/components/sy-toggle/template.hbs
index 4b04aed96..6d6a2acaa 100644
--- a/app/components/sy-toggle/template.hbs
+++ b/app/components/sy-toggle/template.hbs
@@ -3,7 +3,7 @@
class="sy-toggle {{if @value 'active' 'inactive'}}"
title={{concat @hint (if @disabled " (disabled)")}}
tabindex="0"
- role="button"
+ role="link"
{{on "click" (optional (unless @disabled @onToggle))}}
{{on "keyup" this.handleKeyUp}}
>
diff --git a/app/components/worktime-balance-chart/template.hbs b/app/components/worktime-balance-chart/template.hbs
index fb5c4b157..f8c14bf36 100644
--- a/app/components/worktime-balance-chart/template.hbs
+++ b/app/components/worktime-balance-chart/template.hbs
@@ -1 +1 @@
-{{yield}}
\ No newline at end of file
+
{{yield}}
\ No newline at end of file
diff --git a/app/users/edit/credits/index/template.hbs b/app/users/edit/credits/index/template.hbs
index d309366ce..ce49c2798 100644
--- a/app/users/edit/credits/index/template.hbs
+++ b/app/users/edit/credits/index/template.hbs
@@ -50,6 +50,7 @@
{{#each absenceCredits as |absenceCredit|}}
Add new credit
{{/if}}
@@ -128,6 +128,7 @@
{{#each overtimeCredits as |overtimeCredit|}}
Add new credit
{{/if}}
diff --git a/app/users/edit/responsibilities/controller.js b/app/users/edit/responsibilities/controller.js
index 8f056e8ec..e36d2da7f 100644
--- a/app/users/edit/responsibilities/controller.js
+++ b/app/users/edit/responsibilities/controller.js
@@ -1,4 +1,6 @@
import Controller from "@ember/controller";
+import { action } from "@ember/object";
+import { inject as service } from "@ember/service";
import { task } from "ember-concurrency";
import QueryParams from "ember-parachute";
import moment from "moment";
@@ -7,11 +9,17 @@ import { all } from "rsvp";
const UsersEditResponsibilitiesQueryParams = new QueryParams({});
export default Controller.extend(UsersEditResponsibilitiesQueryParams.Mixin, {
+ router: service("router"),
+
setup() {
this.projects.perform();
this.supervisees.perform();
},
+ openSupervisorProfile: action(function (superviseId) {
+ return this.router.transitionTo("users.edit", superviseId);
+ }),
+
projects: task(function* () {
return yield this.store.query("project", {
has_reviewer: this.get("model.id"),
diff --git a/app/users/edit/responsibilities/template.hbs b/app/users/edit/responsibilities/template.hbs
index 23d7d7601..d802e2bdc 100644
--- a/app/users/edit/responsibilities/template.hbs
+++ b/app/users/edit/responsibilities/template.hbs
@@ -63,10 +63,9 @@
{{#each supervisees as |supervisee|}}
-
{{supervisee.fullName}} |
@@ -90,7 +89,7 @@
}}
{{supervisee.absenceBalances.firstObject.balance}} |
-
+
{{/each}}
diff --git a/app/users/index/controller.js b/app/users/index/controller.js
index 0e715b143..25747f4a5 100644
--- a/app/users/index/controller.js
+++ b/app/users/index/controller.js
@@ -1,5 +1,5 @@
import Controller from "@ember/controller";
-import { computed } from "@ember/object";
+import { computed, action } from "@ember/object";
import { reads } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { task, timeout, hash } from "ember-concurrency";
@@ -31,9 +31,14 @@ const UsersQueryParams = new QueryParams({
const UsersIndexController = Controller.extend(UsersQueryParams.Mixin, {
session: service("session"),
+ router: service("router"),
currentUser: reads("session.data.user"),
+ viewUserProfile: action(function (userId) {
+ return this.router.transitionTo("users.edit", userId);
+ }),
+
selectedSupervisor: computed(
"prefetchData.lastSuccessful.value.supervisor",
"store",
diff --git a/app/users/index/template.hbs b/app/users/index/template.hbs
index 950828ddc..4a1a55b5f 100644
--- a/app/users/index/template.hbs
+++ b/app/users/index/template.hbs
@@ -72,10 +72,9 @@
@containerSelector=".page-content--scroll"
as |user|
>
-
|
-
+
{{/if}}
diff --git a/tests/acceptance/users-edit-responsibilities-test.js b/tests/acceptance/users-edit-responsibilities-test.js
index ac81c8d13..e09f29c72 100644
--- a/tests/acceptance/users-edit-responsibilities-test.js
+++ b/tests/acceptance/users-edit-responsibilities-test.js
@@ -1,4 +1,4 @@
-import { visit } from "@ember/test-helpers";
+import { visit, currentURL, click } from "@ember/test-helpers";
import { setupMirage } from "ember-cli-mirage/test-support";
import { setupApplicationTest } from "ember-qunit";
import { authenticateSession } from "ember-simple-auth/test-support";
@@ -9,10 +9,19 @@ module("Acceptance | users edit responsibilities", function (hooks) {
setupMirage(hooks);
hooks.beforeEach(async function () {
- this.user = this.server.create("user");
+ this.admin = this.server.create("user", {
+ isSuperuser: true,
+ firstName: "Admin FirstName",
+ lastName: "Admin LastName",
+ });
+ this.user = this.server.create("user", {
+ supervisorIds: [this.admin.id],
+ firstName: "FirstName",
+ lastName: "LastName",
+ });
// eslint-disable-next-line camelcase
- await authenticateSession({ user_id: this.user.id });
+ await authenticateSession({ user_id: this.admin.id });
});
test("can visit /users/:id/responsibilities", async function (assert) {
@@ -20,4 +29,10 @@ module("Acceptance | users edit responsibilities", function (hooks) {
assert.dom(".card").exists({ count: 2 });
});
+
+ test("Super user can visit the users profile", async function (assert) {
+ await visit(`/users/1/responsibilities`);
+ await click("tbody tr:nth-child(2)");
+ assert.strictEqual(currentURL(), `/users/${this.user.id}`);
+ });
});
diff --git a/tests/acceptance/users-test.js b/tests/acceptance/users-test.js
index e9aca32a2..eadc7ae59 100644
--- a/tests/acceptance/users-test.js
+++ b/tests/acceptance/users-test.js
@@ -71,4 +71,10 @@ module("Acceptance | users", function (hooks) {
assert.strictEqual(currentURL(), "/users");
});
+ test("can open other users profile", async function (assert) {
+ await visit("/users");
+ await waitFor("table tbody tr");
+ await click("table tbody tr");
+ assert.strictEqual(currentURL(), "/users/2");
+ });
});