From e6557fade303402da5edd10950bd4fa993d6a803 Mon Sep 17 00:00:00 2001 From: mitch Date: Sat, 5 Mar 2022 17:02:04 -0500 Subject: [PATCH] sorted crusade cards --- .../entities/army/army-detail-desktop.component.html | 2 +- .../webapp/app/entities/army/army-detail-mobile.html | 3 ++- .../webapp/app/entities/army/army-detail.component.ts | 11 ++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/app/entities/army/army-detail-desktop.component.html b/src/main/webapp/app/entities/army/army-detail-desktop.component.html index 370550b3..f5f720b4 100644 --- a/src/main/webapp/app/entities/army/army-detail-desktop.component.html +++ b/src/main/webapp/app/entities/army/army-detail-desktop.component.html @@ -69,7 +69,7 @@
CRUSADE POINTS
ADD TO FORCE
-
+
Unit {{rowIndex + 1}}: diff --git a/src/main/webapp/app/entities/army/army-detail-mobile.html b/src/main/webapp/app/entities/army/army-detail-mobile.html index ee5e82ee..605ba550 100644 --- a/src/main/webapp/app/entities/army/army-detail-mobile.html +++ b/src/main/webapp/app/entities/army/army-detail-mobile.html @@ -35,7 +35,8 @@
-
+
+
diff --git a/src/main/webapp/app/entities/army/army-detail.component.ts b/src/main/webapp/app/entities/army/army-detail.component.ts index 11acd2d2..0cbde9b5 100644 --- a/src/main/webapp/app/entities/army/army-detail.component.ts +++ b/src/main/webapp/app/entities/army/army-detail.component.ts @@ -4,7 +4,7 @@ import { JhiDataUtils } from 'ng-jhipster'; import { LocalStorage } from 'ngx-webstorage'; import { IArmy } from 'app/shared/model/army.model'; -import { UnitArmy } from '../../shared/model/unit-army.model'; +import {IUnitArmy, UnitArmy} from '../../shared/model/unit-army.model'; import {DomSanitizer} from "@angular/platform-browser"; import {ResponsiveService} from "../../responsive.service"; @@ -46,6 +46,15 @@ export class ArmyDetailComponent implements OnInit { console.log(msg); } + sortUnits(unitArmy: IUnitArmy[] | undefined): Array | undefined { + if (unitArmy) { + // @ts-ignore + unitArmy.sort((a,b) => a.unitName.localeCompare(b.unitName)); + return unitArmy + } + return unitArmy + } + calculatePoints(armylocal: IArmy): Number { let total = 0; if (armylocal['units']) {