mno-enterprise-frontend 2.0.9 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/mno_enterprise/angular/app.js.coffee.erb +0 -120
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/maestrano-components.js.coffee +0 -11
- data/app/assets/javascripts/mno_enterprise/application.js +0 -2
- data/app/assets/javascripts/mno_enterprise/lib/xeditable.js +0 -0
- data/app/assets/stylesheets/mno_enterprise/main.less +0 -28
- data/app/views/layouts/mno_enterprise/_application_js.html.haml +0 -4
- data/app/views/layouts/mno_enterprise/_common_cdn_lib_js.html.haml +0 -5
- data/app/views/layouts/mno_enterprise/_header_files.html.haml +0 -3
- data/app/views/layouts/mno_enterprise/application.html.haml +1 -1
- data/app/views/mno_enterprise/provision/_provision_apps.html.haml +7 -8
- data/config/routes.rb +1 -10
- data/lib/mno_enterprise/frontend/engine.rb +12 -0
- data/lib/mno_enterprise/frontend/locales_generator.rb +57 -0
- data/lib/tasks/mnoe_admin_tasks.rake +67 -0
- data/lib/tasks/mnoe_frontend_tasks.rake +138 -0
- data/lib/tasks/mnoe_locales.rake +14 -0
- data/lib/tasks/templates/bower.json +10 -0
- data/spec/controllers/mno_enterprise/auth/confirmations_controller_spec.rb +2 -2
- data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +1 -1
- data/spec/lib/mno_enterprise/locales_generator_spec.rb +14 -0
- data/spec/lib/tasks/mnoe_locales_rake_spec.rb +25 -0
- metadata +35 -145
- data/app/assets/images/mno_enterprise/impac/close-widget-pink.png +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget.png +0 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/maestrano-controllers.js.coffee +0 -4
- data/app/assets/javascripts/mno_enterprise/angular/controllers/modals/modals-ctrl.js.coffee +0 -62
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-account.js.coffee +0 -157
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-app-deletion-request.js.coffee +0 -62
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-apps-list.js.coffee +0 -127
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-components.js.coffee +0 -25
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace-app.js.coffee +0 -77
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace.js.coffee +0 -51
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-menu.js.coffee +0 -174
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/arrears.js.coffee +0 -70
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee +0 -48
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/credit-card.js.coffee +0 -142
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/index.js.coffee +0 -61
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/invoices.js.coffee +0 -42
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/members.js.coffee +0 -280
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/settings.js.coffee +0 -91
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/team-list.js.coffee +0 -179
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/teams.js.coffee +0 -268
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/file-model.js.coffee +0 -33
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-autostop-app.js.coffee +0 -123
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-currency-widget.js.coffee +0 -43
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-current-currency.js.coffee +0 -22
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-editable.js.coffee +0 -68
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-helptext.js.coffee +0 -38
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-match.js.coffee +0 -14
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-message-modal.js.coffee +0 -56
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-code-popup.js.coffee +0 -74
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-contact.js.coffee +0 -59
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-price-converter.js.coffee +0 -49
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-scroll-to.js.coffee +0 -14
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-typeahead.js.coffee +0 -89
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/components.js.coffee +0 -7
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/index.js.coffee +0 -256
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-app-by-category.js.coffee +0 -5
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-currency.js.coffee +0 -30
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-filters.js.coffee +0 -7
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-replace-underscore-with-space.js.coffee +0 -4
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-titleize.js.coffee +0 -7
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-truncate.js.coffee +0 -24
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-app-instance.js.coffee +0 -15
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-apps-document.js.coffee +0 -83
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-user.js.coffee +0 -27
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/organization-svc.js.coffee +0 -318
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/team-svc.js.coffee +0 -180
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/tickets-svc.js.coffee +0 -109
- data/app/assets/javascripts/mno_enterprise/angular/services/impac-config.svc.js.coffee +0 -35
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-apps-list-helper.js.coffee +0 -337
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-currency.js.coffee +0 -7
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-user-svc.js.coffee +0 -99
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-exchange-rates.js.coffee +0 -102
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-miscellaneous.js.coffee.erb +0 -46
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-modal.js.coffee +0 -67
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-services.js.coffee +0 -21
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-shopping-cart.js.coffee +0 -361
- data/app/assets/javascripts/mno_enterprise/angular/services/marketplace-svc.js.coffee +0 -59
- data/app/assets/javascripts/mno_enterprise/lib/angular-really-click.js +0 -17
- data/app/assets/javascripts/ng-performance/ngPerformance.html +0 -109
- data/app/assets/javascripts/ng-performance/ngPerformance.js +0 -211
- data/app/assets/stylesheets/mno_enterprise/custom/impac-variables-override.less +0 -65
- data/app/assets/stylesheets/mno_enterprise/custom/utility/app-presentation.less +0 -77
- data/app/assets/stylesheets/mno_enterprise/custom/utility/banners.less +0 -145
- data/app/assets/stylesheets/mno_enterprise/custom/utility/carousel.less +0 -68
- data/app/assets/stylesheets/mno_enterprise/custom/utility/helptext.less +0 -40
- data/app/assets/stylesheets/mno_enterprise/custom/utility/miscellaneous.less +0 -134
- data/app/assets/stylesheets/mno_enterprise/custom/utility/testimonial.less +0 -118
- data/app/assets/stylesheets/mno_enterprise/custom/views/apps.less +0 -243
- data/app/assets/stylesheets/mno_enterprise/custom/views/myspace.less +0 -477
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/home.less +0 -57
- data/app/assets/stylesheets/mno_enterprise/custom/views/star.less +0 -18
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/bootstrap-wizard.less +0 -63
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-marketplace.less +0 -187
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-organization.less +0 -149
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-teams.less +0 -119
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/support.less +0 -42
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/tickets.less +0 -80
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/mno-editable.less +0 -60
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/shopping-cart.less +0 -333
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/star-wizard.less +0 -49
- data/app/assets/stylesheets/mno_enterprise/custom/views/user-setup.less +0 -10
- data/app/assets/templates/mno_enterprise/dashboard/account.html +0 -131
- data/app/assets/templates/mno_enterprise/dashboard/app_deletion.html +0 -36
- data/app/assets/templates/mno_enterprise/dashboard/apps_list.html +0 -103
- data/app/assets/templates/mno_enterprise/dashboard/horizontal_menu.html +0 -85
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/index.html +0 -60
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/show.html +0 -133
- data/app/assets/templates/mno_enterprise/dashboard/menu.html +0 -161
- data/app/assets/templates/mno_enterprise/dashboard/organization/arrears.html +0 -37
- data/app/assets/templates/mno_enterprise/dashboard/organization/billing.html +0 -37
- data/app/assets/templates/mno_enterprise/dashboard/organization/credit-card.html +0 -156
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.full.html +0 -181
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.html +0 -173
- data/app/assets/templates/mno_enterprise/dashboard/organization/invoices.html +0 -27
- data/app/assets/templates/mno_enterprise/dashboard/organization/members.html +0 -288
- data/app/assets/templates/mno_enterprise/dashboard/organization/settings.html +0 -55
- data/app/assets/templates/mno_enterprise/dashboard/teams/index.html +0 -175
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-add-modal.html +0 -60
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-removal-modal.html +0 -35
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-add-modal.html +0 -35
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-delete-modal.html +0 -35
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-list.html +0 -107
- data/app/assets/templates/mno_enterprise/default_template.html +0 -20
- data/app/assets/templates/mno_enterprise/maestrano-components/autostop_app.html +0 -42
- data/app/assets/templates/mno_enterprise/maestrano-components/currency_widget.html +0 -1
- data/app/assets/templates/mno_enterprise/maestrano-components/editable.html +0 -28
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/congratulations.html +0 -8
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/default.html +0 -1
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/information.html +0 -8
- data/app/assets/templates/mno_enterprise/maestrano-components/star_wizard.html +0 -254
- data/app/assets/templates/mno_enterprise/maestrano-components/upload_spreadsheet.html +0 -191
- data/app/assets/templates/mno_enterprise/modals/new-organization-reseller-req.html +0 -35
- data/app/assets/templates/mno_enterprise/modals/new-organization.html +0 -35
- data/app/assets/templates/mno_enterprise/user-setup/index.html +0 -312
- data/app/controllers/mno_enterprise/pages_controller.rb +0 -9
- data/app/controllers/mno_enterprise/user_setup_controller.rb +0 -11
- data/app/views/layouts/mno_enterprise/_impersonate_header.html.haml +0 -7
- data/app/views/layouts/mno_enterprise/application_dashboard.html.haml +0 -22
- data/app/views/mno_enterprise/pages/myspace.html.haml +0 -6
- data/app/views/mno_enterprise/user_setup/index.html.haml +0 -2
- data/config/initializers/ng-performance.rb +0 -3
- data/lib/assets/javascripts/impac-angular.js +0 -8719
- data/lib/assets/stylesheets/impac-angular.less +0 -2352
- data/lib/mno_enterprise/frontend/concerns/README.md +0 -6
- data/lib/mno_enterprise/frontend/concerns/controllers/pages_controller.rb +0 -25
- data/spec/controllers/mno_enterprise/pages_controller_spec.rb +0 -42
- data/spec/controllers/mno_enterprise/user_setup_controller_spec.rb +0 -33
- data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +0 -18
- data/spec/routing/mno_enterprise/user_setup_controller_routing_spec.rb +0 -11
Binary file
|
Binary file
|
@@ -1,62 +0,0 @@
|
|
1
|
-
module = angular.module('maestrano.controllers.modals-ctrl',['maestrano.assets'])
|
2
|
-
|
3
|
-
# -------------------------------------------------------------------------
|
4
|
-
# This module is meant to contain the small controllers for simple modals
|
5
|
-
# For more complex modals, put the controller in its own file
|
6
|
-
# -------------------------------------------------------------------------
|
7
|
-
|
8
|
-
#============================================
|
9
|
-
# NewOrgModalCtrl
|
10
|
-
#============================================
|
11
|
-
module.controller('NewOrgModalCtrl',[
|
12
|
-
'$scope','$modalInstance','Utilities','DhbOrganizationSvc','$modalInstanceCB'
|
13
|
-
($scope, $modalInstance, Utilities, DhbOrganizationSvc, $modalInstanceCB) ->
|
14
|
-
|
15
|
-
$scope.modal = { model:{} }
|
16
|
-
|
17
|
-
$scope.modal.close = ->
|
18
|
-
$modalInstance.close()
|
19
|
-
|
20
|
-
$scope.modal.proceed = ->
|
21
|
-
self = $scope
|
22
|
-
modal = self.modal
|
23
|
-
modal.isLoading = true
|
24
|
-
data = { organization: modal.model }
|
25
|
-
DhbOrganizationSvc.organization.create(data).then(
|
26
|
-
(success) ->
|
27
|
-
modal.errors = ''
|
28
|
-
modal.close()
|
29
|
-
# Callback method
|
30
|
-
if $modalInstanceCB then $modalInstanceCB(success.data.organization)
|
31
|
-
,(errors) ->
|
32
|
-
modal.errors = Utilities.processRailsError(errors)
|
33
|
-
).finally(-> modal.isLoading = false)
|
34
|
-
|
35
|
-
])
|
36
|
-
|
37
|
-
#============================================
|
38
|
-
# NewOrgResellerReqModalCtrl
|
39
|
-
#============================================
|
40
|
-
module.controller('NewOrgResellerReqModalCtrl',[
|
41
|
-
'$scope','$modalInstance','Utilities','DhbOrganizationSvc','$modalInstanceCB'
|
42
|
-
($scope, $modalInstance, Utilities, DhbOrganizationSvc, $modalInstanceCB) ->
|
43
|
-
|
44
|
-
$scope.modal = { model:{} }
|
45
|
-
|
46
|
-
$scope.modal.close = ->
|
47
|
-
$modalInstance.close()
|
48
|
-
|
49
|
-
$scope.modal.proceed = ->
|
50
|
-
self = $scope
|
51
|
-
modal = self.modal
|
52
|
-
modal.isLoading = true
|
53
|
-
data = { organization: modal.model, reseller_req:true }
|
54
|
-
DhbOrganizationSvc.organization.create(data).then(
|
55
|
-
(success) ->
|
56
|
-
modal.errors = ''
|
57
|
-
modal.close()
|
58
|
-
,(errors) ->
|
59
|
-
modal.errors = Utilities.processRailsError(errors)
|
60
|
-
).finally(-> modal.isLoading = false)
|
61
|
-
|
62
|
-
])
|
data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-account.js.coffee
DELETED
@@ -1,157 +0,0 @@
|
|
1
|
-
module = angular.module('maestrano.dashboard.dashboard-account',['maestrano.assets'])
|
2
|
-
|
3
|
-
#============================================
|
4
|
-
#
|
5
|
-
#============================================
|
6
|
-
module.controller('DashboardAccountCtrl',[
|
7
|
-
'$scope','CurrentUserSvc','DashboardUser','Miscellaneous','Utilities', 'AssetPath',
|
8
|
-
($scope, CurrentUserSvc, DashboardUser, Miscellaneous, Utilities, AssetPath) ->
|
9
|
-
CurrentUserSvc.loadDocument()
|
10
|
-
CurrentUserSvc.then ->
|
11
|
-
|
12
|
-
# Scope init
|
13
|
-
$scope.assetPath = AssetPath
|
14
|
-
$scope.countryCodes = Miscellaneous.countryCodes
|
15
|
-
$scope.errors = {}
|
16
|
-
$scope.success = {}
|
17
|
-
|
18
|
-
# User model init
|
19
|
-
$scope.isPersoInfoOpen = true
|
20
|
-
userDocument = CurrentUserSvc.document.current_user
|
21
|
-
$scope.user = { model: {}, password: {}, loading:false }
|
22
|
-
|
23
|
-
setUserModel = (model) ->
|
24
|
-
$scope.user.model = {
|
25
|
-
name: model.name
|
26
|
-
surname: model.surname
|
27
|
-
email: model.email
|
28
|
-
company: model.company
|
29
|
-
phone: model.phone
|
30
|
-
website: model.website
|
31
|
-
phone_country_code: model.phone_country_code
|
32
|
-
}
|
33
|
-
if userDocument.deletion_request
|
34
|
-
$scope.user.currentDeletionRequestToken = userDocument.deletion_request.token
|
35
|
-
else
|
36
|
-
$scope.user.currentDeletionRequestToken = -1
|
37
|
-
|
38
|
-
setUserModel(userDocument)
|
39
|
-
userOld = angular.copy($scope.user.model)
|
40
|
-
|
41
|
-
$scope.user.hasChanged = ->
|
42
|
-
!(_.isEqual($scope.user.model,userOld))
|
43
|
-
|
44
|
-
$scope.user.cancelChanges = ->
|
45
|
-
$scope.user.model = _.clone(userOld)
|
46
|
-
|
47
|
-
$scope.user.update = ->
|
48
|
-
$scope.user.loading = true
|
49
|
-
CurrentUserSvc.update($scope.user.model).then(
|
50
|
-
(userResp) ->
|
51
|
-
# Email is not changed straight away - Notify user that new email will need to
|
52
|
-
# be confirmed
|
53
|
-
if userOld.email == $scope.user.model.email
|
54
|
-
$scope.success.user = "Saved!"
|
55
|
-
else
|
56
|
-
$scope.success.user = "Saved! A confirmation email will be sent to your new email address. You will need to click on the link enclosed in this email in order to validate this new address."
|
57
|
-
|
58
|
-
displayEmail = $scope.user.model.email
|
59
|
-
setUserModel(userResp)
|
60
|
-
|
61
|
-
# Email not changed in backend until confirmation
|
62
|
-
# Keep changed email on frontend side to avoid user confusion
|
63
|
-
$scope.user.model.email = displayEmail
|
64
|
-
|
65
|
-
userOld = _.clone($scope.user.model)
|
66
|
-
$scope.user.loading = false
|
67
|
-
,(error) ->
|
68
|
-
$scope.user.loading = false
|
69
|
-
$scope.errors.user = Utilities.processRailsError(error)
|
70
|
-
)
|
71
|
-
|
72
|
-
# ----------------------------------------------------
|
73
|
-
# Password update
|
74
|
-
# ----------------------------------------------------
|
75
|
-
$scope.isChangePasswordOpen = false
|
76
|
-
$scope.user.cancelPassword = ->
|
77
|
-
$scope.user.password = { currentPassword:null, confirmPassword:null, newPassword:null }
|
78
|
-
|
79
|
-
$scope.user.updatePasswordEnabled = ->
|
80
|
-
$scope.user.password.currentPassword &&
|
81
|
-
$scope.user.password.confirmPassword &&
|
82
|
-
$scope.user.password.newPassword &&
|
83
|
-
$scope.user.password.confirmPassword == $scope.user.password.newPassword
|
84
|
-
|
85
|
-
|
86
|
-
$scope.user.cancelPasswordEnabled = ->
|
87
|
-
$scope.user.password.currentPassword ||
|
88
|
-
$scope.user.password.confirmPassword ||
|
89
|
-
$scope.user.password.newPassword
|
90
|
-
|
91
|
-
$scope.user.updatePassword = ->
|
92
|
-
$scope.user.loading = true
|
93
|
-
CurrentUserSvc.updatePassword($scope.user.password.newPassword,$scope.user.password.confirmPassword,$scope.user.password.currentPassword).then(
|
94
|
-
(success) ->
|
95
|
-
$scope.user.loading = false
|
96
|
-
$scope.success.changePassword = "Saved!"
|
97
|
-
$scope.errors = null
|
98
|
-
$scope.user.cancelPassword()
|
99
|
-
,(error) ->
|
100
|
-
$scope.user.loading = false
|
101
|
-
$scope.errors.changePassword = Utilities.processRailsError(error)
|
102
|
-
)
|
103
|
-
|
104
|
-
# ----------------------------------------------------
|
105
|
-
# Account Deletion
|
106
|
-
# ----------------------------------------------------
|
107
|
-
$scope.isAccountDeletionOpen = false
|
108
|
-
$scope.user.createDeletionRequest = ->
|
109
|
-
$scope.user.loading = true
|
110
|
-
DashboardUser.deletionRequest().then(
|
111
|
-
(success) ->
|
112
|
-
$scope.user.loading = false
|
113
|
-
$scope.user.currentDeletionRequestToken = success.data.attributes.token
|
114
|
-
,(error) ->
|
115
|
-
$scope.user.loading = false
|
116
|
-
$scope.errors.deletionReq = Utilities.processRailsError(error)
|
117
|
-
)
|
118
|
-
|
119
|
-
$scope.user.cancelDeletionRequest = ->
|
120
|
-
if $scope.user.currentDeletionRequestToken
|
121
|
-
$scope.user.loading = true
|
122
|
-
token = $scope.user.currentDeletionRequestToken
|
123
|
-
DashboardUser.cancelDeletionRequest(token).then(
|
124
|
-
(success) ->
|
125
|
-
$scope.user.loading = false
|
126
|
-
$scope.user.currentDeletionRequestToken = -1
|
127
|
-
,(error) ->
|
128
|
-
$scope.user.loading = false
|
129
|
-
$scope.errors.deletionReq = Utilities.processRailsError(error)
|
130
|
-
)
|
131
|
-
|
132
|
-
$scope.user.resendDeletionRequest = ->
|
133
|
-
if $scope.user.currentDeletionRequestToken
|
134
|
-
$scope.user.loading = true
|
135
|
-
token = $scope.user.currentDeletionRequestToken
|
136
|
-
DashboardUser.resendDeletionRequest(token).then(
|
137
|
-
(success) ->
|
138
|
-
$scope.user.loading = false
|
139
|
-
,(error) ->
|
140
|
-
$scope.user.loading = false
|
141
|
-
$scope.errors.deletionReq = Utilities.processRailsError(error)
|
142
|
-
)
|
143
|
-
|
144
|
-
# TODO: nice to have: update the current user info the same way we updateds
|
145
|
-
# apps info which will allow to remove the deletion request after 60 minutes
|
146
|
-
|
147
|
-
])
|
148
|
-
|
149
|
-
module.directive('dashboardAccount', ['TemplatePath', (TemplatePath) ->
|
150
|
-
return {
|
151
|
-
restrict: 'A',
|
152
|
-
scope: {
|
153
|
-
},
|
154
|
-
templateUrl: TemplatePath['mno_enterprise/dashboard/account.html'],
|
155
|
-
controller: 'DashboardAccountCtrl'
|
156
|
-
}
|
157
|
-
])
|
@@ -1,62 +0,0 @@
|
|
1
|
-
module = angular.module('maestrano.dashboard.dashboard-app-deletion-request',['maestrano.assets'])
|
2
|
-
|
3
|
-
#============================================
|
4
|
-
#
|
5
|
-
#============================================
|
6
|
-
module.controller('DashboardAppDeletionRequestCtrl',[
|
7
|
-
'$scope','$modal','DashboardAppInstance','DashboardAppsDocument','Utilities','AssetPath'
|
8
|
-
($scope, $modal, DashboardAppInstance, DashboardAppsDocument, Utilities, AssetPath) ->
|
9
|
-
|
10
|
-
# Scope Initialization
|
11
|
-
$scope.assetPath = AssetPath
|
12
|
-
$scope.modal = { }
|
13
|
-
|
14
|
-
init = ->
|
15
|
-
$scope.data = DashboardAppsDocument.data["#{$scope.appId}"].plan
|
16
|
-
$scope.sentence = "Please proceed to the deletion of my app and all data it contains"
|
17
|
-
|
18
|
-
# Open modal
|
19
|
-
$scope.$watch(( -> $scope.openModal), ->
|
20
|
-
if $scope.openModal > 0 then $scope.modal.open()
|
21
|
-
)
|
22
|
-
|
23
|
-
$scope.modal.open = ->
|
24
|
-
$scope.modal.errors = null
|
25
|
-
$scope.modal.$instance = $modal.open(templateUrl:'internal-deletion-modal.html',scope:$scope, size:'lg')
|
26
|
-
|
27
|
-
$scope.modal.close = ->
|
28
|
-
$scope.modal.$instance.close()
|
29
|
-
|
30
|
-
$scope.proceed = ->
|
31
|
-
$scope.modal.loading = true
|
32
|
-
DashboardAppInstance.terminate($scope.appId).then(
|
33
|
-
(success) ->
|
34
|
-
DashboardAppsDocument.reload()
|
35
|
-
$scope.modal.loading = false
|
36
|
-
$scope.modal.errors = null
|
37
|
-
$scope.modal.close()
|
38
|
-
,(error) ->
|
39
|
-
$scope.modal.loading = false
|
40
|
-
$scope.modal.errors = Utilities.processRailsError(error)
|
41
|
-
)
|
42
|
-
|
43
|
-
|
44
|
-
$scope.$watch DashboardAppsDocument.getId, (val) ->
|
45
|
-
$scope.loading = true
|
46
|
-
if val?
|
47
|
-
DashboardAppsDocument.load(val).then ->
|
48
|
-
init()
|
49
|
-
|
50
|
-
])
|
51
|
-
|
52
|
-
module.directive('dashboardAppDeletionRequest', ['TemplatePath', (TemplatePath) ->
|
53
|
-
return {
|
54
|
-
restrict: 'A',
|
55
|
-
scope: {
|
56
|
-
appId:'@'
|
57
|
-
openModal:'='
|
58
|
-
},
|
59
|
-
templateUrl: TemplatePath['mno_enterprise/dashboard/app_deletion.html'],
|
60
|
-
controller: 'DashboardAppDeletionRequestCtrl'
|
61
|
-
}
|
62
|
-
])
|
@@ -1,127 +0,0 @@
|
|
1
|
-
module = angular.module('maestrano.dashboard.dashboard-apps-list',['maestrano.assets'])
|
2
|
-
|
3
|
-
#============================================
|
4
|
-
#
|
5
|
-
#============================================
|
6
|
-
module.controller('DashboardAppsListCtrl',[
|
7
|
-
'$scope','DashboardAppsDocument','DashboardAppInstance','AssetPath','AppsListHelper','$interval','$q','DhbOrganizationSvc','MsgBus',
|
8
|
-
($scope, DashboardAppsDocument, DashboardAppInstance, AssetPath, AppsListHelper, $interval, $q, DhbOrganizationSvc, MsgBus) ->
|
9
|
-
$scope.blink = { value: 'neutral' }
|
10
|
-
|
11
|
-
#====================================
|
12
|
-
# Pre-Initialization
|
13
|
-
#====================================
|
14
|
-
$scope.loading = true
|
15
|
-
$scope.assetPath = AssetPath
|
16
|
-
$scope.starWizardModal = { value:false }
|
17
|
-
MsgBus.publish('starWizardModal',$scope.starWizardModal)
|
18
|
-
|
19
|
-
$scope.openStarWizard = ->
|
20
|
-
$scope.starWizardModal.value = true
|
21
|
-
|
22
|
-
$scope.originalApps = []
|
23
|
-
|
24
|
-
#====================================
|
25
|
-
# Scope Management
|
26
|
-
#====================================
|
27
|
-
init = () ->
|
28
|
-
# Scope initialization
|
29
|
-
$scope.displayOptions = {}
|
30
|
-
$scope.helper = {}
|
31
|
-
$scope.appsListHelper = AppsListHelper.new()
|
32
|
-
can = DhbOrganizationSvc.can
|
33
|
-
angular.copy(DashboardAppsDocument.data,$scope.originalApps)
|
34
|
-
$scope.loading = false
|
35
|
-
|
36
|
-
|
37
|
-
# ----------------------------------------------------------
|
38
|
-
# Permissions helper
|
39
|
-
# ----------------------------------------------------------
|
40
|
-
$scope.helper.displayCogwheel = ->
|
41
|
-
can.update.appInstance()
|
42
|
-
|
43
|
-
$scope.helper.canCreateApp = ->
|
44
|
-
can.create.appInstance()
|
45
|
-
|
46
|
-
$scope.helper.canRestartApp = ->
|
47
|
-
can.update.appInstance()
|
48
|
-
|
49
|
-
$scope.helper.canRenameApp = ->
|
50
|
-
can.update.appInstance()
|
51
|
-
|
52
|
-
$scope.helper.canDeleteApp = ->
|
53
|
-
can.destroy.appInstance()
|
54
|
-
|
55
|
-
$scope.helper.canChangePlanApp = (app)->
|
56
|
-
app.stack == 'cube' && can.update.appInstance()
|
57
|
-
|
58
|
-
$scope.helper.displayBootstrapWizard = ->
|
59
|
-
can.update.appInstance()
|
60
|
-
|
61
|
-
$scope.apps = DashboardAppsDocument.data
|
62
|
-
|
63
|
-
# ----------------------------------------------------------
|
64
|
-
# Restart app
|
65
|
-
# ----------------------------------------------------------
|
66
|
-
$scope.restartApp = { loading: false }
|
67
|
-
$scope.restartApp.perform = (id) ->
|
68
|
-
$scope.restartApp.loading = true
|
69
|
-
DashboardAppInstance.restart(id).then(
|
70
|
-
(success) ->
|
71
|
-
$scope.restartApp.loading = false
|
72
|
-
(error) ->
|
73
|
-
$scope.restartApp.loading = false
|
74
|
-
)
|
75
|
-
|
76
|
-
$scope.updateAppName = (app) ->
|
77
|
-
origApp = $scope.originalApps["app_instance_#{app.id}"]
|
78
|
-
if app.name.length == 0
|
79
|
-
app.name = origApp.name
|
80
|
-
else
|
81
|
-
DashboardAppInstance.updateName(app.id,app.name).then(
|
82
|
-
(->)
|
83
|
-
origApp.name = app.name
|
84
|
-
, ->
|
85
|
-
app.name = origApp.name
|
86
|
-
)
|
87
|
-
|
88
|
-
# ----------------------------------------------------------
|
89
|
-
# Little trick to create 'blinking' effect
|
90
|
-
# (used for the status of the apps)
|
91
|
-
# ----------------------------------------------------------
|
92
|
-
blink = ->
|
93
|
-
if $scope.blink.value == '' then $scope.blink.value = 'neutral'
|
94
|
-
else $scope.blink.value = ''
|
95
|
-
$interval((-> blink()),500)
|
96
|
-
|
97
|
-
$scope.shouldBlink = (status) ->
|
98
|
-
_.contains([
|
99
|
-
'starting',
|
100
|
-
'restarting',
|
101
|
-
'stopping',
|
102
|
-
'terminating',
|
103
|
-
'upgrading',
|
104
|
-
'downgrading',
|
105
|
-
],status)
|
106
|
-
|
107
|
-
|
108
|
-
#====================================
|
109
|
-
# Post-Initialization
|
110
|
-
#====================================
|
111
|
-
$scope.$watch DashboardAppsDocument.getId, (val) ->
|
112
|
-
if val?
|
113
|
-
DashboardAppsDocument.load(val).then () ->
|
114
|
-
init()
|
115
|
-
|
116
|
-
|
117
|
-
])
|
118
|
-
|
119
|
-
module.directive('dashboardAppsList', ['TemplatePath', (TemplatePath) ->
|
120
|
-
return {
|
121
|
-
restrict: 'A',
|
122
|
-
scope: {
|
123
|
-
},
|
124
|
-
templateUrl: TemplatePath['mno_enterprise/dashboard/apps_list.html'],
|
125
|
-
controller: 'DashboardAppsListCtrl'
|
126
|
-
}
|
127
|
-
])
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# This main module requires all the sub-modules that should compose it
|
2
|
-
# This pattern allows us to split a fat module in several files
|
3
|
-
dashboardComponents = angular.module('maestrano.dashboard', [
|
4
|
-
'maestrano.dashboard.dashboard-apps-list',
|
5
|
-
'maestrano.dashboard.dashboard-account',
|
6
|
-
'maestrano.dashboard.dashboard-menu',
|
7
|
-
'maestrano.dashboard.dashboard-app-deletion-request',
|
8
|
-
|
9
|
-
# Marketplace Section
|
10
|
-
'maestrano.dashboard.dashboard-marketplace',
|
11
|
-
'maestrano.dashboard.dashboard-marketplace-app',
|
12
|
-
|
13
|
-
# Company Section
|
14
|
-
'maestrano.dashboard.dashboard-organization-index',
|
15
|
-
'maestrano.dashboard.dashboard-organization-credit-card',
|
16
|
-
'maestrano.dashboard.dashboard-organization-invoices',
|
17
|
-
'maestrano.dashboard.dashboard-organization-billing',
|
18
|
-
'maestrano.dashboard.dashboard-organization-arrears',
|
19
|
-
'maestrano.dashboard.dashboard-organization-settings',
|
20
|
-
'maestrano.dashboard.dashboard-organization-members',
|
21
|
-
'maestrano.dashboard.dashboard-organization-teams',
|
22
|
-
'maestrano.dashboard.dashboard-organization-team-list',
|
23
|
-
]
|
24
|
-
)
|
25
|
-
|