mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Home: Fix single entry did not save correctly
This commit is contained in:
parent
fd253b10f5
commit
4f40ef01da
@ -474,13 +474,22 @@ export class Et2Portlet extends Et2Widget(SlCard)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep settings, but remove any properties, no need to pass those on
|
||||||
|
let settings = {};
|
||||||
|
Object.keys(this.settings || {}).forEach(k =>
|
||||||
|
{
|
||||||
|
if(typeof k == "string" && isNaN(parseInt(k)) || typeof this.settings[k].name == "undefined" && typeof this.settings[k].type == "undefined")
|
||||||
|
{
|
||||||
|
settings[k] = this.settings[k];
|
||||||
|
}
|
||||||
|
});
|
||||||
// Pass updated settings, unless we're removing
|
// Pass updated settings, unless we're removing
|
||||||
this.update_settings({...this.settings, ...value});
|
this.update_settings({...settings, ...value});
|
||||||
|
|
||||||
// Extend, not replace, because settings has types while value has just value
|
// Extend, not replace, because settings has types while value has just value
|
||||||
if(typeof value == 'object')
|
if(typeof value == 'object')
|
||||||
{
|
{
|
||||||
this.settings = {...this.settings, value};
|
this.settings = {...settings, ...value};
|
||||||
}
|
}
|
||||||
this.requestUpdate();
|
this.requestUpdate();
|
||||||
}
|
}
|
||||||
@ -500,7 +509,7 @@ export class Et2Portlet extends Et2Widget(SlCard)
|
|||||||
{
|
{
|
||||||
this[p.name] = settings[p.name];
|
this[p.name] = settings[p.name];
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
// Save settings - server might reply with new content if the portlet needs an update,
|
// Save settings - server might reply with new content if the portlet needs an update,
|
||||||
// but ideally it doesn't
|
// but ideally it doesn't
|
||||||
|
@ -2,6 +2,7 @@ import {Et2Portlet} from "../../api/js/etemplate/Et2Portlet/Et2Portlet";
|
|||||||
import shoelace from "../../api/js/etemplate/Styles/shoelace";
|
import shoelace from "../../api/js/etemplate/Styles/shoelace";
|
||||||
import {css} from "@lion/core";
|
import {css} from "@lion/core";
|
||||||
import {SelectOption} from "../../api/js/etemplate/Et2Select/FindSelectOptions";
|
import {SelectOption} from "../../api/js/etemplate/Et2Select/FindSelectOptions";
|
||||||
|
import {Et2Dialog} from "../../api/js/etemplate/Et2Dialog/Et2Dialog";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Home portlet to show a list of entries
|
* Home portlet to show a list of entries
|
||||||
@ -29,6 +30,16 @@ export class Et2PortletLink extends Et2Portlet
|
|||||||
{name: "entry", type: "et2-link-entry", label: "Entry"}
|
{name: "entry", type: "et2-link-entry", label: "Entry"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_process_edit(button_id, value)
|
||||||
|
{
|
||||||
|
if(button_id == Et2Dialog.OK_BUTTON && value.entry && value.entry != this.settings.entry)
|
||||||
|
{
|
||||||
|
// Update title with new app immediately
|
||||||
|
this.title = this.egw().lang(value.entry.app);
|
||||||
|
}
|
||||||
|
super._process_edit(button_id, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!customElements.get("et2-portlet-link"))
|
if(!customElements.get("et2-portlet-link"))
|
||||||
|
Loading…
Reference in New Issue
Block a user