From 96f8f6b67255925cd5854f6a734ddcba2f1e0abb Mon Sep 17 00:00:00 2001 From: Tanya Fomina Date: Thu, 25 Apr 2024 23:28:27 +0300 Subject: [PATCH] Remove type: 'default' --- .../modules/toolbar/blockSettings.ts | 2 -- .../popover-item/popover-item.types.ts | 2 +- test/cypress/tests/utils/flipper.cy.ts | 1 - test/cypress/tests/utils/popover.cy.ts | 18 ------------------ 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/components/modules/toolbar/blockSettings.ts b/src/components/modules/toolbar/blockSettings.ts index 39ba327c..79f4d29d 100644 --- a/src/components/modules/toolbar/blockSettings.ts +++ b/src/components/modules/toolbar/blockSettings.ts @@ -219,7 +219,6 @@ export default class BlockSettings extends Module { if (convertToItems.length > 0) { items.push({ - type: 'default', icon: IconReplace, title: I18n.ui(I18nInternalNS.ui.popover, 'Convert to'), children: { @@ -288,7 +287,6 @@ export default class BlockSettings extends Module { } resultItems.push({ - type: 'default', icon: toolboxItem.icon, title: toolboxItem.title, name: toolName, diff --git a/src/components/utils/popover/components/popover-item/popover-item.types.ts b/src/components/utils/popover/components/popover-item/popover-item.types.ts index 15ea856b..e9e7f95c 100644 --- a/src/components/utils/popover/components/popover-item/popover-item.types.ts +++ b/src/components/utils/popover/components/popover-item/popover-item.types.ts @@ -17,7 +17,7 @@ interface PopoverItemDefaultBaseParams { /** * Item type */ - type: 'default'; + type?: 'default'; /** * Displayed text diff --git a/test/cypress/tests/utils/flipper.cy.ts b/test/cypress/tests/utils/flipper.cy.ts index 02b56af7..1a91d81c 100644 --- a/test/cypress/tests/utils/flipper.cy.ts +++ b/test/cypress/tests/utils/flipper.cy.ts @@ -28,7 +28,6 @@ class SomePlugin { */ public static get toolbox(): PopoverItemParams { return { - type: 'default', icon: '₷', title: 'Some tool', // eslint-disable-next-line @typescript-eslint/no-empty-function diff --git a/test/cypress/tests/utils/popover.cy.ts b/test/cypress/tests/utils/popover.cy.ts index cf937c61..0d89f3ba 100644 --- a/test/cypress/tests/utils/popover.cy.ts +++ b/test/cypress/tests/utils/popover.cy.ts @@ -16,7 +16,6 @@ describe('Popover', () => { * (Inside popover null value is set to confirmation property, so, object becomes unavailable otherwise) */ const confirmation: PopoverItemParams = { - type: 'default', icon: confirmActionIcon, title: confirmActionTitle, onActivate: cy.stub(), @@ -24,7 +23,6 @@ describe('Popover', () => { const items: PopoverItemParams[] = [ { - type: 'default', icon: actionIcon, title: actionTitle, name: 'testItem', @@ -73,7 +71,6 @@ describe('Popover', () => { it('should render the items with true isActive property value as active', () => { const items = [ { - type: 'default', icon: 'Icon', title: 'Title', isActive: true, @@ -98,7 +95,6 @@ describe('Popover', () => { it('should not execute item\'s onActivate callback if the item is disabled', () => { const items: PopoverItemParams[] = [ { - type: 'default', icon: 'Icon', title: 'Title', isDisabled: true, @@ -131,7 +127,6 @@ describe('Popover', () => { it('should close once item with closeOnActivate property set to true is activated', () => { const items = [ { - type: 'default', icon: 'Icon', title: 'Title', closeOnActivate: true, @@ -159,7 +154,6 @@ describe('Popover', () => { it('should highlight as active the item with toggle property set to true once activated', () => { const items = [ { - type: 'default', icon: 'Icon', title: 'Title', toggle: true, @@ -184,7 +178,6 @@ describe('Popover', () => { it('should perform radiobutton-like behavior among the items that have toggle property value set to the same string value', () => { const items = [ { - type: 'default', icon: 'Icon 1', title: 'Title 1', toggle: 'group-name', @@ -193,7 +186,6 @@ describe('Popover', () => { onActivate: (): void => {}, }, { - type: 'default', icon: 'Icon 2', title: 'Title 2', toggle: 'group-name', @@ -231,7 +223,6 @@ describe('Popover', () => { it('should toggle item if it is the only item in toggle group', () => { const items = [ { - type: 'default', icon: 'Icon', title: 'Title', toggle: 'key', @@ -279,7 +270,6 @@ describe('Popover', () => { /** Tool data displayed in block tunes popover */ public render(): TunesMenuConfig { return { - type: 'default', icon: 'Icon', title: 'Title', toggle: 'key', @@ -287,7 +277,6 @@ describe('Popover', () => { children: { items: [ { - type: 'default', icon: 'Icon', title: 'Title', name: 'nested-test-item', @@ -357,7 +346,6 @@ describe('Popover', () => { /** Tool data displayed in block tunes popover */ public render(): TunesMenuConfig { return { - type: 'default', icon: 'Icon', title: 'Tune', toggle: 'key', @@ -365,7 +353,6 @@ describe('Popover', () => { children: { items: [ { - type: 'default', icon: 'Icon', title: 'Title', name: 'nested-test-item', @@ -521,7 +508,6 @@ describe('Popover', () => { public render(): TunesMenuConfig { return [ { - type: 'default', onActivate: (): void => {}, icon: 'Icon', title: 'Tune', @@ -585,7 +571,6 @@ describe('Popover', () => { public render(): TunesMenuConfig { return [ { - type: 'default', onActivate: (): void => {}, icon: 'Icon', title: 'Tune 1', @@ -595,7 +580,6 @@ describe('Popover', () => { type: 'separator', }, { - type: 'default', onActivate: (): void => {}, icon: 'Icon', title: 'Tune 2', @@ -674,7 +658,6 @@ describe('Popover', () => { public render(): TunesMenuConfig { return [ { - type: 'default', onActivate: (): void => {}, icon: 'Icon', title: 'Tune 1', @@ -684,7 +667,6 @@ describe('Popover', () => { type: 'separator', }, { - type: 'default', onActivate: (): void => {}, icon: 'Icon', title: 'Tune 2',