Skip to content

Commit de6e6d3

Browse files
authored
Merge pull request #1665 from CodeNow/SAN-4733-trial-expired
SAN-4733 Trial Expired State
2 parents 332752d + 834f5f1 commit de6e6d3

17 files changed

Lines changed: 320 additions & 158 deletions

File tree

client/config/routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ module.exports = [
7575
state: 'paused',
7676
abstract: false,
7777
url: '^/paws’d',
78-
templateUrl: 'gracePeriodModalView',
79-
controller: 'GracePeriodController',
80-
controllerAs: 'GPC',
78+
templateUrl: 'pausedSandboxView',
79+
controller: 'WelcomeBackController',
80+
controllerAs: 'WBC',
8181
resolve: {
8282
user: function (fetchUser) {
8383
return fetchUser();

client/controllers/controllerApp.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function ControllerApp(
2727
orgs,
2828
activeAccount
2929
) {
30-
// Load ace after 5 seconds. Should improve user experience overall..
30+
// Load ace after 10 seconds. Should improve user experience overall..
3131
$timeout(function () {
3232
$ocLazyLoad.load('ui.ace');
3333
}, 10000);
@@ -119,6 +119,25 @@ function ControllerApp(
119119
}
120120
};
121121

122+
if ($rootScope.featureFlags.billing && (activeAccount.isInGrace() || activeAccount.isGraceExpired())) {
123+
// Determine if it's a trial end or just a normal payment due
124+
if (activeAccount.attrs.hasPaymentMethod) {
125+
ModalService.showModal({
126+
controller: 'ExpiredAccountController',
127+
controllerAs: 'EAC',
128+
templateUrl: 'paymentDueView',
129+
preventClose: true
130+
});
131+
} else {
132+
ModalService.showModal({
133+
controller: 'ExpiredAccountController',
134+
controllerAs: 'EAC',
135+
templateUrl: 'trialEndView',
136+
preventClose: true
137+
});
138+
}
139+
}
140+
122141
$rootScope.canEditFeatureFlags = function () {
123142
return !!dataApp.data.allAccounts.find(function (account) {
124143
return account.oauthName() === 'CodeNow';

client/directives/accountsSelect/popoverAccountMenu/viewPopoverAccountMenu.jade

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@
188188
type = "checkbox"
189189
)
190190
.toggle-group.toggle-xs
191-
button.btn.btn-xs.gray(
192-
internal-modal-helper = "gracePeriodModalView"
193-
ng-if = "flag === 'gracePeriod'"
194-
style = "position: absolute; right: 9px; top: 6px;"
195-
) Go
196191
button.btn.btn-xs.gray(
197192
internal-modal-helper = "billingWallModalView"
198193
ng-if = "flag === 'billingWall'"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
require('app')
4+
.controller('ExpiredAccountController', ExpiredAccountController);
5+
6+
function ExpiredAccountController(
7+
close,
8+
$rootScope,
9+
$scope
10+
) {
11+
var EAC = this;
12+
EAC.close = close;
13+
14+
EAC.activeAccount = $rootScope.dataApp.data.activeAccount;
15+
16+
EAC.actions = {
17+
close: function () {
18+
// Intentionally left blank, this prevents the modal from being closed
19+
},
20+
save: function () {
21+
$scope.$broadcast('go-to-panel', 'confirmationForm');
22+
}
23+
};
24+
}
Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
h1.h1.text-center.padding-sm Welcome back!
2-
img.grid-block.img.runnabear(
3-
height = "130"
4-
src = "/build/images/runnabear-waving-3.png"
5-
width = "230"
6-
)
7-
.modal-dialog.modal-welcome
8-
section.modal-body
9-
p.p.padding-xs We’ve temporarily 
10-
span(
11-
title = "paws’d"
12-
) paused 
13-
| your containers due to inactivity. Give us the go ahead and we’ll get you back up and running.
14-
footer.grid-block.vertical.modal-footer
15-
button.grid-content.btn.btn-md.green.icons-intercom(
16-
ng-click = "WBC.openIntercom()"
17-
) Chat Now
18-
a.grid-content.link.text-gray.text-center(
19-
href = "mailto:support@runnable.com?subject=I’m back! Please get my sandbox back up and running."
20-
) Email Support
21-
.grid-block.justify-center.modal-outer-footer(
22-
ng-if = "$root.featureFlags.gracePeriodFooter"
23-
ng-include = "'gracePeriodFooterView'"
24-
)
1+
.modal-backdrop
2+
.grace-period
3+
h1.h1.text-center.padding-sm Welcome back!
4+
img.grid-block.img.runnabear(
5+
height = "130"
6+
src = "/build/images/runnabear-waving-3.png"
7+
width = "230"
8+
)
9+
.modal-dialog.modal-welcome
10+
section.modal-body
11+
p.p.padding-xs We’ve temporarily 
12+
span(
13+
title = "paws’d"
14+
) paused 
15+
| your containers due to inactivity. Give us the go ahead and we’ll get you back up and running.
16+
footer.grid-block.vertical.modal-footer
17+
button.grid-content.btn.btn-md.green.icons-intercom(
18+
ng-click = "WBC.openIntercom()"
19+
) Chat Now
20+
a.grid-content.link.text-gray.text-center(
21+
href = "mailto:support@runnable.com?subject=I’m back! Please get my sandbox back up and running."
22+
) Email Support
23+
.grid-block.justify-center.modal-outer-footer(
24+
grace-period-footer
25+
close = "WBC.close"
26+
)
Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
h1.h1.text-center.padding-sm Uh oh.
2-
.modal-dialog.modal-md
3-
.modal-body
4-
.modal-form.form-billing
5-
animated-panel-container
6-
animated-panel(
7-
default = "true"
8-
name = "changePaymentForm"
9-
)
10-
.grid-block.vertical.padding-md
11-
p.grid-content.p.text-center Your payment method has {{cardExpired ? 'expired' : 'been declined' }}. Update your payment method to continue using Runnable.
12-
small.grid-content.small.text-center.text-gray
13-
strong.strong Note: 
14-
//- number of hours should vary to show how much time is left
15-
| Your containers will be paused in 72 hours if we cannot process a payment method.
16-
hr.hr
17-
.grid-block.vertical.form-payment.fade(
18-
ng-class = "{'in': isActivePanel()}"
19-
ng-include = "'changePaymentForm'"
20-
ng-init = "state.fromPaymentDue = true"
21-
)
22-
animated-panel(
23-
name = "confirmationForm"
24-
)
25-
.grid-block.vertical.fade(
26-
ng-class = "{'in': isActivePanel()}"
27-
ng-include = "'confirmationForm'"
28-
ng-init = "state.fromPaymentDue = true"
29-
)
30-
.grid-block.justify-center.modal-outer-footer(
31-
ng-if = "$root.featureFlags.gracePeriodFooter"
32-
ng-include = "'gracePeriodFooterView'"
33-
)
1+
.modal-backdrop.modal-blackout
2+
.grace-period
3+
h1.h1.text-center.padding-sm Uh oh.
4+
.modal-dialog.modal-md
5+
.modal-body
6+
.modal-form.form-billing
7+
animated-panel-container
8+
animated-panel(
9+
name = "changePaymentForm"
10+
default = "true"
11+
)
12+
.grid-block.vertical.padding-md
13+
p.grid-content.p.text-center Your payment method has failed. Update your payment method to continue using Runnable.
14+
small.grid-content.small.text-center.text-gray(
15+
ng-if = "EAC.activeAccount.isInGrace()"
16+
)
17+
strong.strong Note: 
18+
| Your containers will be paused in {{EAC.activeAccount.graceHoursRemaining()}} hours if we cannot process a payment method.
19+
hr.hr
20+
.grid-block.vertical.form-payment.fade(
21+
ng-class = "{'in': isActivePanel()}"
22+
change-payment-form
23+
save = "EAC.actions.save"
24+
updating = "true"
25+
)
26+
animated-panel(
27+
name = "confirmationForm"
28+
)
29+
.grid-block.vertical.fade(
30+
ng-class = "{'in': isActivePanel()}"
31+
ng-include = "'confirmationForm'"
32+
)
33+
.grid-block.justify-center.modal-outer-footer(
34+
grace-period-footer
35+
close = "EAC.close"
36+
)
Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1-
h1.h1.text-center.padding-sm Thanks for trying Runnable!
2-
.modal-dialog.modal-md
3-
.modal-body
4-
.modal-form.form-billing
5-
animated-panel-container
6-
animated-panel(
7-
default = "true"
8-
name = "changePaymentForm"
9-
)
10-
.grid-block.vertical.padding-md
11-
p.grid-content.p.text-center Your trial has ended! We hope you enjoyed using Runnable. Please enter your payment info to continue. Otherwise, 
12-
a.link(
13-
href = "mailto:support@runnable.com"
14-
) let us know how we can improve
15-
| .
16-
small.grid-content.small.text-center.text-gray
17-
strong.strong Note: 
18-
//- number of hours should vary to show how much time is left
19-
| Your containers will be paused in 72 hours if we cannot process a payment method.
20-
hr.hr
21-
.grid-block.vertical.form-payment.fade(
22-
ng-class = "{'in': isActivePanel()}"
23-
ng-include = "'changePaymentForm'"
24-
ng-init = "state.fromPaymentDue = true"
25-
)
26-
animated-panel(
27-
name = "confirmationForm"
28-
)
29-
.grid-block.vertical.fade(
30-
ng-class = "{'in': isActivePanel()}"
31-
ng-include = "'confirmationForm'"
32-
ng-init = "\
33-
state.fromPaymentDue = true;\
34-
state.hasPaid = true;\
35-
"
36-
)
37-
.grid-block.justify-center.modal-outer-footer(
38-
ng-if = "$root.featureFlags.gracePeriodFooter"
39-
ng-include = "'gracePeriodFooterView'"
40-
)
1+
.modal-backdrop.modal-blackout
2+
.grace-period
3+
h1.h1.text-center.padding-sm Thanks for trying Runnable!
4+
.modal-dialog.modal-md
5+
.modal-body
6+
.modal-form.form-billing
7+
animated-panel-container
8+
animated-panel(
9+
default = "true"
10+
name = "changePaymentForm"
11+
)
12+
.grid-block.vertical.padding-md
13+
p.grid-content.p.text-center Your trial has ended! We hope you enjoyed using Runnable. Please enter your payment info to continue. Otherwise, 
14+
a.link(
15+
href = "mailto:support@runnable.com"
16+
) let us know how we can improve
17+
| .
18+
small.grid-content.small.text-center.text-gray
19+
strong.strong Note: 
20+
| Your containers will be paused in {{EAC.activeAccount.graceHoursRemaining()}} hours if we cannot process a payment method.
21+
hr.hr
22+
.grid-block.vertical.form-payment.fade(
23+
ng-class = "{'in': isActivePanel()}"
24+
change-payment-form
25+
save = "EAC.actions.save"
26+
updating = "false"
27+
)
28+
animated-panel(
29+
name = "confirmationForm"
30+
)
31+
.grid-block.vertical.fade(
32+
ng-class = "{'in': isActivePanel()}"
33+
ng-include = "'confirmationForm'"
34+
)
35+
.grid-block.justify-center.modal-outer-footer(
36+
grace-period-footer
37+
close = "WBC.close"
38+
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
require('app').directive('gracePeriodFooter', gracePeriodFooter);
4+
5+
function gracePeriodFooter(
6+
$rootScope,
7+
promisify,
8+
errs
9+
) {
10+
return {
11+
restrict: 'A',
12+
templateUrl: 'gracePeriodFooterView',
13+
scope: {
14+
close: '=?',
15+
hideChooseOrg: '=?'
16+
},
17+
link: function ($scope) {
18+
$scope.logout = function () {
19+
promisify($rootScope.dataApp.data.user, 'logout')().then(function () {
20+
window.location = '/';
21+
}).catch(errs.handler);
22+
};
23+
24+
$scope.goToOrgSelect = function () {
25+
$scope.close();
26+
window.location = '/orgSelect';
27+
};
28+
}
29+
};
30+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
a.grid-content.shrink.text-gray.small.link(
2+
ng-if = "!hideChooseOrg"
3+
ng-click = "goToOrgSelect()"
4+
) Change Organization
5+
a.grid-content.shrink.text-gray.small.link(
6+
ng-click = "logout()"
7+
) Sign Out

client/directives/modals/gracePeriodModal/gracePeriodFooterView.jade

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)