[web] Migrate group management to React (#11293)

* Rename manage group entry point

* Migrate group management root page to React

* Add cypress tests for the group management react page

* Fix linting

* Add checkbox labels for screen-readers + remove unused classes

* Await on add/remove members calls

* Display the export CSV link for a full group

* Display error message when group is full

* Sort locales

* Handle the managers management page in React version

* Fix missing type in GroupMemberRow

* Split members and managers React pages

* Build API paths on frontend side + add cypress tests for each page

* Fix linting

* Update unit tests

* Review improvements

* Type API errors

GitOrigin-RevId: d124a9d24cbf33de8aacc5d69e9d46e7bcda93c5
This commit is contained in:
Alexandre Bourdin
2023-02-07 09:04:18 +00:00
committed by Copybot
parent b1cf4aa1e9
commit ed40a87cdc
29 changed files with 1678 additions and 45 deletions
@@ -96,7 +96,7 @@ describe('UserMembershipController', function () {
})
it('get users', async function () {
return await this.UserMembershipController.index(this.req, {
return await this.UserMembershipController.manageGroupMembers(this.req, {
render: () => {
sinon.assert.calledWithMatch(
this.UserMembershipHandler.getUsers,
@@ -108,7 +108,7 @@ describe('UserMembershipController', function () {
})
it('render group view', async function () {
return await this.UserMembershipController.index(this.req, {
return await this.UserMembershipController.manageGroupMembers(this.req, {
render: (viewPath, viewParams) => {
expect(viewPath).to.equal('user_membership/index')
expect(viewParams.users).to.deep.equal(this.users)
@@ -123,7 +123,7 @@ describe('UserMembershipController', function () {
it('render group managers view', async function () {
this.req.entityConfig = EntityConfigs.groupManagers
return await this.UserMembershipController.index(this.req, {
return await this.UserMembershipController.manageGroupManagers(this.req, {
render: (viewPath, viewParams) => {
expect(viewPath).to.equal('user_membership/index')
expect(viewParams.groupSize).to.equal(undefined)
@@ -139,15 +139,20 @@ describe('UserMembershipController', function () {
it('render institution view', async function () {
this.req.entity = this.institution
this.req.entityConfig = EntityConfigs.institution
return await this.UserMembershipController.index(this.req, {
render: (viewPath, viewParams) => {
expect(viewPath).to.equal('user_membership/index')
expect(viewParams.name).to.equal('Test Institution Name')
expect(viewParams.groupSize).to.equal(undefined)
expect(viewParams.translations.title).to.equal('institution_account')
expect(viewParams.paths.exportMembers).to.be.undefined
},
})
return await this.UserMembershipController.manageInstitutionManagers(
this.req,
{
render: (viewPath, viewParams) => {
expect(viewPath).to.equal('user_membership/index')
expect(viewParams.name).to.equal('Test Institution Name')
expect(viewParams.groupSize).to.equal(undefined)
expect(viewParams.translations.title).to.equal(
'institution_account'
)
expect(viewParams.paths.exportMembers).to.be.undefined
},
}
)
})
})