Skip to content

Commit

Permalink
fix(analysis): enlarge accountants bulk editing capabilities (adfinis…
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke authored and StephanH90 committed Aug 8, 2023
1 parent 1939040 commit 11b5cc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/analysis/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class AnalysisEditController extends Controller.extend(
}

get canBill() {
return this.session.data.user.isAccountant || this.isSuperuser;
return this.isAccountant || this.isSuperuser;
}

get needsReview() {
Expand Down
16 changes: 0 additions & 16 deletions app/analysis/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
project=this._project
task=this._task
}}
@disabled={{and
this.isAccountant
(not this.hasSelectedOwnReports)
}}
as |t|
>
<f.input @name="task">
Expand Down Expand Up @@ -119,10 +115,6 @@
class="form-control comment-field"
{{on "change" (pick "target.value" fi.update)}}
value={{fi.value}}
disabled={{and
this.isAccountant
(not this.hasSelectedOwnReports)
}}
/>
</label>
{{#if model.task.project.customerVisible}}
Expand All @@ -135,10 +127,6 @@
data-test-not-billable
@checked={{fi.value}}
@onChange={{fi.update}}
@disabled={{and
this.isAccountant
(not this.hasSelectedOwnReports)
}}
>
Not billable
{{#if (eq model.notBillable null)}}
Expand All @@ -155,10 +143,6 @@
data-test-review
@checked={{fi.value}}
@onChange={{fi.update}}
@disabled={{and
this.isAccountant
(not this.hasSelectedOwnReports)
}}
>
Needs Review
{{#if (eq model.review null)}}
Expand Down
12 changes: 6 additions & 6 deletions tests/acceptance/analysis-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,17 @@ module("Acceptance | analysis", function (hooks) {

assert
.dom("[data-test-customer] .ember-power-select-trigger")
.hasAttribute("aria-disabled", "true");
.hasAttribute("aria-disabled", "false");
assert
.dom("[data-test-project] .ember-power-select-trigger")
.hasAttribute("aria-disabled", "true");
.hasAttribute("aria-disabled", "false");
assert
.dom("[data-test-task] .ember-power-select-trigger")
.hasAttribute("aria-disabled", "true");
.hasAttribute("aria-disabled", "false");

assert.dom("[data-test-comment]").isDisabled();
assert.dom("[data-test-not-billable] input").isDisabled();
assert.dom("[data-test-review] input").isDisabled();
assert.dom("[data-test-comment]").isNotDisabled();
assert.dom("[data-test-not-billable] input").isNotDisabled();
assert.dom("[data-test-review] input").isNotDisabled();
assert.dom("[data-test-billed] input").isNotDisabled();
assert.dom("[data-test-verified] input").isDisabled();
});
Expand Down

0 comments on commit 11b5cc3

Please sign in to comment.