Migrate hooks and notification actions to typescript (#28858)

* Migrate hooks and notification actions to typescript

* Remove missing files

* Fix hook types

* Fix tests
Этот коммит содержится в:
Daniel Espino García
2024-10-28 17:07:11 +01:00
коммит произвёл GitHub
родитель f9bd093649
Коммит dd519629be
20 изменённых файлов: 586 добавлений и 430 удалений

Просмотреть файл

@@ -14,6 +14,9 @@ exports[`plugins/Pluggable should match snapshot with extended component 1`] = `
"FilesWillUploadHook": Array [],
"LinkTooltip": Array [],
"MainMenu": Array [],
"MessageWillBePosted": Array [],
"MessageWillBeUpdated": Array [],
"MessageWillFormat": Array [],
"MobileChannelHeaderButton": Array [],
"NeedsTeamComponent": Array [],
"NewMessagesSeparatorAction": Array [],
@@ -29,6 +32,7 @@ exports[`plugins/Pluggable should match snapshot with extended component 1`] = `
"PostEditorAction": Array [],
"Product": Array [],
"RightHandSidebarComponent": Array [],
"SlashCommandWillBePosted": Array [],
"UserGuideDropdownItem": Array [],
}
}
@@ -148,6 +152,9 @@ exports[`plugins/Pluggable should match snapshot with extended component with pl
"FilesWillUploadHook": Array [],
"LinkTooltip": Array [],
"MainMenu": Array [],
"MessageWillBePosted": Array [],
"MessageWillBeUpdated": Array [],
"MessageWillFormat": Array [],
"MobileChannelHeaderButton": Array [],
"NeedsTeamComponent": Array [],
"NewMessagesSeparatorAction": Array [],
@@ -163,6 +170,7 @@ exports[`plugins/Pluggable should match snapshot with extended component with pl
"PostEditorAction": Array [],
"Product": Array [],
"RightHandSidebarComponent": Array [],
"SlashCommandWillBePosted": Array [],
"UserGuideDropdownItem": Array [],
}
}
@@ -282,6 +290,9 @@ exports[`plugins/Pluggable should match snapshot with no extended component 1`]
"FilesWillUploadHook": Array [],
"LinkTooltip": Array [],
"MainMenu": Array [],
"MessageWillBePosted": Array [],
"MessageWillBeUpdated": Array [],
"MessageWillFormat": Array [],
"MobileChannelHeaderButton": Array [],
"NeedsTeamComponent": Array [],
"NewMessagesSeparatorAction": Array [],
@@ -290,6 +301,7 @@ exports[`plugins/Pluggable should match snapshot with no extended component 1`]
"PostEditorAction": Array [],
"Product": Array [],
"RightHandSidebarComponent": Array [],
"SlashCommandWillBePosted": Array [],
"UserGuideDropdownItem": Array [],
}
}
@@ -341,6 +353,9 @@ exports[`plugins/Pluggable should match snapshot with non-null pluggableId 1`] =
"FilesWillUploadHook": Array [],
"LinkTooltip": Array [],
"MainMenu": Array [],
"MessageWillBePosted": Array [],
"MessageWillBeUpdated": Array [],
"MessageWillFormat": Array [],
"MobileChannelHeaderButton": Array [],
"NeedsTeamComponent": Array [],
"NewMessagesSeparatorAction": Array [],
@@ -356,6 +371,7 @@ exports[`plugins/Pluggable should match snapshot with non-null pluggableId 1`] =
"PostEditorAction": Array [],
"Product": Array [],
"RightHandSidebarComponent": Array [],
"SlashCommandWillBePosted": Array [],
"UserGuideDropdownItem": Array [],
}
}
@@ -408,6 +424,9 @@ exports[`plugins/Pluggable should match snapshot with null pluggableId 1`] = `
"FilesWillUploadHook": Array [],
"LinkTooltip": Array [],
"MainMenu": Array [],
"MessageWillBePosted": Array [],
"MessageWillBeUpdated": Array [],
"MessageWillFormat": Array [],
"MobileChannelHeaderButton": Array [],
"NeedsTeamComponent": Array [],
"NewMessagesSeparatorAction": Array [],
@@ -423,6 +442,7 @@ exports[`plugins/Pluggable should match snapshot with null pluggableId 1`] = `
"PostEditorAction": Array [],
"Product": Array [],
"RightHandSidebarComponent": Array [],
"SlashCommandWillBePosted": Array [],
"UserGuideDropdownItem": Array [],
}
}
@@ -542,6 +562,9 @@ exports[`plugins/Pluggable should match snapshot with valid pluggableId 1`] = `
"FilesWillUploadHook": Array [],
"LinkTooltip": Array [],
"MainMenu": Array [],
"MessageWillBePosted": Array [],
"MessageWillBeUpdated": Array [],
"MessageWillFormat": Array [],
"MobileChannelHeaderButton": Array [],
"NeedsTeamComponent": Array [],
"NewMessagesSeparatorAction": Array [],
@@ -557,6 +580,7 @@ exports[`plugins/Pluggable should match snapshot with valid pluggableId 1`] = `
"PostEditorAction": Array [],
"Product": Array [],
"RightHandSidebarComponent": Array [],
"SlashCommandWillBePosted": Array [],
"UserGuideDropdownItem": Array [],
}
}

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {ComponentProps} from 'react';
import React from 'react';
import {Preferences} from 'mattermost-redux/constants';
@@ -18,7 +19,7 @@ class ProfilePopoverPlugin extends React.PureComponent {
jest.mock('actions/views/profile_popover');
describe('plugins/Pluggable', () => {
const baseProps = {
const baseProps: ComponentProps<typeof Pluggable> = {
pluggableName: '',
components: {
Product: [],
@@ -40,6 +41,10 @@ describe('plugins/Pluggable', () => {
NeedsTeamComponent: [],
CreateBoardFromTemplate: [],
DesktopNotificationHooks: [],
MessageWillBePosted: [],
MessageWillBeUpdated: [],
MessageWillFormat: [],
SlashCommandWillBePosted: [],
},
theme: Preferences.THEMES.denim,
};