From a9020ca2b36ebf8f2fd01bd173674b0c6de7fe8c Mon Sep 17 00:00:00 2001
From: Jaden Diefenbaugh <blakcap@users.noreply.github.com>
Date: Thu, 16 Mar 2017 12:22:15 +0100
Subject: [PATCH] track by $index to prevent angular from trying to mod immut
 obj

---
 beat/web/reports/static/reports/app/directives/view/layout.js | 2 +-
 .../reports/static/reports/app/directives/view/panelItems.js  | 2 +-
 .../reports/static/reports/app/directives/view/tableItem.js   | 4 ++--
 .../reports/static/reports/app/directives/view/textItem.js    | 1 -
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/beat/web/reports/static/reports/app/directives/view/layout.js b/beat/web/reports/static/reports/app/directives/view/layout.js
index 69ce17a76..b04199a46 100644
--- a/beat/web/reports/static/reports/app/directives/view/layout.js
+++ b/beat/web/reports/static/reports/app/directives/view/layout.js
@@ -45,7 +45,7 @@ angular.module('reportApp').directive("groupsLayout", ['GroupsService', function
 	<div id='groupsLayout' class='panel-group'>
 		<div
 			group-panel-content
-			ng-repeat='group in groups'
+			ng-repeat='group in groups track by $index'
 			group='group'
 			>
 		</div>
diff --git a/beat/web/reports/static/reports/app/directives/view/panelItems.js b/beat/web/reports/static/reports/app/directives/view/panelItems.js
index 6ff325d43..4d8161c9e 100644
--- a/beat/web/reports/static/reports/app/directives/view/panelItems.js
+++ b/beat/web/reports/static/reports/app/directives/view/panelItems.js
@@ -36,7 +36,7 @@ angular.module('reportApp').directive("groupPanelItems", [function(){
 <div>
 	<div
 		group-item-container
-		ng-repeat='item in group.reportItems'
+		ng-repeat='item in group.reportItems track by $index'
 		group='group'
 		report-item='item'
 		style='margin-bottom: 5px;'
diff --git a/beat/web/reports/static/reports/app/directives/view/tableItem.js b/beat/web/reports/static/reports/app/directives/view/tableItem.js
index 28aa3c9e5..e9be49c61 100644
--- a/beat/web/reports/static/reports/app/directives/view/tableItem.js
+++ b/beat/web/reports/static/reports/app/directives/view/tableItem.js
@@ -172,7 +172,7 @@ angular.module('reportApp')
 				<table class="table table-striped table-hover">
 					<thead>
 						<tr>
-							<th ng-repeat='field in fields'>
+							<th ng-repeat='field in fields track by $index'>
 								<span
 									ng-if="sortField.val == field"
 									class='glyphicon'
@@ -190,7 +190,7 @@ angular.module('reportApp')
 					</thead>
 					<tbody>
 						<tr ng-repeat="exp in group.experiments | orderBy:sortFunc:sortField.isReversed">
-							<td ng-repeat='field in fields'>
+							<td ng-repeat='field in fields track by $index'>
 								{{ getFieldVal(exp, field) }}
 							</td>
 						</tr>
diff --git a/beat/web/reports/static/reports/app/directives/view/textItem.js b/beat/web/reports/static/reports/app/directives/view/textItem.js
index 49c0316f2..c3890b1e8 100644
--- a/beat/web/reports/static/reports/app/directives/view/textItem.js
+++ b/beat/web/reports/static/reports/app/directives/view/textItem.js
@@ -49,7 +49,6 @@ angular.module('reportApp')
 			scope.compileContent = () => {
 				let url = UrlService.getCompileRstUrl();
 				let mapToTextBlock = `${scope.group.name}|${scope.group.reportItems.indexOf(scope.reportItem)}`;
-				console.log(mapToTextBlock);
 
 				return reportFactory.compileRST(url, mapToTextBlock)
 				.then(data => {
-- 
GitLab