Skip to content

Commit

Permalink
[MNOE-206] Add pricing details to dock settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hedudelgado committed Oct 27, 2016
1 parent a0fa100 commit 4b509d8
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 17 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
22 changes: 14 additions & 8 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': '{{ &quot;mno_enterprise.templates.impac.dock.settings.no_users&quot; | translate }}', '1': '{{ &quot;mno_enterprise.templates.impac.dock.settings.1_user&quot; | translate }}', 'other': '{{app.licences_count | number}} {{ &quot;mno_enterprise.templates.impac.dock.settings.users&quot; | translate }}'}"
tooltip-placement="bottom" uib-tooltip="{{ 'mno_enterprise.templates.impac.dock.settings.number_of_people_tooltip' | translate:{ appname: 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 All @@ -86,13 +93,12 @@ <h4>{{ 'mno_enterprise.templates.impac.dock.settings.confirm_app_deletion' | tra
</div>
<div class="buttons">
<button class="btn btn-default" ng-click="app.showDelete=false" >{{ 'mno_enterprise.templates.impac.dock.settings.cancel' | translate}}</button>
<button class="btn btn-danger" ng-click="deleteApp()" ng-disabled="sentence != sentenceCheck || modal.loading">
<span ng-show="modal.loading"><i class="fa fa-spinner fa-pulse"></i>&nbsp;</span>
<button class="btn btn-danger" ng-click="deleteApp()" ng-disabled="sentence != sentenceCheck">
<span ng-show="modal.loading"><i class="fa fa-spinner fa-spin"></i>&nbsp;</span>
{{ 'mno_enterprise.templates.impac.dock.settings.delete' | translate }} </button>
</div>
</div>
</div>

