2023-03-16 20:39:01 +01:00
|
|
|
import {Et2Portlet} from "../../api/js/etemplate/Et2Portlet/Et2Portlet";
|
|
|
|
import shoelace from "../../api/js/etemplate/Styles/shoelace";
|
2024-05-07 22:46:44 +02:00
|
|
|
import {css} from "lit";
|
2023-03-16 20:39:01 +01:00
|
|
|
import {SelectOption} from "../../api/js/etemplate/Et2Select/FindSelectOptions";
|
2023-03-17 17:27:27 +01:00
|
|
|
import {Et2Dialog} from "../../api/js/etemplate/Et2Dialog/Et2Dialog";
|
2023-03-16 20:39:01 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Home portlet to show a list of entries
|
|
|
|
*/
|
|
|
|
export class Et2PortletLink extends Et2Portlet
|
|
|
|
{
|
|
|
|
static get styles()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
...shoelace,
|
|
|
|
...(super.styles || []),
|
|
|
|
css`
|
|
|
|
`
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a list of user-configurable properties
|
|
|
|
* @returns {[{name : string, type : string, select_options? : [SelectOption]}]}
|
|
|
|
*/
|
|
|
|
get portletProperties() : { name : string, type : string, label : string, select_options? : SelectOption[] }[]
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
...super.portletProperties,
|
|
|
|
{name: "entry", type: "et2-link-entry", label: "Entry"}
|
|
|
|
]
|
|
|
|
}
|
2023-03-17 17:27:27 +01:00
|
|
|
|
|
|
|
_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);
|
|
|
|
}
|
2023-03-16 20:39:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!customElements.get("et2-portlet-link"))
|
|
|
|
{
|
|
|
|
customElements.define("et2-portlet-link", Et2PortletLink);
|
|
|
|
}
|