Skip to content

Commit

Permalink
Add pricing details to dock settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hedudelgado committed Oct 18, 2016
1 parent 4fbd159 commit 252bc2b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
18 changes: 10 additions & 8 deletions src/app/views/apps/modals/app-settings-modal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ angular.module 'mnoEnterpriseAngular'
$scope.sentence = "Please proceed to the deletion of my app and all data it contains"
$scope.organization_uid = ImpacMainSvc.config.currentOrganization.uid

# ----------------------------------------------------------
# Permissions helper
# ----------------------------------------------------------

$scope.helper = {}
$scope.helper.canDeleteApp = ->
MnoeOrganizations.can.destroy.appInstance()

$scope.modal.close = ->
$uibModalInstance.close()

Expand All @@ -31,6 +23,16 @@ angular.module 'mnoEnterpriseAngular'
$scope.modal.errors = Utilities.processRailsError(error)
).finally(-> $scope.modal.loading = false)

# ----------------------------------------------------------
# Permissions helper
# ----------------------------------------------------------
$scope.helper = {}
$scope.helper.canDeleteApp = ->
MnoeOrganizations.can.destroy.appInstance()

$scope.helper.canDisplayBilling = ->
MnoeOrganizations.can.read.billing()

$scope.helper.isDataSyncShown = (app) ->
app.stack == 'connector' && app.oauth_keys_valid

Expand Down
18 changes: 12 additions & 6 deletions src/app/views/apps/modals/app-settings-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@ <h3><b>{{ 'mno_enterprise.templates.impac.dock.settings.settings' | translate }}
</div>
</div>
</div>

<!-- Add on settings -->
<div ng-show="helper.isAddOnSettingShown(app)">
<hr>
<button ng-click="helper.addOnSettingLauch(app)" class="btn btn-warning">{{ 'mno_enterprise.templates.impac.dock.settings.access_add-on_settings' | translate }}</button>
</div>

<!-- Billing Details -->
<div ng-show="helper.canDisplayBilling()">
<hr>
<div ng-show="!!app.free_trial_end_at">
{{ 'mno_enterprise.templates.impac.dock.settings.free_trial' | translate }}: {{ app.free_trial_end_at }}
</div>
<div ng-show="!app.free_trial_end_at && app.per_user_licence">
<ng-pluralize count="app.licences_count" when="{'0': 'No users', '1': '1 user', 'other': '{{app.licences_count | number}} users'}"
tooltip-placement="bottom" tooltip="This is the total number of people in your organization using {{app.name}}"></ng-pluralize>
</div>
<div ng-show="!app.app.free_trial_end_at && !app.per_user_licence">{{ 'mno_enterprise.templates.impac.dock.settings.pricing_details' | translate }}</div>
</div>
<!-- Data Sharing -->
<div ng-show="helper.isDataSyncShown(app) || helper.isDataDisconnectShown(app)">
<hr>
Expand All @@ -41,7 +51,6 @@ <h3><b>{{ 'mno_enterprise.templates.impac.dock.settings.settings' | translate }}
<span class="title">{{ 'mno_enterprise.templates.impac.dock.settings.manual_data_sharing' | translate }}</span>
</div>
<div class="col-md-8">

<!-- Connected company name -->
<div ng-show="helper.companyName(app)">
{{ 'mno_enterprise.templates.impac.dock.settings.linked_to' | translate }}: {{ helper.companyName(app) | truncate:45 }}
Expand All @@ -55,7 +64,6 @@ <h3><b>{{ 'mno_enterprise.templates.impac.dock.settings.settings' | translate }}
<a class="btn btn-info" ng-href="{{helper.dataSyncPath(app)}}" uib-tooltip="{{ 'mno_enterprise.templates.dashboard.apps_list.manual_data_sync_tooltip' | translate:{ appname: app.app_name } }}">{{ 'mno_enterprise.templates.impac.dock.settings.manual_data_sync' | translate }}</a>
</div>
</div>

<!-- Data Disconnect Button -->
<div ng-show="helper.isDataDisconnectShown(app)">
<a class="btn btn-danger" ng-click="helper.dataDisconnectClick(app)" href="" uib-tooltip="{{ 'mno_enterprise.templates.dashboard.apps_list.disconnect_link_tooltip' | translate:{ appname: app.app_name } }}">
Expand All @@ -64,7 +72,6 @@ <h3><b>{{ 'mno_enterprise.templates.impac.dock.settings.settings' | translate }}
</div>
</div>
</div>

<!-- Deletion -->
<hr>
<div ng-show="helper.canDeleteApp()">
Expand Down Expand Up @@ -92,7 +99,6 @@ <h4>{{ 'mno_enterprise.templates.impac.dock.settings.confirm_app_deletion' | tra
</div>
</div>
</div>

<!-- Developer details -->
<div ng-show="helper.canDeleteApp()">
<hr>
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@
"mno_enterprise.templates.impac.dock.settings.manual_data_sync": "Manual Data Sync",
"mno_enterprise.templates.impac.dock.settings.disconnect_link": "Disconnect Link",
"mno_enterprise.templates.impac.dock.settings.delete": "Delete",
"mno_enterprise.templates.impac.dock.settings.pricing_details": "Pricing details inside your app",
"mno_enterprise.templates.impac.dock.settings.free_trial": "Free Trial",
"mno_enterprise.templates.impac.dock.settings.confirm_app_deletion": "Confirm app deletion",
"mno_enterprise.templates.impac.dock.settings.please_note_this_app": "Please note this app is on a monthly plan. Your billing for this app will be calculated pro rata.",
"mno_enterprise.templates.impac.dock.settings.delete_instructions": "In order to delete your app, please enter the following statement in the box below.",
Expand Down

0 comments on commit 252bc2b

Please sign in to comment.