Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
d00f69709c
commit
ac832ac717
|
|
@ -675,23 +675,22 @@ export default {
|
|||
table_settings: agreement_table_settings,
|
||||
add_filters: true,
|
||||
filters_options: {
|
||||
2: [
|
||||
vendor_id: [
|
||||
...vendors.value.map(e => {
|
||||
e["_id"] = e["id"];
|
||||
e["_str"] = e["name"];
|
||||
return e;
|
||||
}),
|
||||
],
|
||||
4: () => baseResource.map_av_dt_filter("av_agreement_statuses"),
|
||||
5: () =>
|
||||
baseResource.map_av_dt_filter(
|
||||
"av_agreement_closure_reasons"
|
||||
),
|
||||
6: [
|
||||
status: baseResource.map_av_dt_filter("av_agreement_statuses"),
|
||||
closure_reason: baseResource.map_av_dt_filter(
|
||||
"av_agreement_closure_reasons"
|
||||
),
|
||||
is_perpetual: [
|
||||
{ _id: 0, _str: $__("No") },
|
||||
{ _id: 1, _str: $__("Yes") },
|
||||
],
|
||||
7: () =>
|
||||
renewal_priority: () =>
|
||||
baseResource.map_av_dt_filter(
|
||||
"av_agreement_renewal_priorities"
|
||||
),
|
||||
|
|
|
|||
|
|
@ -154,7 +154,8 @@ export default {
|
|||
],
|
||||
},
|
||||
filters_options: {
|
||||
1: () => map_av_dt_filter("av_title_publication_types"),
|
||||
publication_type: () =>
|
||||
map_av_dt_filter("av_title_publication_types"),
|
||||
},
|
||||
actions: { 0: ["show"] },
|
||||
default_filters: {
|
||||
|
|
|
|||
|
|
@ -186,7 +186,8 @@ export default {
|
|||
],
|
||||
},
|
||||
filters_options: {
|
||||
1: () => map_av_dt_filter("av_title_publication_types"),
|
||||
publication_type: () =>
|
||||
map_av_dt_filter("av_title_publication_types"),
|
||||
},
|
||||
actions: { 0: ["show"] },
|
||||
default_filters: {
|
||||
|
|
|
|||
|
|
@ -196,15 +196,16 @@ export default {
|
|||
table_settings: eholdings_packages_table_settings,
|
||||
add_filters: true,
|
||||
filters_options: {
|
||||
1: [
|
||||
vendor_id: [
|
||||
...vendors.value.map(e => {
|
||||
e["_id"] = e["id"];
|
||||
e["_str"] = e["name"];
|
||||
return e;
|
||||
}),
|
||||
],
|
||||
2: () => baseResource.map_av_dt_filter("av_package_types"),
|
||||
3: () =>
|
||||
package_type: () =>
|
||||
baseResource.map_av_dt_filter("av_package_types"),
|
||||
content_type: () =>
|
||||
baseResource.map_av_dt_filter("av_package_content_types"),
|
||||
},
|
||||
actions: {
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ export default {
|
|||
table_settings: eholdings_titles_table_settings,
|
||||
add_filters: true,
|
||||
filters_options: {
|
||||
3: () =>
|
||||
publication_type: () =>
|
||||
baseResource.map_av_dt_filter("av_title_publication_types"),
|
||||
},
|
||||
actions: {
|
||||
|
|
|
|||
|
|
@ -310,15 +310,16 @@ export default {
|
|||
table_settings: license_table_settings,
|
||||
add_filters: true,
|
||||
filters_options: {
|
||||
2: [
|
||||
vendor_id: [
|
||||
...vendors.value.map(e => {
|
||||
e["_id"] = e["id"];
|
||||
e["_str"] = e["name"];
|
||||
return e;
|
||||
}),
|
||||
],
|
||||
4: () => baseResource.map_av_dt_filter("av_license_types"),
|
||||
5: () => baseResource.map_av_dt_filter("av_license_statuses"),
|
||||
type: () => baseResource.map_av_dt_filter("av_license_types"),
|
||||
status: () =>
|
||||
baseResource.map_av_dt_filter("av_license_statuses"),
|
||||
},
|
||||
actions: {
|
||||
"-1": ["edit", "delete"],
|
||||
|
|
|
|||
|
|
@ -287,9 +287,20 @@ export default {
|
|||
const tableOptionsWithColumns = computed(() => {
|
||||
props.instancedResource.tableOptions.columns = getTableColumns(
|
||||
props.instancedResource.resourceAttrs
|
||||
);
|
||||
).map(col => {
|
||||
const filterOptions =
|
||||
props.instancedResource.tableOptions.filters_options;
|
||||
const filterRequired = Object.keys(filterOptions).includes(
|
||||
col.data
|
||||
);
|
||||
if (filterRequired) {
|
||||
col.dataFilter = col.data;
|
||||
}
|
||||
return col;
|
||||
});
|
||||
return props.instancedResource.tableOptions;
|
||||
});
|
||||
|
||||
const tableEventList = computed(() => {
|
||||
const actionButtons = props.instancedResource.tableOptions.actions[
|
||||
"-1"
|
||||
|
|
|
|||
|
|
@ -627,9 +627,10 @@ export default {
|
|||
add_filters: true,
|
||||
filters_options: {
|
||||
...(baseResource.map_av_dt_filter("av_vendor_types").length && {
|
||||
2: () => baseResource.map_av_dt_filter("av_vendor_types"),
|
||||
type: () =>
|
||||
baseResource.map_av_dt_filter("av_vendor_types"),
|
||||
}),
|
||||
3: [
|
||||
active: [
|
||||
{ _id: 0, _str: $__("Inactive") },
|
||||
{ _id: 1, _str: $__("Active") },
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue