[MM-62074] Move tooltips with withTooltip to new Tooltip component (#29528)

* replace inside of comp/withtooltip

* remove overlay trigger eslint rl

* update location of prev migrated new tooltips

* copy button

* shared_channel_indicator, shared_user_indicator.tsx, size_aware_image

* actions_menu, old_admin_settings, schema_admin_settings, admin_settings

* billing_summary, brand_image_setting, edit_section_edit_table_row, elapsed_duration_cell

* permissions_scheme_summary,secure_connections/controls,system_users_column_toggler_menu,system_users_export,group/group_users/users_to_remove_groups

* team_profile,user_grid_role_dropdown,priority_labels,toggle_formatting_bar,use_emoji_picker,formatting_icon

* show_formatting,alert_banner others

* more

* snap fix

* add disabled prop to menu

* test fix for avatar

feat: Add id to WithTooltip in Avatars component to fix test failures

* combine refs in withtooltip

* channel header title favorite test fix

* priority label comp changes

* types check for children

* Update avatar.tsx

* e2e fixes

* fix E2E tests

* Remove memo from WithTooltip

I found that the web app leaks a fair bit less memory when this is removed. See https://community.mattermost.com/core/pl/gwyyoww9gtbg8fddoic9meq84y for more information

* e2e lint fixes

* e2e fixes

* Fix test style issue

---------

Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
M-ZubairAhmed
2024-12-19 03:26:30 +05:30
коммит произвёл GitHub
родитель 371e1b9bad
Коммит fd6a662d76
227 изменённых файлов: 1676 добавлений и 4835 удалений

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

@@ -126,14 +126,16 @@ function testAudioFile(properties) {
cy.get('@filePreviewModal').get('video').should('exist');
}
cy.get('.file-preview-modal__file-name').should('have.text', fileName);
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(fileName);
cy.wrap(downloadLink).parent().should('have.attr', 'download', fileName).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
});
});
// # Close modal

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

@@ -114,12 +114,12 @@ function testGenericFile(properties) {
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(fileName);
cy.wrap(downloadLink).parent().should('have.attr', 'download', fileName).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
});
});
// # Close modal

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

@@ -145,12 +145,12 @@ function testImage(properties) {
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(fileName);
cy.wrap(downloadLink).parent().should('have.attr', 'download', fileName).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
});
});
// # Close modal

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

@@ -126,12 +126,12 @@ export function testVideoFile(properties) {
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(fileName);
cy.wrap(downloadLink).parent().should('have.attr', 'download', fileName).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, fileName, 'attachment');
});
});
// # Close modal

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

@@ -71,8 +71,8 @@ describe('Upload Files', () => {
cy.uiGetFilePreviewModal();
// # Hover over the downlink button and verify that tooltip is shown
cy.uiGetDownloadLinkFilePreviewModal().trigger('mouseover');
cy.uiGetToolTip('Get a public link');
cy.uiGetDownloadLinkFilePreviewModal().trigger('mouseenter');
cy.findByText('Get a public link').should('exist');
// # Copy download link
cy.uiGetDownloadLinkFilePreviewModal().click();
@@ -178,8 +178,8 @@ describe('Upload Files', () => {
cy.uiGetFilePreviewModal();
// # Hover over the downlink button and verify that tooltip is shown
cy.uiGetDownloadLinkFilePreviewModal().trigger('mouseover');
cy.uiGetToolTip('Get a public link');
cy.uiGetDownloadLinkFilePreviewModal().trigger('mouseenter');
cy.findByText('Get a public link').should('exist');
// # Click to copy download link
cy.uiGetDownloadLinkFilePreviewModal().click({force: true});

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

@@ -140,12 +140,12 @@ describe('Upload Files', () => {
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(file.filename);
cy.wrap(downloadLink).parent().should('have.attr', 'download', file.filename).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, file.filename, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, file.filename, 'attachment');
});
});
// # Close the modal
@@ -174,12 +174,12 @@ describe('Upload Files', () => {
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(filename);
cy.wrap(downloadLink).parent().should('have.attr', 'download', filename).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, filename, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, filename, 'attachment');
});
});
// # Close the modal
@@ -405,12 +405,12 @@ describe('Upload Files', () => {
// * Download button should exist
cy.get('@filePreviewModal').uiGetDownloadFilePreviewModal().then((downloadLink) => {
expect(downloadLink.attr('download')).to.equal(filename);
cy.wrap(downloadLink).parent().should('have.attr', 'download', filename).then((link) => {
const fileAttachmentURL = link.attr('href');
const fileAttachmentURL = downloadLink.attr('href');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, filename, 'attachment');
// * Verify that download link has correct name
downloadAttachmentAndVerifyItsProperties(fileAttachmentURL, filename, 'attachment');
});
});
// # Close modal