diff --git a/dist/img/icon/relation/description.svg b/dist/img/icon/relation/description.svg new file mode 100644 index 0000000000..29162b52f3 --- /dev/null +++ b/dist/img/icon/relation/description.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ts/component/menu/block/layout.tsx b/src/ts/component/menu/block/layout.tsx index f444aabfb3..3cfb057841 100644 --- a/src/ts/component/menu/block/layout.tsx +++ b/src/ts/component/menu/block/layout.tsx @@ -70,7 +70,6 @@ class MenuBlockLayout extends React.Component { const { param } = this.props; const { data } = param; const { rootId } = data; - const allowedLayout = S.Block.checkFlags(rootId, rootId, [ I.RestrictionObject.Layout ]); const allowedDetails = S.Block.checkFlags(rootId, rootId, [ I.RestrictionObject.Details ]); const object = S.Detail.get(rootId, rootId, [ 'layoutAlign' ]); @@ -84,17 +83,7 @@ class MenuBlockLayout extends React.Component { resize = null; }; - let sections = []; - if (allowedLayout) { - sections.push({ name: translate('menuBlockLayoutChooseLayoutType'), children: U.Menu.turnLayouts() }); - }; - - sections.push({ - children: [ - resize, - align, - ] - }); + let sections = [ { children: [ resize, align ] } ]; sections = sections.filter((section: any) => { section.children = section.children.filter(it => it); @@ -178,10 +167,7 @@ class MenuBlockLayout extends React.Component { }; onClick (e: any, item: any) { - const { param, close } = this.props; - const { data } = param; - const { rootId, onLayoutSelect } = data; - const object = S.Detail.get(rootId, rootId, []); + const { close } = this.props; if (item.arrow) { return; @@ -193,14 +179,6 @@ class MenuBlockLayout extends React.Component { this.onResize(e); analytics.event('SetLayoutWidth'); - } else { - U.Object.setLayout(rootId, item.id, (message: any) => { - if (onLayoutSelect) { - onLayoutSelect(item.id); - }; - }); - - analytics.event('ChangeLayout', { objectType: object.type, layout: item.id }); }; }; diff --git a/src/ts/component/menu/dataview/relation/list.tsx b/src/ts/component/menu/dataview/relation/list.tsx index 71f810b29f..24b036d3c1 100644 --- a/src/ts/component/menu/dataview/relation/list.tsx +++ b/src/ts/component/menu/dataview/relation/list.tsx @@ -4,8 +4,8 @@ import { observer } from 'mobx-react'; import arrayMove from 'array-move'; import { AutoSizer, CellMeasurer, InfiniteLoader, List as VList, CellMeasurerCache } from 'react-virtualized'; import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc'; -import { Icon, Switch } from 'Component'; -import { I, C, S, J, Relation, keyboard, Dataview, translate } from 'Lib'; +import { Icon, IconObject, Switch } from 'Component'; +import { I, C, S, J, keyboard, Dataview, translate } from 'Lib'; const HEIGHT = 28; const LIMIT = 20; @@ -62,7 +62,7 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component > {!isReadonly ? : ''} this.onClick(e, item)}> - +
{item.relation.name}
{canHide ? ( diff --git a/src/ts/component/util/iconObject.tsx b/src/ts/component/util/iconObject.tsx index 7f5fc0ba2e..639870aae5 100644 --- a/src/ts/component/util/iconObject.tsx +++ b/src/ts/component/util/iconObject.tsx @@ -135,7 +135,7 @@ const IconObject = observer(class IconObject extends React.Component { const { theme } = S.Common; const object = this.getObject(); const layout = Number(object.layout) || I.ObjectLayout.Page; - const { id, name, iconEmoji, iconImage, iconOption, iconClass, done, relationFormat, isDeleted } = object || {}; + const { id, name, iconEmoji, iconImage, iconOption, iconClass, done, relationFormat, relationKey, isDeleted } = object || {}; const cn = [ 'iconObject', 'c' + size, U.Data.layoutClass(object.id, layout) ]; const iconSize = this.iconSize(); const tc = S.Common.getThemeClass(); @@ -239,8 +239,15 @@ const IconObject = observer(class IconObject extends React.Component { break; }; + let src = ''; + if (relationKey == 'description') { + src = 'description'; + } else { + src = Relation.typeName(relationFormat); + }; + icn = icn.concat([ 'iconCommon', 'c' + iconSize ]); - icon = ; + icon = ; break; };