Remove type: 'default'

This commit is contained in:
Tanya Fomina 2024-04-25 23:28:27 +03:00
parent ab79deea42
commit 96f8f6b672
4 changed files with 1 additions and 22 deletions

View file

@ -219,7 +219,6 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
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<BlockSettingsNodes> {
}
resultItems.push({
type: 'default',
icon: toolboxItem.icon,
title: toolboxItem.title,
name: toolName,

View file

@ -17,7 +17,7 @@ interface PopoverItemDefaultBaseParams {
/**
* Item type
*/
type: 'default';
type?: 'default';
/**
* Displayed text

View file

@ -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

View file

@ -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',