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 32c1860c..de2446f1 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 @@ -75,7 +75,7 @@
Unit {{rowIndex + 1}}: - {{ unit.unitName }} + {{ unit.unitName }}
{{ unit.rank }} 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 3380f799..973accc2 100644 --- a/src/main/webapp/app/entities/army/army-detail-mobile.html +++ b/src/main/webapp/app/entities/army/army-detail-mobile.html @@ -53,7 +53,7 @@
+ {{unit.unitName}}
{{unit.unitPowerLevel}}
{{unit.crusadePointsUnit}}
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 deleted file mode 100644 index 72f0615f..00000000 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail-desktop.component.ts +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index 23f0a9c8..00000000 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail-mobile.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index b1949846..00000000 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail.component-desktop.html +++ /dev/null @@ -1,147 +0,0 @@ -
-
-
-
-

{{ 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 deleted file mode 100644 index 355cbe77..00000000 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail.component-mobile.html +++ /dev/null @@ -1,147 +0,0 @@ -
-
-
-
-

{{ 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 deleted file mode 100644 index 9562d7b9..00000000 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail.component.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -
- - - - 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 deleted file mode 100644 index cc7886a3..00000000 --- a/src/main/webapp/app/entities/unit-army/unit-army-detail.component.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { JhiDataUtils, JhiEventManager, JhiEventWithContent, JhiFileLoadError } from 'ng-jhipster'; - -import { IUnitArmy, UnitArmy } from 'app/shared/model/unit-army.model'; -import { FormBuilder, Validators } from '@angular/forms'; -import { UnitArmyService } from './unit-army.service'; -import { ArmyService } from '../army/army.service'; -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', - templateUrl: './unit-army-detail.component.html', -}) -export class UnitArmyDetailComponent implements OnInit { - unitArmy: IUnitArmy | null = null; - isSaving = false; - private responsiveService: ResponsiveService = new ResponsiveService(); - public isMobileResolution: boolean; - - armies: IArmy[] = []; - - editForm = this.fb.group({ - id: [], - unitName: [], - unitBookName: [], - unitDescription: [], - unitPowerLevel: [], - unitPoints: [], - enemyUnitsDestroyed: [], - agendaOneTally: [], - agendaTwoTally: [], - agendaThreeTally: [], - equipment: [], - psychicPowersTaken: [], - warlordTraits: [], - relics: [], - otherUpgrades: [], - crusadePointsUnit: [], - experiencePoints: [], - battlesPlayed: [], - battlesSurvived: [], - rank: [], - battleHonours: [], - battleScars: [], - battlefieldRole: [], - army: [null, Validators.required], - }); - - constructor( - protected dataUtils: JhiDataUtils, - protected activatedRoute: ActivatedRoute, - protected eventManager: JhiEventManager, - protected unitArmyService: UnitArmyService, - protected armyService: ArmyService, - protected fb: FormBuilder - ) { - this.isMobileResolution = this.responsiveService.getMobileStatus(); - } - - ngOnInit(): void { - this.activatedRoute.data.subscribe(({ unitArmy }) => (this.unitArmy = unitArmy)); - } - - byteSize(base64String: string): string { - return this.dataUtils.byteSize(base64String); - } - - openFile(contentType = '', base64String: string): void { - this.dataUtils.openFile(contentType, base64String); - } - - previousState(): void { - window.history.back(); - } - - updateForm(unitArmy: IUnitArmy): void { - this.editForm.patchValue({ - id: unitArmy.id, - unitName: unitArmy.unitName, - unitBookName: unitArmy.unitBookName, - unitDescription: unitArmy.unitDescription, - unitPowerLevel: unitArmy.unitPowerLevel, - unitPoints: unitArmy.unitPoints, - enemyUnitsDestroyed: unitArmy.enemyUnitsDestroyed, - equipment: unitArmy.equipment, - psychicPowersTaken: unitArmy.psychicPowersTaken, - warlordTraits: unitArmy.warlordTraits, - relics: unitArmy.relics, - otherUpgrades: unitArmy.otherUpgrades, - crusadePointsUnit: unitArmy.crusadePointsUnit, - experiencePoints: unitArmy.experiencePoints, - battlesPlayed: unitArmy.battlesPlayed, - battlesSurvived: unitArmy.battlesSurvived, - rank: unitArmy.rank, - battleHonours: unitArmy.battleHonours, - battleScars: unitArmy.battleScars, - battlefieldRole: unitArmy.battlefieldRole, - army: unitArmy.army, - }); - } - - setFileData(event: Event, field: string, isImage: boolean): void { - this.dataUtils.loadFileToForm(event, this.editForm, field, isImage).subscribe(null, (err: JhiFileLoadError) => { - this.eventManager.broadcast( - new JhiEventWithContent('crusadetrackerApp.error', { message: err.message }) - ); - }); - } - - save(): void { - this.isSaving = true; - const unitArmy = this.createFromForm(); - if (unitArmy.id !== undefined) { - this.subscribeToSaveResponse(this.unitArmyService.update(unitArmy)); - } else { - this.subscribeToSaveResponse(this.unitArmyService.create(unitArmy)); - } - } - - private createFromForm(): IUnitArmy { - return { - ...new UnitArmy(), - id: this.editForm.get(['id'])!.value, - unitName: this.editForm.get(['unitName'])!.value, - unitDescription: this.editForm.get(['unitDescription'])!.value, - enemyUnitsDestroyed: this.editForm.get(['enemyUnitsDestroyed'])!.value, - equipment: this.editForm.get(['equipment'])!.value, - psychicPowersTaken: this.editForm.get(['psychicPowersTaken'])!.value, - warlordTraits: this.editForm.get(['warlordTraits'])!.value, - relics: this.editForm.get(['relics'])!.value, - otherUpgrades: this.editForm.get(['otherUpgrades'])!.value, - crusadePointsUnit: this.editForm.get(['crusadePointsUnit'])!.value, - experiencePoints: this.editForm.get(['experiencePoints'])!.value, - battlesPlayed: this.editForm.get(['battlesPlayed'])!.value, - battlesSurvived: this.editForm.get(['battlesSurvived'])!.value, - rank: this.editForm.get(['rank'])!.value, - battleHonours: this.editForm.get(['battleHonours'])!.value, - battleScars: this.editForm.get(['battleScars'])!.value, - battlefieldRole: this.editForm.get(['battlefieldRole'])!.value, - army: this.editForm.get(['army'])!.value, - }; - } - - protected subscribeToSaveResponse(result: Observable>): void { - result.subscribe( - () => this.onSaveSuccess(), - () => this.onSaveError() - ); - } - - protected onSaveSuccess(): void { - this.isSaving = false; - this.previousState(); - } - - protected onSaveError(): void { - this.isSaving = false; - } -} diff --git a/src/main/webapp/app/entities/unit-army/unit-army.component.html b/src/main/webapp/app/entities/unit-army/unit-army.component.html index 819bd081..9bf0c98b 100644 --- a/src/main/webapp/app/entities/unit-army/unit-army.component.html +++ b/src/main/webapp/app/entities/unit-army/unit-army.component.html @@ -51,7 +51,7 @@ - {{ unitArmy.id }} + {{ unitArmy.id }} {{ unitArmy.unitName }} {{ unitArmy.unitBookName }} {{ unitArmy.unitDescription }} 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 3582df95..119bdc3e 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 @@ -3,19 +3,13 @@ import { RouterModule } from '@angular/router'; import { CrusadetrackerSharedModule } from 'app/shared/shared.module'; import { UnitArmyComponent } from './unit-army.component'; -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, - UnitArmyDetailDesktopComponent, - UnitArmyDetailMobileComponent, UnitArmyUpdateComponent, UnitArmyDeleteDialogComponent], entryComponents: [UnitArmyDeleteDialogComponent], diff --git a/src/main/webapp/app/entities/unit-army/unit-army.route.ts b/src/main/webapp/app/entities/unit-army/unit-army.route.ts index 4bfdae45..d0f0e729 100644 --- a/src/main/webapp/app/entities/unit-army/unit-army.route.ts +++ b/src/main/webapp/app/entities/unit-army/unit-army.route.ts @@ -9,7 +9,6 @@ import { UserRouteAccessService } from 'app/core/auth/user-route-access-service' import { IUnitArmy, UnitArmy } from 'app/shared/model/unit-army.model'; import { UnitArmyService } from './unit-army.service'; import { UnitArmyComponent } from './unit-army.component'; -import { UnitArmyDetailComponent } from './unit-army-detail.component'; import { UnitArmyUpdateComponent } from './unit-army-update.component'; @Injectable({ providedIn: 'root' }) @@ -44,18 +43,6 @@ export const unitArmyRoute: Routes = [ }, canActivate: [UserRouteAccessService], }, - { - path: ':id/view', - component: UnitArmyDetailComponent, - resolve: { - unitArmy: UnitArmyResolve, - }, - data: { - authorities: [Authority.USER], - pageTitle: 'UnitArmies', - }, - canActivate: [UserRouteAccessService], - }, { path: 'new', component: UnitArmyUpdateComponent,