Merge pull request #1099 from sharelatex/ta-management-ui-title

Management UI Wording Tweaks

GitOrigin-RevId: 9e1a8990f226e1fda423f6fa6efa25cf3b924544
This commit is contained in:
Chrystal Maria Griffiths 2018-11-13 10:32:51 +00:00 committed by sharelatex
parent 6ea0b9cf46
commit afbeec3b02
4 changed files with 21 additions and 8 deletions

View file

@ -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

View file

@ -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"

View file

@ -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").

View file

@ -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()