Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(docs): remove settings menu icons (#7556)
Univer49e11a67c3bc
diff --git a/packages/docs-ui/src/menu/__tests__/context-menu.spec.ts b/packages/docs-ui/src/menu/__tests__/context-menu.spec.tsnew file mode 100644index 0000000000..16eb1469f2--- /dev/null+++ b/packages/docs-ui/src/menu/__tests__/context-menu.spec.ts@@ -0,0 +1,45 @@+/**+ * Copyright 2023-present DreamNum Co., Ltd.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import { Injector, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';+import { DocSelectionManagerService } from '@univerjs/docs';+import { of } from 'rxjs';+import { describe, expect, it } from 'vitest';+import { ParagraphSettingMenuFactory, SectionSettingMenuFactory } from '../context-menu';++describe('settings context menu factories', () => {+ it('does not show leading icons', () => {+ const accessor = new Injector([+ [DocSelectionManagerService, {+ useValue: {+ textSelection$: of(null),+ getActiveTextRange: () => null,+ },+ }],+ [IUniverInstanceService, {+ useValue: {+ focused$: of('doc-1'),+ getUnitType: () => UniverInstanceType.UNIVER_DOC,+ },+ }],+ ]);++ expect(ParagraphSettingMenuFactory(accessor).icon).toBeUndefined();+ expect(SectionSettingMenuFactory(accessor).icon).toBeUndefined();++ accessor.dispose();+ });+});diff --git a/packages/docs-ui/src/menu/context-menu.ts b/packages/docs-ui/src/menu/context-menu.tsindex cd9257b865..0869005514 100644--- a/packages/docs-ui/src/menu/context-menu.ts+++ b/packages/docs-ui/src/menu/context-menu.ts@@ -129,7 +129,6 @@ export function ParagraphSettingMenuFactory(accessor: IAccessor): IMenuButtonItereturn {id: DocParagraphSettingPanelOperation.id,type: MenuItemType.BUTTON,- icon: 'MenuIcon',title: 'docs-ui.doc.menu.paragraphSetting',hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),};@@ -207,7 +206,6 @@ export function SectionSettingMenuFactory(accessor: IAccessor): IMenuButtonItem<return {id: DocSectionSettingPanelOperation.id,type: MenuItemType.BUTTON,- icon: 'MenuIcon',title: 'docs-ui.doc.menu.sectionSetting',hidden$: combineLatest(getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),