From baccaa0f3258ef11c36c025cd998fe958537a087 Mon Sep 17 00:00:00 2001 From: wandji20 Date: Fri, 1 Mar 2024 15:38:54 +0100 Subject: [PATCH] Fix various issues with label templates [SCI-10335] --- app/javascript/vue/label_template/table.vue | 13 +++++-------- config/locales/en.yml | 1 + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/javascript/vue/label_template/table.vue b/app/javascript/vue/label_template/table.vue index 8a78d6567..e39071a45 100644 --- a/app/javascript/vue/label_template/table.vue +++ b/app/javascript/vue/label_template/table.vue @@ -59,12 +59,9 @@ export default { columnDefs: [ { field: 'default', - headerName: '', - width: 80, - minWidth: 80, + headerName: this.i18n.t('label_templates.index.default_label'), cellRenderer: this.defaultRenderer, sortable: true, - headerComponentParams: { html: '' }, }, { field: 'name', headerName: this.i18n.t('label_templates.index.thead_name'), @@ -74,6 +71,7 @@ export default { field: 'format', headerName: this.i18n.t('label_templates.index.format'), sortable: true, + cellRenderer: ({ data: { format, icon_url: iconUrl } }) => `${iconUrl} ${format}` }, { field: 'description', headerName: this.i18n.t('label_templates.index.description'), @@ -114,11 +112,11 @@ export default { if (this.syncFluicsUrl) { left.push({ name: 'sync_fluics', - icon: 'fas fa-sync', + icon: 'sn-icon sn-icon-refresh', label: this.i18n.t('label_templates.index.toolbar.update_fluics_labels'), type: 'emit', path: this.syncFluicsUrl, - buttonStyle: 'btn btn-light', + buttonStyle: 'btn btn-light' }); } return { @@ -131,13 +129,12 @@ export default { labelNameRenderer(params) { const editUrl = params.data.urls.show; return ` - ${params.data.icon_url} ${params.data.name} `; }, defaultRenderer(params) { const defaultSelected = params.data.default; - return defaultSelected ? '' : ''; + return defaultSelected ? '' : ''; }, setDefault(action) { axios.post(action.path).then((response) => { diff --git a/config/locales/en.yml b/config/locales/en.yml index 1d2d0d052..e07f10256 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -985,6 +985,7 @@ en: logo_params_error: 'Failed to parse logo parameters!' index: head_title: 'Label templates' + default_label: "Default label" search_templates: 'Search labels' thead_name: 'Label name' format: 'Format'