Skip to content

Commit

Permalink
Closes #7877
Browse files Browse the repository at this point in the history
- Front-end sanding and shimming: displays <span> instead of button when domainObject.disallowUnlock.
  • Loading branch information
charlesh88 committed Oct 10, 2024
1 parent e7f8002 commit 3fcefd7
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/ui/layout/BrowseBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@
:title="lockedOrUnlockedTitle"
:class="{
'c-button icon-lock': domainObject.locked,
'c-icon-button icon-unlocked': !domainObject.locked,
'l-browse-bar__lock_button__disallow_unlock': domainObject.disallowUnlock
'c-icon-button icon-unlocked': !domainObject.locked
}"
@click="toggleLock(!domainObject.locked)"
></button>

<span
v-else
class="icon-lock"
aria-label="Locked for editing, cannot be unlocked."
title="Locked for editing, cannot be unlocked."
></span>

<button
v-if="isViewEditable && !isEditing && !domainObject.locked"
class="l-browse-bar__actions__edit c-button c-button--major icon-pencil"
Expand Down Expand Up @@ -185,9 +191,13 @@ export default {
return this.isPersistable && !this.domainObject.locked;
},
shouldShowLock() {
return (
(this.domainObject && this.domainObject.locked) || (this.isViewEditable && !this.isEditing)
);
if (this.domainObject === undefined) {
return false;
}
if (this.domainObject.disallowUnlock) {
return false;

Check warning on line 198 in src/ui/layout/BrowseBar.vue

View check run for this annotation

Codecov / codecov/patch

src/ui/layout/BrowseBar.vue#L198

Added line #L198 was not covered by tests
}
return this.domainObject.locked || (this.isViewEditable && !this.isEditing);
},
statusClass() {
return this.status ? `is-status--${this.status}` : '';
Expand Down Expand Up @@ -269,11 +279,7 @@ export default {
} else {
title = 'Locked for editing. ';

Check warning on line 280 in src/ui/layout/BrowseBar.vue

View check run for this annotation

Codecov / codecov/patch

src/ui/layout/BrowseBar.vue#L280

Added line #L280 was not covered by tests
}
if (this.domainObject.disallowUnlock) {
title += 'Cannot be unlocked.';
} else {
title += 'Click to unlock.';
}
title += 'Click to unlock.';

Check warning on line 282 in src/ui/layout/BrowseBar.vue

View check run for this annotation

Codecov / codecov/patch

src/ui/layout/BrowseBar.vue#L282

Added line #L282 was not covered by tests
} else {
title = 'Unlocked for editing, click to lock.';

Check warning on line 284 in src/ui/layout/BrowseBar.vue

View check run for this annotation

Codecov / codecov/patch

src/ui/layout/BrowseBar.vue#L284

Added line #L284 was not covered by tests
}
Expand Down

0 comments on commit 3fcefd7

Please sign in to comment.