Skip to content

Commit

Permalink
Merge pull request #220 from upfluence/oc/DRA-1722
Browse files Browse the repository at this point in the history
Added locked state on list cell renderer
  • Loading branch information
OwenCoogan authored Jan 9, 2025
2 parents 81f3cb0 + da91af9 commit bab25a3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
13 changes: 11 additions & 2 deletions addon/components/hyper-table/cell-renderers/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
<div class="expandable-list">
{{#each this.value as |item|}}
<div
class="expandable-list__item"
{{on "click" (action "goToUrl" (concat this.url item.id) bubbles=false)}}
class="expandable-list__item
{{if item.locked 'expandable-list__item-disabled '}}fx-row fx-xalign-center fx-gap-px-6"
{{on "click" (action "goToUrl" (concat this.url item.id) item.locked bubbles=false)}}
>
{{item.name}}
{{#if item.locked}}
<OSS::Tag
@icon="far fa-lock"
@size="xs"
@skin="secondary"
{{enable-tooltip title=this.lockedTooltipLabel}}
/>
{{/if}}
</div>
{{/each}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions addon/components/hyper-table/cell-renderers/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default Component.extend(CellRendererMixin, {
}),

actions: {
goToUrl(url, event) {
if (!this.url) {
goToUrl(url, locked, event) {
if (!this.url || locked) {
event.preventDefault();
event.stopPropagation();
return;
Expand Down
6 changes: 6 additions & 0 deletions app/styles/cells.less
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@
padding: var(--spacing-px-12) var(--spacing-px-18);
cursor: pointer;

&-disabled {
&:hover {
cursor: not-allowed;
}
}

&:hover {
background-color: var(--color-gray-100);
}
Expand Down
2 changes: 1 addition & 1 deletion translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ hypertable:
records_selected: '{count, plural, =0 {{count} record is selected} =1 {{count} record is selected} other {{count} records are selected}}'
all_records_selected: All records (<b>{count}</b>) are selected
select_all: '{count, plural, =1 {Select all {count} record} other {Select all {count} records}}'
clear: Clear selection
clear: Clear selection

0 comments on commit bab25a3

Please sign in to comment.