Add missing text to buttons on the party / guild invite modal - Fixes #8391 (#8402)

* Fix missing text in party / guild invite modal

* add tests and abstract logic

* use translation lib for test
This commit is contained in:
ean
2017-01-19 13:17:38 -06:00
committed by Keith Holliday
parent ffa561473c
commit 74c9a1b02d
5 changed files with 55 additions and 38 deletions

View File

@@ -220,19 +220,25 @@ angular.module('habitrpg')
function inviteOrStartParty (group) {
Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Invite Friends'});
if (group && group.type === "party" || $location.$$path === "/options/groups/party") {
group.type = 'party';
$rootScope.openModal('invite-party', {
controller:'InviteToGroupCtrl',
resolve: {
injectedGroup: function(){ return group; }
}
});
} else {
$location.path("/options/groups/party");
var sendInviteText = window.env.t('sendInvitations');
if (group.type !== 'party' && group.type !== 'guild') {
$location.path("/options/groups/party");
return console.log('Invalid group type.')
}
if(group.purchased && group.purchased.plan && group.purchased.plan.customerId) sendInviteText += window.env.t('groupAdditionalUserCost');
group.sendInviteText = sendInviteText;
$rootScope.openModal('invite-' + group.type, {
controller:'InviteToGroupCtrl',
resolve: {
injectedGroup: function() {
return group;
},
},
});
}
return {