Remove enterpriseRoles from enterprsies controller

This commit is contained in:
Matt-Yorkley
2018-01-12 13:40:54 +00:00
committed by Rob Harrington
parent 6ed91cab1f
commit fffae46a63
7 changed files with 6 additions and 14 deletions

View File

@@ -1,3 +1,3 @@
angular.module("ofn.admin", ["admin.enterpriseRoles", "ngResource", "ngAnimate", "admin.utils", "admin.indexUtils", "admin.dropdown", "admin.products", "admin.taxons", "infinite-scroll"]).config ($httpProvider) ->
angular.module("ofn.admin", ["ngResource", "ngAnimate", "admin.utils", "admin.indexUtils", "admin.dropdown", "admin.products", "admin.taxons", "infinite-scroll"]).config ($httpProvider) ->
$httpProvider.defaults.headers.common["X-CSRF-Token"] = $("meta[name=csrf-token]").attr("content")
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"

View File

@@ -1,7 +1,6 @@
angular.module("admin.enterprises")
.controller "enterpriseCtrl", ($scope, $window, NavigationCheck, enterprise, enterpriseRoles, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage) ->
.controller "enterpriseCtrl", ($scope, $window, NavigationCheck, enterprise, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage) ->
$scope.Enterprise = enterprise
$scope.EnterpriseRoles = enterpriseRoles
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
$scope.navClear = NavigationCheck.clear

View File

@@ -1 +1 @@
angular.module("admin.enterprises", [
angular.module("admin.enterprises", [

View File

@@ -11,7 +11,6 @@ module Admin
before_filter :load_methods_and_fees, :only => [:edit, :update]
before_filter :load_groups, :only => [:new, :edit, :update, :create]
before_filter :load_taxons, :only => [:new, :edit, :update, :create]
before_filter :load_roles, only: :edit
before_filter :check_can_change_sells, only: :update
before_filter :check_can_change_bulk_sells, only: :bulk_update
before_filter :check_can_change_owner, only: :update
@@ -186,11 +185,6 @@ module Admin
@taxons = Spree::Taxon.order(:name)
end
def load_roles
@enterprise_roles = EnterpriseRole.find_all_by_enterprise_id(@enterprise.id)
@current_contact = @enterprise.contact.id
end
def update_tag_rules(tag_rules_attributes)
# Due to the combination of trying to use nested attributes and type inheritance
# we cannot apply all attributes to tag rules in one hit because mass assignment

View File

@@ -16,7 +16,7 @@ module Admin
end
def admin_inject_enterprise_roles
admin_inject_json_ams_array "admin.enterpriseRoles", "enterpriseRoles", @enterprise_roles, Api::Admin::EnterpriseRoleSerializer
admin_inject_json_ams_array "ofn.admin", "enterpriseRoles", @enterprise_roles, Api::Admin::EnterpriseRoleSerializer
end
def admin_inject_payment_methods

View File

@@ -1,5 +1,4 @@
= admin_inject_enterprise
= admin_inject_enterprise_roles
= admin_inject_taxons
= admin_inject_payment_methods
= admin_inject_shipping_methods

View File

@@ -24,8 +24,8 @@
- if full_permissions
.eight.columns.omega
%select.select2.fullwidth{id: 'receives_notifications_dropdown', name: 'receives_notifications', ng: {model: 'receivesNotifications', init: "receivesNotifications = '#{@current_contact}'"}}
%option{ng: {repeat: 'user in Enterprise.users', selected: "user.id == #{@current_contact}", hide: '!user.confirmed'}, value: '{{user.id}}'}
%select.select2.fullwidth{id: 'receives_notifications_dropdown', name: 'receives_notifications', ng: {model: 'receivesNotifications', init: "receivesNotifications = '#{@enterprise.contact.id}'"}}
%option{ng: {repeat: 'user in Enterprise.users', selected: "user.id == #{@enterprise.contact.id}", hide: '!user.confirmed'}, value: '{{user.id}}'}
{{user.email}}
.row