Merge branch 'master' of github.com:sharelatex/web-sharelatex

This commit is contained in:
Shane Kilkelly 2016-03-22 14:38:56 +00:00
commit d566ce3fd2
4 changed files with 13 additions and 6 deletions

View file

@ -85,7 +85,7 @@ module.exports = SubscriptionController =
LimitationsManager.userHasSubscriptionOrIsGroupMember user, (err, hasSubOrIsGroupMember, subscription)->
groupLicenceInviteUrl = SubscriptionDomainHandler.getDomainLicencePage(user)
if subscription?.customAccount
logger.log user: user, "redirecting to plans"
logger.log user: user, "redirecting to custom account page"
res.redirect "/user/subscription/custom_account"
else if groupLicenceInviteUrl? and !hasSubOrIsGroupMember
logger.log user:user, "redirecting to group subscription invite page"
@ -111,6 +111,10 @@ module.exports = SubscriptionController =
userCustomSubscriptionPage: (req, res, next)->
AuthenticationController.getLoggedInUser req, (error, user) ->
LimitationsManager.userHasSubscriptionOrIsGroupMember user, (err, hasSubOrIsGroupMember, subscription)->
if !subscription?
err = new Error("subscription null for custom account, user:#{user?._id}")
logger.warn err:err, "subscription is null for custom accounts page"
return next(err)
res.render "subscriptions/custom_account",
title: "your_subscription"
subscription: subscription

View file

@ -75,7 +75,8 @@ aside#file-tree(ng-controller="FileTreeController", ng-class="{ 'multi-selected'
li(
ng-class="{ 'selected': entity.selected }",
ng-repeat="entity in deletedDocs | orderBy:'name'",
ng-controller="FileTreeEntityController"
ng-controller="FileTreeEntityController",
ng-show="ui.view == 'track-changes'"
)
.entity
.entity-name(

View file

@ -22,9 +22,9 @@ define [
ticketNumber = Math.floor((1 + Math.random()) * 0x10000).toString(32)
params =
email: $scope.form.email
message: $scope.form.message
message: $scope.form.message or ""
subject: $scope.form.subject + " - [#{ticketNumber}]"
about : $scope.form.project_url
about : $scope.form.project_url or ""
labels: "support"
Groove.createTicket params, (err, json)->

View file

@ -68,7 +68,9 @@ describe "SubscriptionController sanboxed", ->
"./LimitationsManager": @LimitationsManager
"../../infrastructure/GeoIpLookup":@GeoIpLookup
'./RecurlyWrapper': @RecurlyWrapper
"logger-sharelatex": log:->
"logger-sharelatex":
log:->
warn:->
"settings-sharelatex": @settings
"./SubscriptionDomainHandler":@SubscriptionDomainHandler
@ -273,7 +275,7 @@ describe "SubscriptionController sanboxed", ->
describe "userCustomSubscriptionPage", ->
beforeEach (done) ->
@res.callback = done
@LimitationsManager.userHasSubscriptionOrIsGroupMember.callsArgWith(1, null, true)
@LimitationsManager.userHasSubscriptionOrIsGroupMember.callsArgWith(1, null, true, {})
@SubscriptionController.userCustomSubscriptionPage @req, @res
it "should render the page", (done)->