mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-07 21:47:02 +09:00
JS-6487: fix
This commit is contained in:
parent
dfb3c1996d
commit
d90e19bad0
2 changed files with 7 additions and 5 deletions
|
@ -34,7 +34,6 @@ const MenuBlockRelationEdit = observer(class MenuBlockRelationEdit extends React
|
|||
|
||||
const relation = this.getRelation();
|
||||
const root = S.Block.getLeaf(rootId, rootId);
|
||||
const isDate = this.format == I.RelationType.Date;
|
||||
const isObject = this.format == I.RelationType.Object;
|
||||
const isReadonly = this.isReadonly();
|
||||
|
||||
|
@ -59,8 +58,11 @@ const MenuBlockRelationEdit = observer(class MenuBlockRelationEdit extends React
|
|||
canDuplicate = canDelete = false;
|
||||
};
|
||||
};
|
||||
if (relation && Relation.isSystemWithoutUser(relation.relationKey)) {
|
||||
canDelete = false;
|
||||
|
||||
if (relation) {
|
||||
const allowedDelete = relation ? S.Block.isAllowed(relation.restrictions, [ I.RestrictionObject.Delete ]) : false;
|
||||
|
||||
canDelete = allowedDelete && Relation.isSystemWithoutUser(relation.relationKey);
|
||||
};
|
||||
|
||||
switch (ref) {
|
||||
|
@ -155,7 +157,7 @@ const MenuBlockRelationEdit = observer(class MenuBlockRelationEdit extends React
|
|||
<div className="section">
|
||||
<MenuItemVertical icon="expand" name={translate('commonOpenObject')} onClick={this.onOpen} onMouseEnter={this.menuClose} />
|
||||
{canDuplicate ? <MenuItemVertical icon="copy" name={translate('commonDuplicate')} onClick={this.onCopy} onMouseEnter={this.menuClose} /> : ''}
|
||||
{canDelete && unlinkText && !noUnlink ? <MenuItemVertical icon="unlink" name={unlinkText} onClick={this.onUnlink} onMouseEnter={this.menuClose} /> : ''}
|
||||
{unlinkText && !noUnlink ? <MenuItemVertical icon="unlink" name={unlinkText} onClick={this.onUnlink} onMouseEnter={this.menuClose} /> : ''}
|
||||
{canDelete ? <MenuItemVertical icon="remove" name={translate('commonDelete')} onClick={this.onRemove} onMouseEnter={this.menuClose} /> : ''}
|
||||
</div>
|
||||
) : ''}
|
||||
|
|
|
@ -68,7 +68,7 @@ const SidebarSectionTypeRelation = observer(forwardRef<I.SidebarSectionRef, I.Si
|
|||
|
||||
const onAdd = (e: any, id: string) => {
|
||||
const list = lists.find(it => it.id == id);
|
||||
const keys = lists.reduce((acc, it) => acc.concat(it.data.map(it => it.relationKey)), []);
|
||||
const keys = lists.reduce((acc, it) => acc.concat(it.data.map(it => it.relationKey)), []).concat('description');
|
||||
const ids = list.data.map(it => it.id);
|
||||
|
||||
S.Menu.open('relationSuggest', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue