From 97e357f7724537b6b84acaeba6768590397655cb Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 20 Dec 2018 10:36:03 +0000 Subject: [PATCH] Merge pull request #1260 from sharelatex/ja-remove-deprecated-v1-team-status Remove deprecated display of v1 team data in v2 GitOrigin-RevId: d0198e5ed325ff689f5381a0be05493af35e5f8d --- .../Features/Subscription/SubscriptionController.coffee | 3 --- .../Subscription/SubscriptionViewModelBuilder.coffee | 8 -------- services/web/app/views/subscriptions/dashboard.pug | 3 --- .../views/subscriptions/dashboard/_v1_subscriptions.pug | 8 -------- .../web/test/acceptance/coffee/SubscriptionTests.coffee | 6 ------ .../Subscription/SubscriptionControllerTests.coffee | 2 -- 6 files changed, 30 deletions(-) delete mode 100644 services/web/app/views/subscriptions/dashboard/_v1_subscriptions.pug diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee index c16d8028ec..0f359f80bd 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee @@ -99,7 +99,6 @@ module.exports = SubscriptionController = confirmedMemberInstitutions, managedInstitutions, managedPublishers, - v1Subscriptions, v1SubscriptionStatus } = results logger.log { @@ -110,7 +109,6 @@ module.exports = SubscriptionController = confirmedMemberInstitutions, managedInstitutions, managedPublishers, - v1Subscriptions, v1SubscriptionStatus }, "showing subscription dashboard" plans = SubscriptionViewModelBuilder.buildViewModel() @@ -124,7 +122,6 @@ module.exports = SubscriptionController = confirmedMemberInstitutions, managedInstitutions, managedPublishers, - v1Subscriptions, v1SubscriptionStatus } res.render "subscriptions/dashboard", data diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee index cd5ef9295f..d08cfa5c16 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee @@ -49,11 +49,6 @@ module.exports = InstitutionsGetter.getManagedInstitutions user._id, cb managedPublishers: (cb) -> PublishersGetter.getManagedPublishers user._id, cb - v1Subscriptions: (cb) -> - V1SubscriptionManager.getSubscriptionsFromV1 user._id, (error, subscriptions, v1Id) -> - return cb(error) if error? - # Only return one argument to async.auto, otherwise it returns an array - cb(null, subscriptions) v1SubscriptionStatus: (cb) -> V1SubscriptionManager.getSubscriptionStatusFromV1 user._id, (error, status, v1Id) -> return cb(error) if error? @@ -67,7 +62,6 @@ module.exports = confirmedMemberInstitutions, managedInstitutions, managedPublishers, - v1Subscriptions, v1SubscriptionStatus, recurlySubscription, plan @@ -76,7 +70,6 @@ module.exports = managedGroupSubscriptions ?= [] confirmedMemberInstitutions ?= [] managedInstitutions ?= [] - v1Subscriptions ?= {} v1SubscriptionStatus ?= {} @@ -108,7 +101,6 @@ module.exports = confirmedMemberInstitutions, managedInstitutions, managedPublishers, - v1Subscriptions, v1SubscriptionStatus } diff --git a/services/web/app/views/subscriptions/dashboard.pug b/services/web/app/views/subscriptions/dashboard.pug index 84e36b274a..e3576712f0 100644 --- a/services/web/app/views/subscriptions/dashboard.pug +++ b/services/web/app/views/subscriptions/dashboard.pug @@ -36,9 +36,6 @@ block content -hasAnySubscription = true include ./dashboard/_institution_memberships - -if (settings.overleaf && v1Subscriptions) - include ./dashboard/_v1_subscriptions - -if (v1SubscriptionStatus) include ./dashboard/_v1_subscription_status diff --git a/services/web/app/views/subscriptions/dashboard/_v1_subscriptions.pug b/services/web/app/views/subscriptions/dashboard/_v1_subscriptions.pug deleted file mode 100644 index e543c15960..0000000000 --- a/services/web/app/views/subscriptions/dashboard/_v1_subscriptions.pug +++ /dev/null @@ -1,8 +0,0 @@ -- if (v1Subscriptions.teams && v1Subscriptions.teams.length > 0) - -hasAnySubscription = true - for team in v1Subscriptions.teams - p - | You are a member of the Overleaf v1 team: #{team.name} - p - a.btn.btn-primary(href="/sign_in_to_v1?return_to=/teams") Manage v1 Team Membership - hr \ No newline at end of file diff --git a/services/web/test/acceptance/coffee/SubscriptionTests.coffee b/services/web/test/acceptance/coffee/SubscriptionTests.coffee index a9587cc8c9..8539084536 100644 --- a/services/web/test/acceptance/coffee/SubscriptionTests.coffee +++ b/services/web/test/acceptance/coffee/SubscriptionTests.coffee @@ -26,9 +26,6 @@ describe 'Subscriptions', -> it 'should return no memberGroupSubscriptions', -> expect(@data.memberGroupSubscriptions).to.deep.equal [] - it 'should return no v1Subscriptions', -> - expect(@data.v1Subscriptions).to.deep.equal {} - describe 'when the user has a subscription with recurly', -> before (done) -> MockRecurlyApi.accounts['mock-account-id'] = @accounts = { @@ -299,9 +296,6 @@ describe 'Subscriptions', -> it 'should return no memberGroupSubscriptions', -> expect(@data.memberGroupSubscriptions).to.deep.equal [] - it 'should return a v1Subscriptions', -> - expect(@data.v1Subscriptions).to.deep.equal @subscription - it 'should return a v1SubscriptionStatus', -> expect(@data.v1SubscriptionStatus).to.deep.equal @subscription_status diff --git a/services/web/test/unit/coffee/Subscription/SubscriptionControllerTests.coffee b/services/web/test/unit/coffee/Subscription/SubscriptionControllerTests.coffee index 1131251cfe..b3e5ed1db0 100644 --- a/services/web/test/unit/coffee/Subscription/SubscriptionControllerTests.coffee +++ b/services/web/test/unit/coffee/Subscription/SubscriptionControllerTests.coffee @@ -209,7 +209,6 @@ describe "SubscriptionController", -> @SubscriptionViewModelBuilder.buildUsersSubscriptionViewModel.callsArgWith(1, null, { personalSubscription: @personalSubscription = { 'personal-subscription': 'mock' } memberGroupSubscriptions: @memberGroupSubscriptions = { 'group-subscriptions': 'mock' } - v1Subscriptions: @v1Subscriptions = { 'v1-subscriptions': 'mock' } }) @SubscriptionViewModelBuilder.buildViewModel.returns(@plans = {'plans': 'mock'}) @res.render = (view, @data) => @@ -220,7 +219,6 @@ describe "SubscriptionController", -> it "should load the personal, groups and v1 subscriptions", -> expect(@data.personalSubscription).to.deep.equal @personalSubscription expect(@data.memberGroupSubscriptions).to.deep.equal @memberGroupSubscriptions - expect(@data.v1Subscriptions).to.deep.equal @v1Subscriptions it "should load the user", -> expect(@data.user).to.deep.equal @user