From 0301caa8812eed7a52d27014192d51ae64ae850e Mon Sep 17 00:00:00 2001 From: Owen Coogan Date: Mon, 30 Dec 2024 17:48:22 +0100 Subject: [PATCH 1/6] fix: added locked state on list cell renderer --- addon/components/hyper-table/cell-renderers/list.hbs | 11 ++++++++++- addon/components/hyper-table/cell-renderers/list.js | 1 + translations/en-us.yaml | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/addon/components/hyper-table/cell-renderers/list.hbs b/addon/components/hyper-table/cell-renderers/list.hbs index 0d89366e..380f7279 100644 --- a/addon/components/hyper-table/cell-renderers/list.hbs +++ b/addon/components/hyper-table/cell-renderers/list.hbs @@ -10,10 +10,19 @@
{{#each this.value as |item|}}
+ {{log @column.key}} {{item.name}} + {{#if this.locked}} + + {{/if}}
{{/each}}
diff --git a/addon/components/hyper-table/cell-renderers/list.js b/addon/components/hyper-table/cell-renderers/list.js index 170f9403..5c88bf80 100644 --- a/addon/components/hyper-table/cell-renderers/list.js +++ b/addon/components/hyper-table/cell-renderers/list.js @@ -8,6 +8,7 @@ export default Component.extend(CellRendererMixin, { }), isEditing: false, + locked: this.column.locked ?? false, formattedList: computed('value', 'value.firstObject.name', function () { if (this.value.firstObject.name) { diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 1ae5e5bb..f479809a 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -86,3 +86,10 @@ hypertable: all_records_selected: All records ({count}) are selected select_all: '{count, plural, =1 {Select all {count} record} other {Select all {count} records}}' clear: Clear selection + cell_renderers: + no_permission: + mailings: You don't have permission to access this mailing + lists: You don't have permission to access this list + campaigns: You don't have permission to access this campaign + tracking_plans: You don't have permission to access this tracking plan + acquisition_campaigns: You don't have permission to access this live capture campaign From 54a6a4a080aea052559c7d38745819b4fad1474a Mon Sep 17 00:00:00 2001 From: Owen Coogan Date: Mon, 30 Dec 2024 18:05:36 +0100 Subject: [PATCH 2/6] fix: added small fixes --- addon/components/hyper-table/cell-renderers/list.hbs | 1 - addon/components/hyper-table/cell-renderers/list.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addon/components/hyper-table/cell-renderers/list.hbs b/addon/components/hyper-table/cell-renderers/list.hbs index 380f7279..422b88e3 100644 --- a/addon/components/hyper-table/cell-renderers/list.hbs +++ b/addon/components/hyper-table/cell-renderers/list.hbs @@ -13,7 +13,6 @@ class="expandable-list__item fx-row fx-xalign-center fx-gap-px-6" {{on "click" (action "goToUrl" (concat this.url item.id) bubbles=false)}} > - {{log @column.key}} {{item.name}} {{#if this.locked}} Date: Mon, 6 Jan 2025 14:57:09 +0100 Subject: [PATCH 3/6] fix: added fixes post review --- addon/components/hyper-table/cell-renderers/list.hbs | 2 +- addon/components/hyper-table/cell-renderers/list.js | 5 ++++- translations/en-us.yaml | 9 +-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/addon/components/hyper-table/cell-renderers/list.hbs b/addon/components/hyper-table/cell-renderers/list.hbs index 422b88e3..f881d459 100644 --- a/addon/components/hyper-table/cell-renderers/list.hbs +++ b/addon/components/hyper-table/cell-renderers/list.hbs @@ -19,7 +19,7 @@ @icon="far fa-lock" @size="xs" @skin="secondary" - {{enable-tooltip title=(t (concat "hypertable.cell_renderers.no_permission." @column.key))}} + {{enable-tooltip title=this.lockedTooltipLabel}} /> {{/if}} diff --git a/addon/components/hyper-table/cell-renderers/list.js b/addon/components/hyper-table/cell-renderers/list.js index 42f8cd65..d6921494 100644 --- a/addon/components/hyper-table/cell-renderers/list.js +++ b/addon/components/hyper-table/cell-renderers/list.js @@ -8,7 +8,10 @@ export default Component.extend(CellRendererMixin, { }), isEditing: false, - locked: this?.column?.locked ?? false, + + locked: computed('column.locked', function () { + return this.column?.locked ?? true; + }), formattedList: computed('value', 'value.firstObject.name', function () { if (this.value.firstObject.name) { diff --git a/translations/en-us.yaml b/translations/en-us.yaml index f479809a..6e90992e 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -85,11 +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 ({count}) are selected select_all: '{count, plural, =1 {Select all {count} record} other {Select all {count} records}}' - clear: Clear selection - cell_renderers: - no_permission: - mailings: You don't have permission to access this mailing - lists: You don't have permission to access this list - campaigns: You don't have permission to access this campaign - tracking_plans: You don't have permission to access this tracking plan - acquisition_campaigns: You don't have permission to access this live capture campaign + clear: Clear selection \ No newline at end of file From 522bc03244bd3c2aa2335468a867d2aa90e734e5 Mon Sep 17 00:00:00 2001 From: Owen Coogan Date: Mon, 6 Jan 2025 15:08:58 +0100 Subject: [PATCH 4/6] fix: fixed test typo --- addon/components/hyper-table/cell-renderers/list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/components/hyper-table/cell-renderers/list.js b/addon/components/hyper-table/cell-renderers/list.js index d6921494..5c348976 100644 --- a/addon/components/hyper-table/cell-renderers/list.js +++ b/addon/components/hyper-table/cell-renderers/list.js @@ -10,7 +10,7 @@ export default Component.extend(CellRendererMixin, { isEditing: false, locked: computed('column.locked', function () { - return this.column?.locked ?? true; + return this.column?.locked ?? false; }), formattedList: computed('value', 'value.firstObject.name', function () { From 47416a4f3712ca205d0dd2dc94845f076a955b7d Mon Sep 17 00:00:00 2001 From: Owen Coogan Date: Thu, 9 Jan 2025 11:39:30 +0100 Subject: [PATCH 5/6] fix: fixed typo --- addon/components/hyper-table/cell-renderers/list.hbs | 2 +- addon/components/hyper-table/cell-renderers/list.js | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/addon/components/hyper-table/cell-renderers/list.hbs b/addon/components/hyper-table/cell-renderers/list.hbs index f881d459..43d03e3f 100644 --- a/addon/components/hyper-table/cell-renderers/list.hbs +++ b/addon/components/hyper-table/cell-renderers/list.hbs @@ -14,7 +14,7 @@ {{on "click" (action "goToUrl" (concat this.url item.id) bubbles=false)}} > {{item.name}} - {{#if this.locked}} + {{#if item.locked}} '); From da91af92079e7285706d987538d6f280eec07325 Mon Sep 17 00:00:00 2001 From: Owen Coogan Date: Thu, 9 Jan 2025 15:25:45 +0100 Subject: [PATCH 6/6] fix: added ux fixes --- addon/components/hyper-table/cell-renderers/list.hbs | 5 +++-- addon/components/hyper-table/cell-renderers/list.js | 4 ++-- app/styles/cells.less | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addon/components/hyper-table/cell-renderers/list.hbs b/addon/components/hyper-table/cell-renderers/list.hbs index 43d03e3f..8fbd44f1 100644 --- a/addon/components/hyper-table/cell-renderers/list.hbs +++ b/addon/components/hyper-table/cell-renderers/list.hbs @@ -10,8 +10,9 @@
{{#each this.value as |item|}}
{{item.name}} {{#if item.locked}} diff --git a/addon/components/hyper-table/cell-renderers/list.js b/addon/components/hyper-table/cell-renderers/list.js index 170f9403..5e2badbb 100644 --- a/addon/components/hyper-table/cell-renderers/list.js +++ b/addon/components/hyper-table/cell-renderers/list.js @@ -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; diff --git a/app/styles/cells.less b/app/styles/cells.less index 8926667e..ae707f39 100644 --- a/app/styles/cells.less +++ b/app/styles/cells.less @@ -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); }