Merge pull request #6620 from papnoisanjeev/active-inactive-filter-meaningful

Showing Active/Inactive in case status filter applied instead of 0/1 also dependent translation (from admin) added into UI package itself.
This commit is contained in:
Jitendra Singh 2022-08-02 10:46:04 +05:30 committed by GitHub
commit 6dc80b8642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 142 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=994a0d7537c0f196b1e0",
"/css/ui.css": "/css/ui.css?id=d5a5781ad0a890301ed3"
"/js/ui.js": "/js/ui.js?id=e341b90409ba0b1cc315",
"/css/ui.css": "/css/ui.css?id=d37fc925848045c24ee5"
}

View File

@ -119,9 +119,9 @@ trait ProvideDataGridPlus
public function getTranslations()
{
return [
'allChannels' => __('admin::app.admin.system.all-channels'),
'allLocales' => __('admin::app.admin.system.all-locales'),
'allCustomerGroups' => __('admin::app.admin.system.all-customer-groups'),
'allChannels' => __('ui::app.datagrid.all-channels'),
'allLocales' => __('ui::app.datagrid.all-locales'),
'allCustomerGroups' => __('ui::app.datagrid.all-customer-groups'),
'search' => __('ui::app.datagrid.search'),
'searchTitle' => __('ui::app.datagrid.search-title'),
'channel' => __('ui::app.datagrid.channel'),
@ -152,11 +152,13 @@ trait ProvideDataGridPlus
'filterExists' => __('ui::app.datagrid.filter-exists'),
'zeroIndex' => __('ui::app.datagrid.zero-index'),
'clickOnAction' => __('ui::app.datagrid.click_on_action'),
'recordsFound' => __('admin::app.admin.system.records-found'),
'recordsFound' => __('ui::app.datagrid.records-found'),
'norecords' => __('ui::app.datagrid.no-records'),
'massActionDelete' => __('ui::app.datagrid.massaction.delete'),
'emptyField' => __('ui::app.datagrid.empty-field'),
'emptyValue' => __('ui::app.datagrid.empty-value'),
'active' => __('ui::app.datagrid.active'),
'inactive' => __('ui::app.datagrid.inactive'),
];
}
}

View File

