From a154b220ebe15f1ed09910b7c373f874ee04a726 Mon Sep 17 00:00:00 2001 From: mitch Date: Sun, 13 Mar 2022 10:11:43 -0400 Subject: [PATCH] Added dedicated transport Added mobile support for unit-army detail view --- .../com/warhammer/enums/UnitKeywordEnum.java | 1 + .../webapp/app/entities/army/army.module.ts | 3 + .../unit-army-detail-desktop.component.ts | 23 ++ .../unit-army-detail-mobile.component.ts | 24 +++ .../unit-army-detail.component-desktop.html | 147 +++++++++++++ .../unit-army-detail.component-mobile.html | 147 +++++++++++++ .../unit-army/unit-army-detail.component.html | 196 +----------------- .../unit-army/unit-army-detail.component.ts | 7 +- .../unit-army/unit-army-update.component.html | 1 + .../entities/unit-army/unit-army.module.ts | 9 +- 10 files changed, 366 insertions(+), 192 deletions(-) create mode 100644 src/main/webapp/app/entities/unit-army/unit-army-detail-desktop.component.ts create mode 100644 src/main/webapp/app/entities/unit-army/unit-army-detail-mobile.component.ts create mode 100644 src/main/webapp/app/entities/unit-army/unit-army-detail.component-desktop.html create mode 100644 src/main/webapp/app/entities/unit-army/unit-army-detail.component-mobile.html diff --git a/src/main/java/com/warhammer/enums/UnitKeywordEnum.java b/src/main/java/com/warhammer/enums/UnitKeywordEnum.java index 1470f39a..62783ca9 100644 --- a/src/main/java/com/warhammer/enums/UnitKeywordEnum.java +++ b/src/main/java/com/warhammer/enums/UnitKeywordEnum.java @@ -6,6 +6,7 @@ public enum UnitKeywordEnum { ELITE("Elite"), FASTATTACK("Fast Attack"), HEAVYSUPPORT("Heavy Support"), + DEDICATEDTRANSPORT("Dedicated Transport"), FORTIFICATION("Fortification"), FLYER("Flyer"); diff --git a/src/main/webapp/app/entities/army/army.module.ts b/src/main/webapp/app/entities/army/army.module.ts index 3ba7529d..50caf3f8 100644 --- a/src/main/webapp/app/entities/army/army.module.ts +++ b/src/main/webapp/app/entities/army/army.module.ts @@ -20,6 +20,9 @@ import {ArmyDetailComponent} from "./army-detail.component"; ArmyDetailDesktopComponent, ArmyUpdateComponent, ArmyDeleteDialogComponent], + exports: [ + ArmyDetailDesktopComponent + ], entryComponents: [ArmyDeleteDialogComponent] }) export class CrusadetrackerArmyModule {} diff --git a/src/main/webapp/app/entities/unit-army/unit-army-detail-desktop.component.ts b/src/main/webapp/app/entities/unit-army/unit-army-detail-desktop.component.ts new file mode 100644 index 00000000..72f0615f --- /dev/null +++ b/src/main/webapp/app/entities/unit-army/unit-army-detail-desktop.component.ts @@ -0,0 +1,23 @@ +import {Component} from "@angular/core"; +import {UnitArmyDetailComponent} from "./unit-army-detail.component"; +import {JhiDataUtils, JhiEventManager} from "ng-jhipster"; +import {ActivatedRoute} from "@angular/router"; +import {UnitArmyService} from "./unit-army.service"; +import {ArmyService} from "../army/army.service"; +import {FormBuilder} from "@angular/forms"; + +@Component({ + selector: 'jhi-unit-army-detail-desktop', + templateUrl: './unit-army-detail.component-desktop.html' +}) +export class UnitArmyDetailDesktopComponent extends UnitArmyDetailComponent { + constructor(protected dataUtils: JhiDataUtils, + protected activatedRoute: ActivatedRoute, + protected eventManager: JhiEventManager, + protected unitArmyService: UnitArmyService, + protected armyService: ArmyService, + protected fb: FormBuilder) { + // super(dataUtils, activatedRoute); + super(dataUtils, activatedRoute, eventManager, unitArmyService, armyService, fb); + } +} diff --git a/src/main/webapp/app/entities/unit-army/unit-army-detail-mobile.component.ts b/src/main/webapp/app/entities/unit-army/unit-army-detail-mobile.component.ts new file mode 100644 index 00000000..23f0a9c8 --- /dev/null +++ b/src/main/webapp/app/entities/unit-army/unit-army-detail-mobile.component.ts @@ -0,0 +1,24 @@ +import {Component} from "@angular/core"; +import {UnitArmyDetailComponent} from "./unit-army-detail.component"; +import {JhiDataUtils, JhiEventManager} from "ng-jhipster"; +import {ActivatedRoute} from "@angular/router"; +import {UnitArmyService} from "./unit-army.service"; +import {ArmyService} from "../army/army.service"; +import {FormBuilder} from "@angular/forms"; +import {EventManager} from "@angular/platform-browser"; + +@Component({ + selector: 'jhi-unit-army-detail-mobile', + templateUrl: './unit-army-detail.component-mobile.html' +}) +export class UnitArmyDetailMobileComponent extends UnitArmyDetailComponent { + constructor(protected dataUtils: JhiDataUtils, + protected activatedRoute: ActivatedRoute, + protected eventManager: JhiEventManager, + protected unitArmyService: UnitArmyService, + protected armyService: ArmyService, + protected fb: FormBuilder) { + // super(dataUtils, activatedRoute); + super(dataUtils, activatedRoute, eventManager, unitArmyService, armyService, fb); + } +} diff --git a/src/main/webapp/app/entities/unit-army/unit-army-detail.component-desktop.html b/src/main/webapp/app/entities/unit-army/unit-army-detail.component-desktop.html new file mode 100644 index 00000000..b1949846 --- /dev/null +++ b/src/main/webapp/app/entities/unit-army/unit-army-detail.component-desktop.html @@ -0,0 +1,147 @@ +
+
+
+
+

{{ unitArmy.army.armyName }} {{ unitArmy.unitName }}

+
+ +
+
+
+
+
+ UNIT NAME: +
+
+ {{ unitArmy.unitName }} +
+
+
+
+ BATTLEFIELD ROLE: +
+
+ {{unitArmy.battlefieldRole}} +
+
+
+
+ CRUSADE FACTION: +
+
+ {{unitArmy.army}} +
+
+
+ +
+
+
+ UNIT TYPE: +
+
+ {{unitArmy.unitBookName}} +
+
+
+
+ EQUIPMENT: +
+
+ {{ unitArmy.equipment }} +
+
+
+
+ PSYCHIC POWERS: +
+
+ {{ unitArmy.psychicPowersTaken }} +
+
+
+
+ WARLORD TRAITS: +
+
+ {{ unitArmy.warlordTraits }} +
+
+
+
+ RELICS: +
+
+ {{ unitArmy.relics }} +
+
+
+ +

Entries below should remain blank when the unit is first added to your Order of Battle. Fill these entries out as you play with the unit and when it has earned any Battle Honours or Battle Scars.

+
+ COMBAT TALLIES +
+ +
+
+ BATTLES PLAYED: +
+
+ {{ unitArmy.battlesPlayed }} +
+
+ BATTLES SURVIVED: +
+
+ {{ unitArmy.battlesSurvived }} +
+
+
+
+
+
+ ...During this battle: +
+
+ ...In total: +
+
+
+
+ Enemy units destroyed: +
+
+ + +
+
+ {{ unitArmy.enemyUnitsDestroyed }} +
+
+
+
+ RANK +
+
+
+
{{ unitArmy.experiencePoints }} Experience Points
+
{{ unitArmy.rank }}
+
+
+ Unit background and other information +
+
+ {{ unitArmy.unitDescription }} +
+ + + + diff --git a/src/main/webapp/app/entities/unit-army/unit-army-detail.component-mobile.html b/src/main/webapp/app/entities/unit-army/unit-army-detail.component-mobile.html new file mode 100644 index 00000000..355cbe77 --- /dev/null +++ b/src/main/webapp/app/entities/unit-army/unit-army-detail.component-mobile.html @@ -0,0 +1,147 @@ +
+
+
+
+

{{ unitArmy.army.armyName }} {{ unitArmy.unitName }}

+
+ +
+
+
+
+
+ UNIT NAME: +
+
+ {{ unitArmy.unitName }} +
+
+
+
+ BATTLEFIELD ROLE: +
+
+ {{unitArmy.battlefieldRole}} +
+
+
+
+ CRUSADE FACTION: +
+
+ {{unitArmy.army}} +
+
+
+ +
+
+
+ UNIT TYPE: +
+
+ {{unitArmy.unitBookName}} +
+
+
+
+ EQUIPMENT: +
+
+ {{ unitArmy.equipment }} +
+
+
+
+ PSYCHIC POWERS: +
+
+ {{ unitArmy.psychicPowersTaken }} +
+
+
+
+ WARLORD TRAITS: +
+
+ {{ unitArmy.warlordTraits }} +
+
+
+
+ RELICS: +
+
+ {{ unitArmy.relics }} +
+
+
+ +

Entries below should remain blank when the unit is first added to your Order of Battle. Fill these entries out as you play with the unit and when it has earned any Battle Honours or Battle Scars.

+
+ COMBAT TALLIES +
+ +
+
+ BATTLES PLAYED: +
+
+ {{ unitArmy.battlesPlayed }} +
+
+ BATTLES SURVIVED: +
+
+ {{ unitArmy.battlesSurvived }} +
+
+
+
+
+
+ ...During this battle: +
+
+ ...In total: +
+
+
+
+ Enemy units destroyed: +
+
+ + +
+
+ {{ unitArmy.enemyUnitsDestroyed }} +
+
+
+
+ RANK +
+
+
+
{{ unitArmy.experiencePoints }} EXP
+
{{ unitArmy.rank }}
+
+
+ Unit background and other information +
+
+ {{ unitArmy.unitDescription }} +
+ + + + diff --git a/src/main/webapp/app/entities/unit-army/unit-army-detail.component.html b/src/main/webapp/app/entities/unit-army/unit-army-detail.component.html index dc04728f..9562d7b9 100644 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail.component.html +++ b/src/main/webapp/app/entities/unit-army/unit-army-detail.component.html @@ -1,191 +1,7 @@ -
-
-
-
-

{{ unitArmy.army.armyName }} {{ unitArmy.unitName }}

-
- -
-
-
-
-
- UNIT NAME: -
-
- {{ unitArmy.unitName }} -
-
-
-
- BATTLEFIELD ROLE: -
-
- {{unitArmy.battlefieldRole}} -
-
-
-
- CRUSADE FACTION: -
-
- more information -
-
-
-
- SELECTABLE KEYWORDS: -
-
- some more information -
-
-
+
+ +
-
-
-
- UNIT TYPE: -
-
- {{unitArmy.unitBookName}} -
-
-
-
- EQUIPMENT: -
-
- {{ unitArmy.equipment }} -
-
-
-
- PSYCHIC POWERS: -
-
- {{ unitArmy.psychicPowersTaken }} -
-
-
-
- WARLORD TRAITS: -
-
- {{ unitArmy.warlordTraits }} -
-
-
-
- RELICS: -
-
- {{ unitArmy.relics }} -
-
-
- -

Entries below should remain blank when the unit is first added to your Order of Battle. Fill these entries out as you play with the unit and when it has earned any Battle Honours or Battle Scars.

-
- COMBAT TALLIES -
- -
-
- BATTLES PLAYED: -
-
- {{ unitArmy.battlesPlayed }} -
-
- BATTLES SURVIVED: -
-
- {{ unitArmy.battlesSurvived }} -
-
-
-
-
-
- ...During this battle: -
-
- ...In total: -
-
-
-
- Enemy units destroyed: -
-
- - -
-
- {{ unitArmy.enemyUnitsDestroyed }} -
-
-
-
- Enemy units destroyed with psychic powers: -
-
- - -
-
- {{ unitArmy.enemyPsychicDestroyed }} -
-
-
-
- Enemy units destroyed with ranged weapons: -
-
- - -
-
- {{ unitArmy.enemyRangedDestroyed }} -
-
-
-
- Enemy units destroyed with melee weapons: -
-
- - -
-
- {{ unitArmy.enemyMeleeDestroyed }} -
-
-
-
- RANK -
-
-
-
{{ unitArmy.experiencePoints }} Experience Points
-
{{ unitArmy.rank }}
-
-
- Unit background and other information -
-
- {{ unitArmy.unitDescription }} -
- - - - + + + diff --git a/src/main/webapp/app/entities/unit-army/unit-army-detail.component.ts b/src/main/webapp/app/entities/unit-army/unit-army-detail.component.ts index 48f967cb..fca830d4 100644 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail.component.ts +++ b/src/main/webapp/app/entities/unit-army/unit-army-detail.component.ts @@ -10,6 +10,7 @@ import { AlertError } from '../../shared/alert/alert-error.model'; import { Observable } from 'rxjs'; import { HttpResponse } from '@angular/common/http'; import { IArmy } from '../../shared/model/army.model'; +import {ResponsiveService} from "../../responsive.service"; @Component({ selector: 'jhi-unit-army-detail', @@ -18,6 +19,8 @@ import { IArmy } from '../../shared/model/army.model'; export class UnitArmyDetailComponent implements OnInit { unitArmy: IUnitArmy | null = null; isSaving = false; + private responsiveService: ResponsiveService = new ResponsiveService(); + public isMobileResolution: boolean; armies: IArmy[] = []; @@ -58,7 +61,9 @@ export class UnitArmyDetailComponent implements OnInit { protected unitArmyService: UnitArmyService, protected armyService: ArmyService, protected fb: FormBuilder - ) {} + ) { + this.isMobileResolution = this.responsiveService.getMobileStatus(); + } ngOnInit(): void { this.activatedRoute.data.subscribe(({ unitArmy }) => (this.unitArmy = unitArmy)); diff --git a/src/main/webapp/app/entities/unit-army/unit-army-update.component.html b/src/main/webapp/app/entities/unit-army/unit-army-update.component.html index b99271df..6f6f13f1 100644 --- a/src/main/webapp/app/entities/unit-army/unit-army-update.component.html +++ b/src/main/webapp/app/entities/unit-army/unit-army-update.component.html @@ -25,6 +25,7 @@ + diff --git a/src/main/webapp/app/entities/unit-army/unit-army.module.ts b/src/main/webapp/app/entities/unit-army/unit-army.module.ts index 8a27feda..3582df95 100644 --- a/src/main/webapp/app/entities/unit-army/unit-army.module.ts +++ b/src/main/webapp/app/entities/unit-army/unit-army.module.ts @@ -7,10 +7,17 @@ import { UnitArmyDetailComponent } from './unit-army-detail.component'; import { UnitArmyUpdateComponent } from './unit-army-update.component'; import { UnitArmyDeleteDialogComponent } from './unit-army-delete-dialog.component'; import { unitArmyRoute } from './unit-army.route'; +import {UnitArmyDetailDesktopComponent} from "./unit-army-detail-desktop.component"; +import {UnitArmyDetailMobileComponent} from "./unit-army-detail-mobile.component"; @NgModule({ imports: [CrusadetrackerSharedModule, RouterModule.forChild(unitArmyRoute)], - declarations: [UnitArmyComponent, UnitArmyDetailComponent, UnitArmyUpdateComponent, UnitArmyDeleteDialogComponent], + declarations: [UnitArmyComponent, + UnitArmyDetailComponent, + UnitArmyDetailDesktopComponent, + UnitArmyDetailMobileComponent, + UnitArmyUpdateComponent, + UnitArmyDeleteDialogComponent], entryComponents: [UnitArmyDeleteDialogComponent], }) export class CrusadetrackerUnitArmyModule {}