[MM-54296] Admin Reporting for Users, new User Management screen (#26055)

* trial commit

* [MM-56172] Integrate fetching and sorting of user reporting into the table component (#25749)

* inint

* lint

* Update system_users.test.tsx.snap

* cypress test fix

* added pkg

* revoke sessio into new compo

* Update system_users.test.tsx.snap

* trans

* more disable

* rename

* Update system_users_dropdown.test.tsx

* snap

* Delete system_users_list.test.tsx.snap

* Create system_users_list.test.tsx.snap

* Delete system_users_list.test.tsx.snap

* name2

* start removing the filter from the list

* more clean

* snaps

* Update package-lock.json

* des

* Update index.scss

* Update system_users_list.tsx

* Update system_users_list.tsx

* Update system_users.tsx

* Update system_users_list.tsx

* Update index.scss

* menu

* action menu

* split

* Update system_users_list.tsx

* Update system_users_list_new.tsx

* fix

* Update en.json

* temp remove

* Update system_users.test.tsx.snap

* Delete system_users_list.test.tsx.snap

* Update en.json

* ch

* move

* a

* Update en.json

* fix

* Update system_users.test.tsx.snap

* Update menu.tsx

* Update admin_header.tsx

* changes in the file system

* fixes

* integration begin

* lint

* Update rhs.ts

* upper pagination

* Update list_table.scss

* pinned

* more a11y

* Update list_table.scss

* i18n mor

* design changes

* descriptions

* lint

* loading states

* fix

* actions update

* index fix

* single action

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56467] Clear up unused code of old systems users (#25855)

* ccc

* Update en.json

* [MM-56478] Improve the user loading in user details page after changes in users list page in admin console (#25861)

* init

* tem

* more fix

* handlers clear up, team's fixes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* Merge'd

* [MM-56279] Add paging to user list (#25863)

* Update system_users.tsx

* Update system_users.tsx

* [MM-56270] Hook up user actions menu, refactor modals to work with new menuing style (#25897)

* Hookup menu items and modals

* Add error handling, test fixes

* Ensure modals animate properly

* Add a bunch of TODOs around keeping the user data up to date

* Fix i18n and snaps

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56263] Enable selective column hiding for users table (#25898)

* [MM-56539] Revisiting the design of the total users count on the left and in pagination in users table (#25947)

* default sort order

* default sort order (#25956)

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56267] Add search term filtering (#25952)

* Include search term with request

* Update user count with filtering

* Oops

* Add 500ms debounce to avoid spamming server with requests

* PR feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* [MM-56398] Add date range filter to user reporting table (#25974)

* WIP

* Some small adjustments

* Two fixes

* PR feedback

* Remove menuitem

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* Merge'd

* [MM-56615] Add messaging for MySQL instances around the post stats (#26036)

* [MM-56261] Add export modals and hook up button to user management screen (#26015)

* [MM-56576] Update users when actions occur and show errors when actions fail (#25951)

* [MM-56576] Update users when actions occur and show errors when actions fail

* Forgot the else

* PR feedback

* [MM-56617] Move action modals to ConfirmModalRedux

* Add filters popover to the users admin table (#26042)

* int

* 0 zeros

* dd

* re

* file move

* Update system_users_filter_popover.scss

* a

* Update system_users_filter_popover.scss

* role and status

* fix

* Update index.test.ts

* overlay

* Update dropdown_input.tsx

* i

* Update en.json

* done

* Update en.json

* dd

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* Make column toggler column menu items consistent with table column names

* Couple typo fixes

* Fix i18n

* some e2e related changes

* Fixed issue where you couldn't queue multiple batch export jobs

* Fix id tag

* table header mis allignment issue solved

* [MM-56727] Fix a TODO, fix Demote to guest should only appear when enabled

* rev comments

* Stop sending down all profile data

* chore(e2e): Fix tests cases for new user Management ui (#26089)

* chore(e2e): Fix lint issues in cypress tests

* chore(e2e): Fix e2e tests

- user_management_spec
- authentication_method_spec

* [MM-56710] Revert to in-memory compilation of CSV report

* Update system_users.tsx

* Merge'd

* Fix test

---------

Co-authored-by: M-ZubairAhmed <m-zubairahmed@protonmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Этот коммит содержится в:
Devin Binnie
2024-02-07 08:56:59 -05:00
коммит произвёл GitHub
родитель 4f3eba381b
Коммит 03f71c9c84
108 изменённых файлов: 4701 добавлений и 6095 удалений

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

@@ -49,7 +49,7 @@ describe('System Console > User Management > Users', () => {
wait(TIMEOUTS.HALF_SEC);
// # Click on the searched user name
cy.findByText(`@${testUser.username}`).
cy.findByText(`${testUser.username}`).
should('be.visible').
click({force: true});
@@ -67,15 +67,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T932 Users - Change a user\'s password', () => {
// # Search for the user.
cy.get('#searchUsers').type(testUser.email).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(testUser.email).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(3).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type new password and submit.
cy.get('input[type=password]').type('new' + testUser.password);
@@ -99,22 +97,20 @@ describe('System Console > User Management > Users', () => {
it('MM-T933 Users - System admin changes own password - Cancel out of changes', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type current password and a new password.
cy.get('input[type=password]').eq(0).type(otherAdmin.password);
cy.get('input[type=password]').eq(1).type('new' + otherAdmin.password);
// # Click the 'Cancel' button.
cy.get('button[type=button].btn.btn-link').should('contain', 'Cancel').click().wait(TIMEOUTS.HALF_SEC);
cy.get('.modal-footer > .btn-tertiary').should('contain', 'Cancel').click().wait(TIMEOUTS.HALF_SEC);
// # Log out.
cy.apiLogout();
@@ -125,15 +121,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T934 Users - System admin changes own password - Incorrect old password', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type wrong current password and a new password.
cy.get('input[type=password]').eq(0).type('wrong' + otherAdmin.password);
@@ -149,15 +143,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T935 Users - System admin changes own password - Invalid new password', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type current password and a new too short password.
cy.get('input[type=password]').eq(0).type(otherAdmin.password);
@@ -173,15 +165,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T936 Users - System admin changes own password - Blank fields', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Click the 'Reset' button.
cy.get('button[type=submit] span').should('contain', 'Reset').click().wait(TIMEOUTS.HALF_SEC);
@@ -203,15 +193,13 @@ describe('System Console > User Management > Users', () => {
it('MM-T937 Users - System admin changes own password - Successfully changed', () => {
// # Search for the admin.
cy.get('#searchUsers').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
cy.findByPlaceholderText('Search users').type(otherAdmin.username).wait(TIMEOUTS.HALF_SEC);
// # Open the actions menu.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .text-right a').
click().wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Reset Password menu option.
cy.get('[data-testid="userListRow"] .more-modal__right .more-modal__actions .MenuWrapper .MenuWrapperAnimation-enter-done').
find('li').eq(2).click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Reset password').click();
// # Type current and new passwords..
cy.get('input[type=password]').eq(0).type(otherAdmin.password);

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

@@ -52,20 +52,20 @@ describe('User Management', () => {
cy.visit('/admin_console/user_management/users');
cy.get('#searchableUserListTotal').then((el) => {
cy.get('.adminConsoleListTabletOptionalHead > span').then((el) => {
const count1 = el[0].innerText.replace(/\n/g, '').replace(/\s/g, ' ');
// * Can page through several pages of users.
cy.get('#searchableUserListNextBtn').should('be.visible').click();
cy.get('.adminConsoleListTabletOptionalHead > .paginationButtons > [aria-label="Go to next page"]').should('be.visible').click();
// * Count at top changes appropriately.
cy.get('#searchableUserListTotal').then((el2) => {
cy.get('.adminConsoleListTabletOptionalHead > span').then((el2) => {
const count2 = el2[0].innerText.replace(/\n/g, '').replace(/\s/g, ' ');
expect(count1).not.equal(count2);
});
// * Can page backward as well.
cy.get('#searchableUserListPrevBtn').should('be.visible').click();
cy.get('.adminConsoleListTabletOptionalHead > .paginationButtons > [aria-label="Go to previous page"]').should('be.visible').click();
});
});
@@ -103,10 +103,8 @@ describe('User Management', () => {
resetUserEmail(testUser.email, newEmailAddr, '');
// # Updates immediately in Profile for the user.
cy.get('#searchUsers').clear().type(newEmailAddr).wait(TIMEOUTS.HALF_SEC);
cy.get('.more-modal__details').should('be.visible').within(() => {
cy.findByText(newEmailAddr).should('exist');
});
cy.get('#input_searchTerm').clear().type(newEmailAddr).wait(TIMEOUTS.HALF_SEC);
cy.get('#systemUsersTable-cell-0_emailColumn').should('have.text', newEmailAddr);
// * User also receives email confirmation that email address has been changed.
checkResetEmail(testUser, newEmailAddr);
@@ -186,15 +184,21 @@ describe('User Management', () => {
cy.apiUpdateUserAuth(gitlabUser.id, gitlabUser.email, '', 'gitlab');
// # Search for the user.
cy.get('#searchUsers').clear().type(gitlabUser.email).wait(TIMEOUTS.HALF_SEC);
cy.get('#input_searchTerm').clear().type(gitlabUser.email).wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').within(() => {
// # Open the actions menu.
cy.findByText('Member').click().wait(TIMEOUTS.HALF_SEC);
// # Open actions menu.
cy.get('#systemUsersTable-cell-0_actionsColumn').click();
// # Click the Update email menu option.
cy.findByLabelText('User Actions Menu').findByText('Update Email').should('not.exist');
});
// * Verify Switch to Email/Password is visible.
cy.findByText('Switch to Email/Password').should('be.visible').click().wait(TIMEOUTS.HALF_SEC);
// # Set new password.
cy.get('input[type=password]').type('new' + testUser.password);
cy.get('button[type=submit]').should('contain', 'Reset').click().wait(TIMEOUTS.HALF_SEC);
// * Verify Update email option is visible.
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Update email').should('be.visible');
});
});
@@ -222,15 +226,10 @@ describe('User Management', () => {
cy.visit('/admin_console/user_management/users');
// # Search for the user.
cy.get('#searchUsers').clear().type(oldEmail).wait(TIMEOUTS.HALF_SEC);
cy.get('#input_searchTerm').clear().type(oldEmail).wait(TIMEOUTS.HALF_SEC);
cy.findByTestId('userListRow').within(() => {
// # Open the actions menu.
cy.findByText('Member').click().wait(TIMEOUTS.HALF_SEC);
// # Click the Update email menu option.
cy.findByLabelText('User Actions Menu').findByText('Update Email').click().wait(TIMEOUTS.HALF_SEC);
});
cy.get('#systemUsersTable-cell-0_actionsColumn').click().wait(TIMEOUTS.HALF_SEC);
cy.findByText('Update email').click().wait(TIMEOUTS.HALF_SEC);
// # Verify the modal opened.
cy.findByTestId('resetEmailModal').should('exist');