Skip to content

Commit

Permalink
refactor(ember): remove unused readonly parameter checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelinz committed Jan 24, 2025
1 parent 1400cac commit 6bfd6f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 40 deletions.
2 changes: 1 addition & 1 deletion ember/app/ui/components/identity-addresses/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<p>{{t "components.identity-addresses.list.empty"}}</p>
{{/if}}

{{#if (and (can "add address" @identity) (not @readOnlyView))}}
{{#if (can "add address" @identity)}}
<p class="uk-text-right">
<button
class="uk-button uk-button-default"
Expand Down
2 changes: 1 addition & 1 deletion ember/app/ui/components/identity-emails/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<p>{{t "components.identity-emails.list.empty"}}</p>
{{/if}}

{{#if (and (can "add additional-email" @identity) (not @readOnlyView))}}
{{#if (can "add additional-email" @identity)}}
<p class="uk-text-right">
<button
class="uk-button uk-button-default"
Expand Down
45 changes: 9 additions & 36 deletions ember/app/ui/components/identity-form/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
<Form.input
@label={{t "components.identity-form.label.organisationName"}}
@name="organisationName"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>

<div uk-grid>
Expand All @@ -34,21 +31,15 @@
@label={{t "components.identity-form.label.isExpertAssociation"}}
@type="checkbox"
@name="isExpertAssociation"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>
</div>
<div>
<Form.input
@label={{t "components.identity-form.label.isAdvisoryBoard"}}
@type="checkbox"
@name="isAdvisoryBoard"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>
</div>
</div>
Expand All @@ -71,10 +62,7 @@
@options={{this.salutations}}
@optionLabelPath="label"
@optionTargetPath="value"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>
</div>
<div>
Expand All @@ -85,10 +73,7 @@
@options={{this.titles}}
@optionLabelPath="label"
@optionTargetPath="value"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>
</div>
</div>
Expand All @@ -97,20 +82,14 @@
<Form.input
@label={{t "components.identity-form.label.firstName"}}
@name="firstName"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>
</div>
<div>
<Form.input
@label={{t "components.identity-form.label.lastName"}}
@name="lastName"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>
</div>
</div>
Expand All @@ -131,7 +110,6 @@
disabled={{or
this.changeset.idpId
(cannot "edit identity" this.changeset.data)
@readOnlyView
@profileView
}}
value={{field.value}}
Expand Down Expand Up @@ -160,10 +138,7 @@
@options={{this.languages}}
@optionLabelPath="label"
@optionTargetPath="value"
@disabled={{or
(cannot "edit identity" this.changeset.data)
@readOnlyView
}}
@disabled={{cannot "edit identity" this.changeset.data}}
/>

{{#if @profileView}}
Expand All @@ -178,9 +153,7 @@
@label={{t "components.identity-form.label.comment"}}
@name="comment"
@type="textarea"
@disabled={{or
(cannot "edit identity" this.changeset.data)
}}
@disabled={{or (cannot "edit identity" this.changeset.data)}}
/>

<p class="uk-flex uk-flex-between">
Expand Down
2 changes: 1 addition & 1 deletion ember/app/ui/components/identity-interests/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{{/each}}
</ul>

{{#if (and (can "add interest to identity" @identity) (not @readOnlyView))}}
{{#if (can "add interest to identity" @identity)}}
<p class="uk-text-right">
<button
class="uk-button uk-button-default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<p>{{t "components.identity-phone-numbers.list.empty"}}</p>
{{/if}}

{{#if (and (can "add phone-number" @identity) (not @readOnlyView))}}
{{#if (can "add phone-number" @identity)}}
<p class="uk-text-right">
<button
class="uk-button uk-button-default"
Expand Down

0 comments on commit 6bfd6f2

Please sign in to comment.