Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNOE-1196] Admin Panel - UI to view/edit product notification settings #309

Open
wants to merge 1 commit into
base: 2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/views/products/product.controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@
vm.deleteLogo = (asset) ->
MnoeProducts.deleteAsset(asset)

#------------------------------------------------
# Notification Settings
#------------------------------------------------

vm.updateNotificationSettings = -> update(['notification_on_success', 'notification_on_failure', 'notification_on_approval'])

# Private
update = (params) ->
vm.product.values_attributes = _.map(_.keys(vm.product.values_display), (k) -> {name: k, data: vm.product.values_display[k]})
Expand Down
27 changes: 27 additions & 0 deletions src/app/views/products/product.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,32 @@ <h4>{{pricingPlan.name}}</h4>
</mno-section>
</mno-widget-body>
</mno-widget>

<!-- Notification section -->
<mno-widget icon="fa-tag" heading="{{'mnoe_admin_panel.dashboard.product.notification_settings' | translate}}" is-loading="vm.isLoading">
<mno-widget-header></mno-widget-header>
<mno-widget-body>
<form name="vm.form.product.notification_settings">
<mno-section heading="{{'mnoe_admin_panel.dashboard.product.notification_on_success' | translate}}">
<input type="checkbox" ng-model="vm.product.notification_on_success">
</mno-section>

<mno-section heading="{{'mnoe_admin_panel.dashboard.product.notification_on_failure' | translate}}">
<input type="checkbox" ng-model="vm.product.notification_on_failure">
</mno-section>

<mno-section heading="{{'mnoe_admin_panel.dashboard.product.notification_on_approval' | translate}}">
<input type="checkbox" ng-model="vm.product.notification_on_approval">
</mno-section>

<mno-section class="btn-box">
<button class="btn btn-primary top-buffer-1" ng-click="vm.updateNotificationSettings()" ng-disabled="vm.isLoadingNotificationSettings" translate>
mnoe_admin_panel.dashboard.product.submit
</button>
</mno-section>
</form>

</mno-widget-body>
</mno-widget>
</div>
</fieldset>
4 changes: 4 additions & 0 deletions src/locales/en-AU.json
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,10 @@
"mnoe_admin_panel.dashboard.product.status.success": "Product status of product '{product}' is now {status, select, true{published} other{draft}}",
"mnoe_admin_panel.dashboard.product.status.error": "An error occurred while updating product status",
"mnoe_admin_panel.dashboard.product.product_pricing": "Product Pricing",
"mnoe_admin_panel.dashboard.product.notification_settings": "Notification Settings",
"mnoe_admin_panel.dashboard.product.notification_on_success": "Receive an email notification when this product is successfully ordered",
"mnoe_admin_panel.dashboard.product.notification_on_failure": "Receive an email notification when this product fails to be ordered",
"mnoe_admin_panel.dashboard.product.notification_on_approval": "Receive an email notification when this product is approved",
"mnoe_admin_panel.dashboard.product.description": "description",
"mnoe_admin_panel.dashboard.product.benefits": "Key benefits",
"mnoe_admin_panel.dashboard.product.nid": "Nid",
Expand Down