From afbeec3b021649ccea12712805929480207ac783 Mon Sep 17 00:00:00 2001 From: Chrystal Maria Griffiths Date: Tue, 13 Nov 2018 10:32:51 +0000 Subject: [PATCH] Merge pull request #1099 from sharelatex/ta-management-ui-title Management UI Wording Tweaks GitOrigin-RevId: 9e1a8990f226e1fda423f6fa6efa25cf3b924544 --- .../UserMembership/UserMembershipController.coffee | 2 ++ .../UserMembershipEntityConfigs.coffee | 9 +++++++-- services/web/app/views/user_membership/index.pug | 13 +++++++++---- .../UserMembershipControllerTests.coffee | 5 +++-- 4 files changed, 21 insertions(+), 8 deletions(-) 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()