<!-- Developer details -->
<div ng-show="helper.canDeleteApp()">
<hr>
Expand Down
8 changes: 7 additions & 1 deletion src/locales/en.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
"mno_enterprise.templates.dashboard.marketplace.app_selection.cancel": "Cancel",
"mno_enterprise.templates.dashboard.marketplace.app_selection.select_orga": "Select an organization",
"mno_enterprise.templates.dashboard.marketplace.app_selection.no_orga_authorized": "Invalid purchase",
"mno_enterprise.templates.dashboard.marketplace.app_selection.unauthorized_to_add_app": "Unfortunately you do not have permission to purchase products for this organization. Please select another organization.",
"mno_enterprise.templates.dashboard.marketplace.app_selection.unauthorized_to_add_app": "Unfortunately you do not have permission to purchase products for this organization.",
"mno_enterprise.templates.dashboard.organization.arrears.title": "Sorry we couldn't process this payment",
"mno_enterprise.templates.dashboard.organization.arrears.explanation": "Your account is currently in arrears as we were unable to charge your designated credit card.",
"mno_enterprise.templates.dashboard.organization.arrears.recommendation": "Please make sure your credit card details are up to date, then click the button below.",
Expand Down Expand Up @@ -550,6 +550,12 @@
"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.number_of_people_tooltip": "This is the total number of people in your organization using",
"mno_enterprise.templates.impac.dock.settings.1_user": "1 user",
"mno_enterprise.templates.impac.dock.settings.no_users": "No users",
"mno_enterprise.templates.impac.dock.settings.users": "users",
"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
26 changes: 26 additions & 0 deletions src/locales/id.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,32 @@
"mno_enterprise.templates.dashboard.teams.team_list.tbl_email": "Email",
"mno_enterprise.templates.dashboard.teams.team_list.tbl_role": "Jabatan",
"mno_enterprise.templates.dashboard.teams.team_list.remove": "Hapus",
"mno_enterprise.templates.impac.dock.launch": "",
"mno_enterprise.templates.impac.dock.connect": "",
"mno_enterprise.templates.impac.dock.settings.settings": "",
"mno_enterprise.templates.impac.dock.settings.status": "",
"mno_enterprise.templates.impac.dock.settings.app_name": "",
"mno_enterprise.templates.impac.dock.settings.access_add-on_settings": "",
"mno_enterprise.templates.impac.dock.settings.manual_data_sharing": "",
"mno_enterprise.templates.impac.dock.settings.manual_data_sync": "",
"mno_enterprise.templates.impac.dock.settings.disconnect_link": "",
"mno_enterprise.templates.impac.dock.settings.delete": "",
"mno_enterprise.templates.impac.dock.settings.pricing_details": "",
"mno_enterprise.templates.impac.dock.settings.free_trial": "",
"mno_enterprise.templates.impac.dock.settings.number_of_people_tooltip": "",
"mno_enterprise.templates.impac.dock.settings.1_user": "",
"mno_enterprise.templates.impac.dock.settings.no_users": "",
"mno_enterprise.templates.impac.dock.settings.users": "",
"mno_enterprise.templates.impac.dock.settings.confirm_app_deletion": "",
"mno_enterprise.templates.impac.dock.settings.please_note_this_app": "",
"mno_enterprise.templates.impac.dock.settings.delete_instructions": "",
"mno_enterprise.templates.impac.dock.settings.cancel": "",
"mno_enterprise.templates.impac.dock.settings.developer_details": "",
"mno_enterprise.templates.impac.dock.settings.linked_to": "",
"mno_enterprise.templates.impac.dock.settings.organization_id": "",
"mno_enterprise.templates.impac.dock.settings.group_id": "",
"mno_enterprise.templates.impac.dock.add_more_apps": "",
"mno_enterprise.templates.impac.dock.cancel": "",
"mno_enterprise.templates.impac.index.dashboard": "Dasbor",
"mno_enterprise.templates.impac.index.new_dashboard": "Dasbor Baru",
"mno_enterprise.templates.impac.index.source": "Sumber",
Expand Down
26 changes: 26 additions & 0 deletions src/locales/zh.locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,32 @@
"mno_enterprise.templates.modals.new_organization.enter_new_company_name": "为您的新公司输入一个名称",
"mno_enterprise.templates.modals.new_organization.cancel": "取消",
"mno_enterprise.templates.modals.new_organization.create": "创建",
"mno_enterprise.templates.impac.dock.launch": "",
"mno_enterprise.templates.impac.dock.connect": "",
"mno_enterprise.templates.impac.dock.settings.settings": "",
"mno_enterprise.templates.impac.dock.settings.status": "",
"mno_enterprise.templates.impac.dock.settings.app_name": "",
"mno_enterprise.templates.impac.dock.settings.access_add-on_settings": "",
"mno_enterprise.templates.impac.dock.settings.manual_data_sharing": "",
"mno_enterprise.templates.impac.dock.settings.manual_data_sync": "",
"mno_enterprise.templates.impac.dock.settings.disconnect_link": "",
"mno_enterprise.templates.impac.dock.settings.delete": "",
"mno_enterprise.templates.impac.dock.settings.pricing_details": "",
"mno_enterprise.templates.impac.dock.settings.free_trial": "",
"mno_enterprise.templates.impac.dock.settings.number_of_people_tooltip": "",
"mno_enterprise.templates.impac.dock.settings.1_user": "",
"mno_enterprise.templates.impac.dock.settings.no_users": "",
"mno_enterprise.templates.impac.dock.settings.users": "",
"mno_enterprise.templates.impac.dock.settings.confirm_app_deletion": "",
"mno_enterprise.templates.impac.dock.settings.please_note_this_app": "",
"mno_enterprise.templates.impac.dock.settings.delete_instructions": "",
"mno_enterprise.templates.impac.dock.settings.cancel": "",
"mno_enterprise.templates.impac.dock.settings.developer_details": "",
"mno_enterprise.templates.impac.dock.settings.linked_to": "",
"mno_enterprise.templates.impac.dock.settings.organization_id": "",
"mno_enterprise.templates.impac.dock.settings.group_id": "",
"mno_enterprise.templates.impac.dock.add_more_apps": "",
"mno_enterprise.templates.impac.dock.cancel": "",
"mno_enterprise.templates.impac.widgets.common.data_not_found.data_not_found": "找不到数据",
"mno_enterprise.templates.impac.widgets.common.data_not_found.are_you_missing_an_app": "您是否丢失了一个应用程序?",
"mno_enterprise.templates.impac.widgets.settings.account.title": "应监控的帐户",
Expand Down

0 comments on commit 4b509d8

Please sign in to comment.