Skip to content

Commit

Permalink
fix: disable invisible fields from Edit Profile Contact - Meeds-io/me…
Browse files Browse the repository at this point in the history
…eds#110 - EXO-70160 (#3786)

If a field is hidden by an administrator, the user should not be able to
re-hide it , and the Hide button should be disabled.
  • Loading branch information
ahamdi authored and exo-swf committed May 13, 2024
1 parent 19c3398 commit 9de5b16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ profileContactInformation.hide.property.alt=Forbid the user to hide this attribu
profileContactInformation.show.property.alt=Allow the user to hide this attribute
profileContactInformation.quickSearch.noPeople=No People
profileContactInformation.quickSearch.resetFilter=Reset
profileContactInformation.invisible.property.cant.be.hidden.label=The attribute is already hidden by the administrator

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
class="d-inline-block">
<v-btn
v-if="!isHidden"
:disabled="!isHiddenable"
:disabled="!isHiddenable || !property.visible"
icon
:aria-label="$t('profileContactInformation.hide.property.label')"
:aria-label="unhiddenableOrHiddenByAdminMessage"
@click="hideProperty">
<v-icon
size="18"
Expand All @@ -54,6 +54,9 @@
<span v-if="!isHiddenable && !isNew">
{{ $t('profileContactInformation.hiddenable.disabled') }}
</span>
<span v-else-if="!property.visible && !isNew">
{{ $t('profileContactInformation.invisible.property.cant.be.hidden.label') }}
</span>
<span v-else-if="!isHidden && !isNew">
{{ $t('profileContactInformation.hide.property.label') }}
</span>
Expand Down Expand Up @@ -83,6 +86,9 @@ export default {
},
isNew() {
return this.property?.isNew;
},
unhiddenableOrHiddenByAdminMessage() {
return !this.property?.visible ? this.$t('profileContactInformation.invisible.property.cant.be.hidden.label') : this.$t('profileContactInformation.hide.property.label');
}
},
methods: {
Expand Down

0 comments on commit 9de5b16

Please sign in to comment.