mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
fix(editor): can not clear embed card alias description (#12794)
Close [BS-3600](https://linear.app/affine-design/issue/BS-3600/card-view下,编辑alias清空保存无效,无法实现清空) Close [BS-3599](https://linear.app/affine-design/issue/BS-3599/page-和canvas-mode下的note,对文本中的-embed-view-doc,隐藏掉-edit-按钮,避免误导,card) #### PR Dependency Tree * **PR #12794** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - The edit option has been removed from the toolbar for embedded synced documents. - **Bug Fixes** - The description field is now always included when editing embedded cards, even if left empty. - **Tests** - Removed tests related to editing and view switching of linked document embeds. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -24,10 +24,7 @@ import {
|
||||
} from '@blocksuite/affine/blocks/embed-doc';
|
||||
import { SurfaceRefBlockComponent } from '@blocksuite/affine/blocks/surface-ref';
|
||||
import { toggleEmbedCardEditModal } from '@blocksuite/affine/components/embed-card-modal';
|
||||
import {
|
||||
notifyLinkedDocClearedAliases,
|
||||
notifyLinkedDocSwitchedToCard,
|
||||
} from '@blocksuite/affine/components/notification';
|
||||
import { notifyLinkedDocClearedAliases } from '@blocksuite/affine/components/notification';
|
||||
import { isPeekable, peek } from '@blocksuite/affine/components/peek';
|
||||
import { toast } from '@blocksuite/affine/components/toast';
|
||||
import {
|
||||
@@ -862,44 +859,6 @@ const embedSyncedDocToolbarConfig = {
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'edit',
|
||||
tooltip: 'Edit',
|
||||
icon: EditIcon(),
|
||||
run(ctx) {
|
||||
const block = ctx.getCurrentBlockByType(
|
||||
EmbedSyncedDocBlockComponent
|
||||
);
|
||||
if (!block) return;
|
||||
|
||||
ctx.hide();
|
||||
|
||||
const model = block.model;
|
||||
const doc = ctx.workspace.getDoc(model.props.pageId);
|
||||
const abortController = new AbortController();
|
||||
abortController.signal.onabort = () => ctx.show();
|
||||
|
||||
toggleEmbedCardEditModal(
|
||||
ctx.host,
|
||||
model,
|
||||
'embed',
|
||||
doc ? { title: doc.meta?.title } : undefined,
|
||||
undefined,
|
||||
(std, _component, props) => {
|
||||
block.convertToCard(props);
|
||||
|
||||
notifyLinkedDocSwitchedToCard(std);
|
||||
},
|
||||
abortController
|
||||
);
|
||||
|
||||
ctx.track('OpenedAliasPopup', {
|
||||
category: 'linked doc',
|
||||
type: 'embed view',
|
||||
control: 'edit',
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user