diff --git a/services/web/app/coffee/Features/UserMembership/UserMembershipController.coffee b/services/web/app/coffee/Features/UserMembership/UserMembershipController.coffee index 3276552c1f..a1add2139f 100644 --- a/services/web/app/coffee/Features/UserMembership/UserMembershipController.coffee +++ b/services/web/app/coffee/Features/UserMembership/UserMembershipController.coffee @@ -11,7 +11,9 @@ module.exports = UserMembershipHandler.getUsers entity, entityConfig, (error, users)-> return next(error) if error? entityPrimaryKey = entity[entityConfig.fields.primaryKey].toString() + entityName = entity[entityConfig.fields.name] if entityConfig.fields.name res.render "user_membership/index", + name: entityName users: users groupSize: entity.membersLimit if entityConfig.hasMembersLimit translations: entityConfig.translations diff --git a/services/web/app/coffee/Features/UserMembership/UserMembershipEntityConfigs.coffee b/services/web/app/coffee/Features/UserMembership/UserMembershipEntityConfigs.coffee index fb843fa4d9..e0e670f571 100644 --- a/services/web/app/coffee/Features/UserMembership/UserMembershipEntityConfigs.coffee +++ b/services/web/app/coffee/Features/UserMembership/UserMembershipEntityConfigs.coffee @@ -8,10 +8,12 @@ module.exports = read: ['invited_emails', 'teamInvites', 'member_ids'] write: null access: 'manager_ids' + name: 'teamName' baseQuery: groupPlan: true translations: title: 'group_account' + subtitle: 'members_management' remove: 'remove_from_group' pathsFor: (id) -> addMember: "/manage/groups/#{id}/invites" @@ -34,10 +36,12 @@ module.exports = read: ['manager_ids'] write: 'manager_ids' access: 'manager_ids' + name: 'teamName' baseQuery: groupPlan: true translations: - title: 'group_managers' + title: 'group_account' + subtitle: 'managers_management' remove: 'remove_manager' pathsFor: (id) -> addMember: "/manage/groups/#{id}/managers" @@ -51,7 +55,8 @@ module.exports = write: 'managerIds' access: 'managerIds' translations: - title: 'institution_managers' + title: 'institution_account' + subtitle: 'managers_management' remove: 'remove_manager' pathsFor: (id) -> addMember: "/manage/institutions/#{id}/managers" diff --git a/services/web/app/views/user_membership/index.pug b/services/web/app/views/user_membership/index.pug index 11d59ae0dd..e41da9264e 100644 --- a/services/web/app/views/user_membership/index.pug +++ b/services/web/app/views/user_membership/index.pug @@ -5,6 +5,7 @@ block content .container .row .col-md-10.col-md-offset-1 + h1 #{name || translate(translations.title)} .card(ng-controller="UserMembershipController") .page-header .pull-right(ng-cloak) @@ -14,7 +15,7 @@ block content ng-show="selectedUsers.length > 0" ng-click="removeMembers()" ) #{translate(translations.remove)} - h1 #{translate(translations.title)} + h3 #{translate(translations.subtitle)} .row-spaced-small div(ng-if="inputs.removeMembers.error", ng-cloak) @@ -83,16 +84,20 @@ block content placeholder="jane@example.com, joe@example.com", ng-model="inputs.addMembers.content", on-enter="addMembers()" + aria-describedby="add-members-description" ) .col-xs-4 button.btn.btn-primary(ng-click="addMembers()") #{translate("add")} .col-xs-2(ng-if="paths.exportMembers", ng-cloak) - a(href=paths.exportMembers) Export CSV - + a(href=paths.exportMembers) #{translate('export_csv')} + .row + .col-xs-8 + span.help-block #{translate('add_comma_separated_emails_help')} + div(ng-if="groupSize && users.length >= groupSize && users.length > 0", ng-cloak) .row .col-xs-2.col-xs-offset-10(ng-if="paths.exportMembers", ng-cloak) - a(href=paths.exportMembers) Export CSV + a(href=paths.exportMembers) #{translate('export_csv')} script(type="text/javascript"). diff --git a/services/web/test/unit/coffee/UserMembership/UserMembershipControllerTests.coffee b/services/web/test/unit/coffee/UserMembership/UserMembershipControllerTests.coffee index 886101936c..34339211d2 100644 --- a/services/web/test/unit/coffee/UserMembership/UserMembershipControllerTests.coffee +++ b/services/web/test/unit/coffee/UserMembership/UserMembershipControllerTests.coffee @@ -69,7 +69,8 @@ describe "UserMembershipController", -> @UserMembershipController.index @req, render: (viewPath, viewParams) => expect(viewPath).to.equal 'user_membership/index' expect(viewParams.groupSize).to.equal undefined - expect(viewParams.translations.title).to.equal 'group_managers' + expect(viewParams.translations.title).to.equal 'group_account' + expect(viewParams.translations.subtitle).to.equal 'managers_management' expect(viewParams.paths.exportMembers).to.be.undefined done() @@ -79,7 +80,7 @@ describe "UserMembershipController", -> @UserMembershipController.index @req, render: (viewPath, viewParams) => expect(viewPath).to.equal 'user_membership/index' expect(viewParams.groupSize).to.equal undefined - expect(viewParams.translations.title).to.equal 'institution_managers' + expect(viewParams.translations.title).to.equal 'institution_account' expect(viewParams.paths.exportMembers).to.be.undefined done()