@ -45,6 +45,7 @@
<div class="filter-advance">
<datagrid-filter-tags
:filters="filters"
:translations="translations"
@onRemoveFilter="removeFilter($event)"
></datagrid-filter-tags>
@ -213,7 +214,7 @@ export default {
this.perPage = this.itemsPerPage;
},
formURL(column, condition, response, label) {
formURL(column, condition, response, label, type) {
let obj = {};
if (
@ -260,6 +261,7 @@ export default {
}
if (filterRepeated === false) {
obj.type = type;
obj.column = column;
obj.cond = condition;
obj.val = response;
@ -359,6 +361,7 @@ export default {
}
}
} else {
obj.type = type;
obj.column = column;
obj.cond = condition;
obj.val = encodeURIComponent(response);
@ -397,7 +400,8 @@ export default {
'search',
'all',
searchValue,
this.translations.searchTitle
this.translations.searchTitle,
'search'
);
},
@ -420,9 +424,9 @@ export default {
},
filterData($event) {
const { column, condition, response, label } = $event.data;
const { type, column, condition, response, label } = $event.data;
this.formURL(column, condition, response, label);
this.formURL(column, condition, response, label, type);
},
removeFilter($event) {

View File

@ -1,11 +1,11 @@
<template>
<span class="filter-tag" style="text-transform: capitalize">
<span class="filter-tag">
<span v-if="filter.column == 'perPage'">perPage</span>
<span v-else>{{ filter.label }}</span>
<span class="wrapper" v-if="filter.prettyValue">
{{ filter.prettyValue }}
{{ filter.prettyValue }}
<span
class="icon cross-icon"
v-on:click="removeFilter(filter)"
@ -13,7 +13,18 @@
</span>
<span class="wrapper" v-else>
{{ decodeURIComponent(filter.val) }}
<span v-if="filter.type == 'boolean'">
{{
filter.val == 1
? translations.active
: translations.inactive
}}
</span>
<span v-else>
{{ decodeURIComponent(filter.val) }}
</span>
<span
class="icon cross-icon"
v-on:click="removeFilter(filter)"
@ -24,7 +35,7 @@
<script>
export default {
props: ['filter'],
props: ['filter', 'translations'],
data() {
return {};

View File

@ -4,6 +4,7 @@
<datagrid-filter-tag
:key="filterKey"
:filter="filter"
:translations="translations"
v-for="(filter, filterKey) in filters"
@onRemoveFilter="removeFilter(filter)"
></datagrid-filter-tag>
@ -15,7 +16,7 @@
import DatagridFilterTag from './datagrid-filter-tag.vue';
export default {
props: ['filters'],
props: ['filters', 'translations'],
components: {
DatagridFilterTag

View File

@ -51,5 +51,11 @@ return [
'edit' => 'تعديل',
'delete' => 'حذف',
'view' => 'رأي',
'active' => 'نشيط',
'inactive' => 'غير نشط',
'all-channels' => 'جميع القنوات',
'all-locales' => 'كل اللغات',
'all-customer-groups' => 'جميع مجموعات العملاء',
'records-found' => 'جميع مجموعات العملاء',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'view' => 'View',
'edit' => 'Bearbeiten',
'delete' => 'Löschen',
'active' => 'Aktiv',
'inactive' => 'Inaktiv',
'all-channels' => 'Alle Kanäle',
'all-locales' => 'Alle Lokalitäten',
'all-customer-groups' => 'Alle Kundengruppen',
'records-found' => 'Datensätze gefunden',
],
];

View File

@ -53,5 +53,11 @@ return [
'view' => 'View',
'empty-field' => 'Please select the filter',
'empty-value' => 'Please enter the value',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Editar',
'delete' => 'Borrar',
'view' => 'Ver',
'active' => 'Activo',
'inactive' => 'Inactivo',
'all-channels' => 'Todos los canales',
'all-locales' => 'Todas las localidades',
'all-customer-groups' => 'Todos los grupos de clientes',
'records-found' => 'Registro(s) encontrado(s)',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'ویرایش کنید',
'delete' => 'حذف',
'view' => 'چشم انداز',
'active' => 'روشن کن',
'inactive' => 'غیر فعال',
'all-channels' => 'همه کانال ها',
'all-locales' => 'همه افراد محلی',
'all-customer-groups' => 'همه گروه های مشتری',
'records-found' => 'رکورد(های) یافت شده',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Modifica',
'delete' => 'Elimina',
'view' => 'Vedi',
'active' => 'accendere',
'inactive' => 'non attivo',
'all-channels' => 'Tutti i canali',
'all-locales' => 'Tutti i locali',
'all-customer-groups' => 'Tutti i gruppi di clienti',
'records-found' => 'Record trovati',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Actief',
'inactive' => 'Inactief',
'all-channels' => 'Alle kanalen',
'all-locales' => 'Alle locaties',
'all-customer-groups' => 'Alle klantgroepen',
'records-found' => 'Record(s) gevonden',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Usuń',
'view' => 'Widok',
'active' => 'Aktywny',
'inactive' => 'Nieaktywny',
'all-channels' => 'Wszystkie kanały',
'all-locales' => 'Wszystkie lokalizacje',
'all-customer-groups' => 'Wszystkie grupy klientów',
'records-found' => 'Znaleziono rekord(y)',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Editar',
'delete' => 'Excluir',
'view' => 'Visão',
'active' => 'Ativo',
'inactive' => 'Inativo',
'all-channels' => 'Todos os canais',
'all-locales' => 'Todos os locais',
'all-customer-groups' => 'Todos os grupos de clientes',
'records-found' => 'Registro(s) encontrado(s)',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Edit',
'delete' => 'Delete',
'view' => 'View',
'active' => 'Active',
'inactive' => 'Inactive',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'records-found' => 'Record(s) found',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => 'Düzenle',
'delete' => 'Sil',
'view' => 'Görüntüle',
'active' => 'Aktif',
'inactive' => 'etkin değil',
'all-channels' => 'Tüm kanallar',
'all-locales' => 'Tüm Yerel Ayarlar',
'all-customer-groups' => 'Tüm Müşteri grupları',
'records-found' => 'Kayıt(lar) bulundu',
],
];

View File

@ -51,5 +51,11 @@ return [
'edit' => '编辑',
'delete' => '删除',
'view' => '查看',
'active' => '積極的',
'inactive' => '不活躍',
'all-channels' => '所有頻道',
'all-locales' => '所有語言環境',
'all-customer-groups' => '所有客戶組',
'records-found' => '找到記錄',
],
];