mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Only serializing unresolved enterprise issues, styling tweaks and fixes for index
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
angular.module("admin.enterprises").controller "EnterpriseIndexRowCtrl", ($scope) ->
|
||||
$scope.statusText = ->
|
||||
issueCount = (issue for issue in $scope.enterprise.issues when !issue.resolved).length
|
||||
if issueCount > 0
|
||||
$scope.statusClass = "issue"
|
||||
$scope.status = ->
|
||||
if $scope.enterprise.issues.length > 0
|
||||
"issue"
|
||||
else if $scope.enterprise.warnings.length > 0
|
||||
"warning"
|
||||
else
|
||||
warningCount = (warning for warning in $scope.enterprise.warnings when !warning.resolved).length
|
||||
if warningCount > 0
|
||||
$scope.statusClass = "warning"
|
||||
else
|
||||
$scope.statusClass = "ok"
|
||||
"ok"
|
||||
|
||||
|
||||
$scope.producerText = ->
|
||||
@@ -42,7 +39,6 @@ angular.module("admin.enterprises").controller "EnterpriseIndexRowCtrl", ($scope
|
||||
$scope.updateRowText = ->
|
||||
$scope.producer = $scope.producerText()
|
||||
$scope.package = $scope.packageText()
|
||||
$scope.status = $scope.statusText()
|
||||
$scope.producerError = ($scope.producer == "Choose")
|
||||
$scope.packageError = ($scope.package == "Choose")
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
angular.module("admin.enterprises").controller 'indexStatusPanelCtrl', ($scope, $filter) ->
|
||||
$scope.issues = $filter('filter')($scope.object.issues, {resolved: false })
|
||||
$scope.warnings = $filter('filter')($scope.object.warnings, {resolved: false})
|
||||
$scope.issues = $scope.object.issues
|
||||
$scope.warnings = $scope.object.warnings
|
||||
|
||||
Reference in New Issue
Block a user