From c299e5d67cea25078e8f15226b461bba63c81af4 Mon Sep 17 00:00:00 2001
From: JulianPienaar <104741835+JulianPienaar@users.noreply.github.com>
Date: Thu, 21 Sep 2023 16:09:31 +0200
Subject: [PATCH] Fixed some sonar issues
---
frontend/src/app/edit/edit.component.html | 2 ++
frontend/src/app/edit/edit.component.ts | 8 ++++----
frontend/src/app/home/home.component.html | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/frontend/src/app/edit/edit.component.html b/frontend/src/app/edit/edit.component.html
index a683d21b..59280322 100644
--- a/frontend/src/app/edit/edit.component.html
+++ b/frontend/src/app/edit/edit.component.html
@@ -259,6 +259,7 @@
class="spinner"
src="assets/Spinner/loading2.gif"
title="Loading..."
+ alt="Loading..."
/>
@@ -275,6 +276,7 @@
class="spinner"
src="assets/Spinner/loading2.gif"
title="Loading..."
+ alt="Loading..."
/>
{
+ snapshot.forEach((a, i) => {
a.LastModifiedString = this.formatDate(a.LastModified);
a.OrderNumber = i + 1;
a.Name = 'Snapshot ' + a.OrderNumber;
@@ -647,14 +647,14 @@ export class EditComponent implements AfterViewInit, OnInit {
}
}
});
- snapshot.map((a) =>
+ snapshot.forEach((a) =>
a.ChildDiffs.sort((a, b) => {
return a.LastModified < b.LastModified
? 1
: a.LastModified > b.LastModified
? -1
: 0;
- }).map((a, i, arr) => {
+ }).forEach((a, i, arr) => {
a.VersionNumber = arr.length - i + 1;
a.Name = 'Version ' + a.VersionNumber;
})
@@ -669,7 +669,7 @@ export class EditComponent implements AfterViewInit, OnInit {
this.history.push(diff[i]);
}
}
- snapshot.map((a) => this.history.push(a));
+ snapshot.forEach((a) => this.history.push(a));
console.log(this.history);
});
diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html
index 53fe1363..b68af925 100644
--- a/frontend/src/app/home/home.component.html
+++ b/frontend/src/app/home/home.component.html
@@ -1,6 +1,6 @@
-
+