|
|
|
import {WidgetType, Left, Label, Icon, TextButton} from '@ui';
|
|
|
|
import ItemIcon from './left.item.icon.component';
|
|
|
|
import Model from '../../link-set.model';
|
|
|
|
import {ACTION_COPY, ACTION_TEST, ACTION_DELETE, DEFAULT_INFO} from '@private/constants';
|
|
|
|
const className = 'fr.component.linkSet.left.item';
|
|
|
|
const Widget: WidgetType = {
|
|
|
|
props: {
|
|
|
|
title: '',
|
|
|
|
id: '',
|
|
|
|
creator: '',
|
|
|
|
},
|
|
|
|
_store() {
|
|
|
|
return BI.Models.getModel(Model);
|
|
|
|
},
|
|
|
|
render() {
|
|
|
|
const {title, extraCls, creator, text, id} = this.options;
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: Left,
|
|
|
|
cls: 'left-item',
|
|
|
|
extraCls,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: Icon,
|
|
|
|
cls: 'link-font',
|
|
|
|
height: 24,
|
|
|
|
width: 26,
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connections'),
|
|
|
|
title,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: TextButton,
|
|
|
|
cls: 'link-title',
|
|
|
|
textAlign: 'left',
|
|
|
|
text: title,
|
|
|
|
title,
|
|
|
|
handler: () => {
|
|
|
|
this.store.setLinkSelected(title);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Left,
|
|
|
|
cls: 'icons',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'link-text-font',
|
|
|
|
title: BI.i18nText('Dec-Dcm_Test_Connection'),
|
|
|
|
value: ACTION_TEST,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'copy-font',
|
|
|
|
title: BI.i18nText('Dec-Dcm_Copy'),
|
|
|
|
value: ACTION_COPY,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'info-font',
|
|
|
|
title: `${BI.i18nText('Dec-Dcm_Type')}:${text === DEFAULT_INFO ? BI.i18nText('Dec-Dcm_Other') : text} \r\n${BI.i18nText('Dec-Dcm_Creator')}:${creator}`,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: ItemIcon,
|
|
|
|
cls: 'delete-font',
|
|
|
|
title: BI.i18nText('Dec-Dcm_Delete'),
|
|
|
|
value: ACTION_DELETE,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|
|
|
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
|
|
|
|
export default className;
|