* Infolog: Fix details / no details filter preference was not saved

This commit is contained in:
nathangray 2021-03-22 09:50:02 -06:00
parent 49d9df43c2
commit b5f45f1e71
2 changed files with 9 additions and 8 deletions

View File

@ -81,7 +81,7 @@ var InfologApp = /** @class */ (function (_super) {
// Show / hide descriptions according to details filter // Show / hide descriptions according to details filter
var nm = this.et2.getWidgetById('nm'); var nm = this.et2.getWidgetById('nm');
var filter2 = nm.getWidgetById('filter2'); var filter2 = nm.getWidgetById('filter2');
this.show_details(filter2.value == 'all', nm.getDOMNode(nm)); this.show_details(filter2.get_value() == 'all', nm.getDOMNode(nm));
// Remove the rule added by show_details() if the template is removed // Remove the rule added by show_details() if the template is removed
jQuery(_et2.DOMContainer).on('clear', jQuery.proxy(function () { egw.css(this); }, '#' + nm.getDOMNode(nm).id + ' .et2_box.infoDes')); jQuery(_et2.DOMContainer).on('clear', jQuery.proxy(function () { egw.css(this); }, '#' + nm.getDOMNode(nm).id + ' .et2_box.infoDes'));
// Enable decrypt on hover // Enable decrypt on hover
@ -334,9 +334,9 @@ var InfologApp = /** @class */ (function (_super) {
// favorites // favorites
if (nm && filter2 && !nm.update_in_progress) { if (nm && filter2 && !nm.update_in_progress) {
// Store selection as implicit preference // Store selection as implicit preference
egw.set_preference('infolog', nm.options.settings.columnselection_pref.replace('-details', '') + '-details-pref', filter2.value); egw.set_preference('infolog', nm.options.settings.columnselection_pref.replace('-details', '') + '-details-pref', filter2.get_value());
// Change preference location - widget is nextmatch // Change preference location - widget is nextmatch
nm.options.settings.columnselection_pref = nm.options.settings.columnselection_pref.replace('-details', '') + (filter2.value == 'all' ? '-details' : ''); nm.options.settings.columnselection_pref = nm.options.settings.columnselection_pref.replace('-details', '') + (filter2.get_value() == 'all' ? '-details' : '');
// Load new preferences // Load new preferences
var colData = nm.columns.slice(); var colData = nm.columns.slice();
for (var i = 0; i < nm.columns.length; i++) for (var i = 0; i < nm.columns.length; i++)

View File

@ -22,6 +22,7 @@ import {et2_dialog} from "../../api/js/etemplate/et2_widget_dialog";
import {etemplate2} from "../../api/js/etemplate/etemplate2"; import {etemplate2} from "../../api/js/etemplate/etemplate2";
import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch"; import {et2_nextmatch} from "../../api/js/etemplate/et2_extension_nextmatch";
import {CRMView} from "../../addressbook/js/CRM"; import {CRMView} from "../../addressbook/js/CRM";
import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
/** /**
* UI for Infolog * UI for Infolog
@ -78,9 +79,9 @@ class InfologApp extends EgwApp
case 'infolog.index': case 'infolog.index':
this.filter_change(); this.filter_change();
// Show / hide descriptions according to details filter // Show / hide descriptions according to details filter
var nm = this.et2.getWidgetById('nm'); var nm = <et2_nextmatch>this.et2.getWidgetById('nm');
var filter2 = nm.getWidgetById('filter2'); var filter2 = <et2_selectbox> nm.getWidgetById('filter2');
this.show_details(filter2.value == 'all',nm.getDOMNode(nm)); this.show_details(filter2.get_value() == 'all',nm.getDOMNode(nm));
// Remove the rule added by show_details() if the template is removed // Remove the rule added by show_details() if the template is removed
jQuery(_et2.DOMContainer).on('clear', jQuery.proxy(function() {egw.css(this);}, '#' + nm.getDOMNode(nm).id + ' .et2_box.infoDes')); jQuery(_et2.DOMContainer).on('clear', jQuery.proxy(function() {egw.css(this);}, '#' + nm.getDOMNode(nm).id + ' .et2_box.infoDes'));
@ -375,10 +376,10 @@ class InfologApp extends EgwApp
if (nm && filter2 && !nm.update_in_progress) if (nm && filter2 && !nm.update_in_progress)
{ {
// Store selection as implicit preference // Store selection as implicit preference
egw.set_preference('infolog', nm.options.settings.columnselection_pref.replace('-details','')+'-details-pref', filter2.value); egw.set_preference('infolog', nm.options.settings.columnselection_pref.replace('-details','')+'-details-pref', filter2.get_value());
// Change preference location - widget is nextmatch // Change preference location - widget is nextmatch
nm.options.settings.columnselection_pref = nm.options.settings.columnselection_pref.replace('-details','') + (filter2.value == 'all' ? '-details' :''); nm.options.settings.columnselection_pref = nm.options.settings.columnselection_pref.replace('-details','') + (filter2.get_value() == 'all' ? '-details' :'');
// Load new preferences // Load new preferences
var colData = nm.columns.slice(); var colData = nm.columns.slice();