feature/battle-ready-mobile #7
10
build.sh
Executable file
10
build.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
./mvnw -ntp clean -P-webpack
|
||||||
|
./mvnw -ntp checkstyle:check
|
||||||
|
./mvnw -ntp com.github.eirslett:frontend-maven-plugin:install-node-and-npm -DnodeVersion=v12.16.1 -DnpmVersion=6.14.5
|
||||||
|
./mvnw -ntp com.github.eirslett:frontend-maven-plugin:npm
|
||||||
|
./mvnw test
|
||||||
|
./mvnw -ntp verify -P-webpack -Pprod -DskipTests
|
||||||
|
docker-compose build
|
||||||
|
#docker login -u \$doApi -p \$doApi registry.digitalocean.com
|
||||||
|
docker push registry.digitalocean.com/nerdfortress/crusadetracker
|
@ -1,12 +1,9 @@
|
|||||||
package com.warhammer.domain;
|
package com.warhammer.domain;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import org.hibernate.annotations.Cache;
|
|
||||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -38,9 +35,15 @@ public class Army implements Serializable {
|
|||||||
@Column(name = "army_power_level")
|
@Column(name = "army_power_level")
|
||||||
private Long armyPowerLevel;
|
private Long armyPowerLevel;
|
||||||
|
|
||||||
|
// @Column(name = "army_race")
|
||||||
|
// private String armyRace;
|
||||||
|
|
||||||
@Column(name = "army_points")
|
@Column(name = "army_points")
|
||||||
private Long armyPoints;
|
private Long armyPoints;
|
||||||
|
|
||||||
|
// @Column(name = "codex_specific_points")
|
||||||
|
// private Long codexSpecificPoints;
|
||||||
|
|
||||||
@Column(name = "army_points_or_pl")
|
@Column(name = "army_points_or_pl")
|
||||||
private Boolean armyPointsOrPL;
|
private Boolean armyPointsOrPL;
|
||||||
|
|
||||||
@ -227,6 +230,22 @@ public class Army implements Serializable {
|
|||||||
this.battlesWon = battlesWon;
|
this.battlesWon = battlesWon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public Long getCodexSpecificPoints() {
|
||||||
|
// return codexSpecificPoints;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setCodexSpecificPoints(Long codexSpecificPoints) {
|
||||||
|
// this.codexSpecificPoints = codexSpecificPoints;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public String getArmyRace() {
|
||||||
|
// return armyRace;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setArmyRace(String armyRace) {
|
||||||
|
// this.armyRace = armyRace;
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
@ -251,10 +270,12 @@ public class Army implements Serializable {
|
|||||||
", armyDescription='" + getArmyDescription() + "'" +
|
", armyDescription='" + getArmyDescription() + "'" +
|
||||||
", armyName='" + getArmyName() + "'" +
|
", armyName='" + getArmyName() + "'" +
|
||||||
", armyFaction='" + getArmyFaction() + "'" +
|
", armyFaction='" + getArmyFaction() + "'" +
|
||||||
|
// ", armyRace='" + getArmyRace() + "'" +
|
||||||
", armyPowerLevel=" + getArmyPowerLevel() +
|
", armyPowerLevel=" + getArmyPowerLevel() +
|
||||||
", armyPoints=" + getArmyPoints() +
|
", armyPoints=" + getArmyPoints() +
|
||||||
", armyPointsOrPL='" + isArmyPointsOrPL() + "'" +
|
", armyPointsOrPL='" + isArmyPointsOrPL() + "'" +
|
||||||
", requisition=" + getRequisition() +
|
", requisition=" + getRequisition() +
|
||||||
|
// ", armyCodexSpecificPoints=" + getCodexSpecificPoints() +
|
||||||
", battleTally=" + getBattleTally() +
|
", battleTally=" + getBattleTally() +
|
||||||
", battlesWon=" + getBattlesWon() +
|
", battlesWon=" + getBattlesWon() +
|
||||||
"}";
|
"}";
|
||||||
|
52
src/main/java/com/warhammer/enums/ArmyRaces.java
Normal file
52
src/main/java/com/warhammer/enums/ArmyRaces.java
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package com.warhammer.enums;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public enum ArmyRaces {
|
||||||
|
ADEPTUS_ASTARTES("Space Marines", Arrays.asList("".split(","))),
|
||||||
|
GREY_KNIGHTS("Grey Knights", Arrays.asList("True Name Points".split(","))),
|
||||||
|
ADEPTAS_SORORITAS("Sisters of Battle", Arrays.asList("Saint Points, Martyr Points".split(","))),
|
||||||
|
ADEPTUS_CUSTODES("Custodians", Arrays.asList("".split(","))),
|
||||||
|
ADEPTUS_MECHANICUS("AdMech", Arrays.asList("Archeotech Parts".split(","))),
|
||||||
|
ASTRA_MILITARUM("Imperial Guard", Arrays.asList("".split(","))),
|
||||||
|
IMPERIAL_KNIGHTS("Imperial Knights", Arrays.asList("".split(","))),
|
||||||
|
CHAOS_DAEMONS("Daemons", Arrays.asList("".split(","))),
|
||||||
|
CHAOS_KNIGHTS("Chaos Knights", Arrays.asList("".split(","))),
|
||||||
|
CHAOS_SPACE_MARINES("Chaos Space Marines", Arrays.asList("".split(","))),
|
||||||
|
DEATH_GUARD("Death Guard", Arrays.asList("Virulence Points".split(","))),
|
||||||
|
THOUSAND_SONS("Thousand Sons", Arrays.asList("".split(","))),
|
||||||
|
CRAFTWORLDS("Eldaar", Arrays.asList("".split(","))),
|
||||||
|
DRUKHARI("Dark Eldaar", Arrays.asList("".split(","))),
|
||||||
|
YNNARI("Ynnari", Arrays.asList("".split(","))),
|
||||||
|
HARLEQUINS("Harlequins", Arrays.asList("".split(","))),
|
||||||
|
GENESTEALERS("Genestealers", Arrays.asList("".split(","))),
|
||||||
|
NECRONS("Necons", Arrays.asList("".split(","))),
|
||||||
|
ORKS("Orks", Arrays.asList("".split(","))),
|
||||||
|
TAU("Tau", Arrays.asList("".split(","))),
|
||||||
|
TYRANIDS("Tyranids", Arrays.asList("".split(",")));
|
||||||
|
|
||||||
|
private String armyCommonName;
|
||||||
|
private List<String> armyCodexSpecificPointName;
|
||||||
|
|
||||||
|
ArmyRaces(String armyCommonName, List<String> armyCodexSpecificPointName) {
|
||||||
|
this.armyCommonName = armyCommonName;
|
||||||
|
this.armyCodexSpecificPointName = armyCodexSpecificPointName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArmyCommonName() {
|
||||||
|
return armyCommonName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getArmyCodexSpecificPointName() {
|
||||||
|
return armyCodexSpecificPointName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ArmyRaces{" +
|
||||||
|
"armyCommonName='" + armyCommonName + '\'' +
|
||||||
|
", armyCodexSpecificPointName=" + armyCodexSpecificPointName +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -1,24 +1,20 @@
|
|||||||
package com.warhammer.service.impl;
|
package com.warhammer.service.impl;
|
||||||
|
|
||||||
import com.warhammer.domain.UnitArmy;
|
|
||||||
import com.warhammer.service.ArmyService;
|
|
||||||
import com.warhammer.domain.Army;
|
import com.warhammer.domain.Army;
|
||||||
|
import com.warhammer.domain.UnitArmy;
|
||||||
import com.warhammer.repository.ArmyRepository;
|
import com.warhammer.repository.ArmyRepository;
|
||||||
|
import com.warhammer.service.ArmyService;
|
||||||
import com.warhammer.service.dto.ArmyDTO;
|
import com.warhammer.service.dto.ArmyDTO;
|
||||||
import com.warhammer.service.mapper.ArmyMapper;
|
import com.warhammer.service.mapper.ArmyMapper;
|
||||||
import liquibase.pro.packaged.S;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collector;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service Implementation for managing {@link Army}.
|
* Service Implementation for managing {@link Army}.
|
||||||
@ -86,6 +82,12 @@ public class ArmyServiceImpl implements ArmyService {
|
|||||||
@Override
|
@Override
|
||||||
public void delete(Long id) {
|
public void delete(Long id) {
|
||||||
log.debug("Request to delete Army : {}", id);
|
log.debug("Request to delete Army : {}", id);
|
||||||
|
List<UnitArmy> units = this.findUnits(id);
|
||||||
|
if (!units.isEmpty()) {
|
||||||
|
units.forEach(unit ->
|
||||||
|
unitArmyService.delete(unit.getId())
|
||||||
|
);
|
||||||
|
}
|
||||||
armyRepository.deleteById(id);
|
armyRepository.deleteById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,19 +3,16 @@ package com.warhammer.web.rest;
|
|||||||
import com.warhammer.domain.UnitArmy;
|
import com.warhammer.domain.UnitArmy;
|
||||||
import com.warhammer.security.SecurityUtils;
|
import com.warhammer.security.SecurityUtils;
|
||||||
import com.warhammer.service.ArmyService;
|
import com.warhammer.service.ArmyService;
|
||||||
import com.warhammer.web.rest.errors.BadRequestAlertException;
|
|
||||||
import com.warhammer.service.dto.ArmyDTO;
|
import com.warhammer.service.dto.ArmyDTO;
|
||||||
|
import com.warhammer.web.rest.errors.BadRequestAlertException;
|
||||||
import io.github.jhipster.web.util.HeaderUtil;
|
import io.github.jhipster.web.util.HeaderUtil;
|
||||||
import io.github.jhipster.web.util.ResponseUtil;
|
import io.github.jhipster.web.util.ResponseUtil;
|
||||||
import org.checkerframework.checker.nullness.Opt;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.swing.text.html.Option;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
@ -54,10 +54,16 @@ spring:
|
|||||||
# Remove 'faker' if you do not want the sample data to be loaded automatically
|
# Remove 'faker' if you do not want the sample data to be loaded automatically
|
||||||
contexts: dev
|
contexts: dev
|
||||||
mail:
|
mail:
|
||||||
host: localhost
|
host: mail.nerdfortress.dev
|
||||||
port: 1025
|
port: 587
|
||||||
username:
|
username: crusadetracker@send.nerdfortress.dev #Replace this field with your Gmail username.
|
||||||
password:
|
password: '!k$yzY9h42@D' #Replace this field with your Gmail password/App password.
|
||||||
|
protocol: smtp
|
||||||
|
tls: true
|
||||||
|
properties.mail.smtp:
|
||||||
|
auth: true
|
||||||
|
starttls.enable: true
|
||||||
|
ssl.trust: mail.nerdfortress.dev
|
||||||
messages:
|
messages:
|
||||||
cache-duration: PT1S # 1 second, see the ISO 8601 standard
|
cache-duration: PT1S # 1 second, see the ISO 8601 standard
|
||||||
thymeleaf:
|
thymeleaf:
|
||||||
|
@ -50,10 +50,16 @@ spring:
|
|||||||
liquibase:
|
liquibase:
|
||||||
contexts: prod
|
contexts: prod
|
||||||
mail:
|
mail:
|
||||||
host: localhost
|
host: mail.nerdfortress.dev
|
||||||
port: 25
|
port: 587
|
||||||
username:
|
username: crusadetracker@send.nerdfortress.dev #Replace this field with your Gmail username.
|
||||||
password:
|
password: '!k$yzY9h42@D' #Replace this field with your Gmail password/App password.
|
||||||
|
protocol: smtp
|
||||||
|
tls: true
|
||||||
|
properties.mail.smtp:
|
||||||
|
auth: true
|
||||||
|
starttls.enable: true
|
||||||
|
ssl.trust: mail.nerdfortress.dev
|
||||||
thymeleaf:
|
thymeleaf:
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
@ -110,7 +116,7 @@ jhipster:
|
|||||||
token-validity-in-seconds: 86400
|
token-validity-in-seconds: 86400
|
||||||
token-validity-in-seconds-for-remember-me: 2592000
|
token-validity-in-seconds-for-remember-me: 2592000
|
||||||
mail: # specific JHipster mail property, for standard properties see MailProperties
|
mail: # specific JHipster mail property, for standard properties see MailProperties
|
||||||
base-url: http://my-server-url-to-change # Modify according to your server's URL
|
base-url: https://crusadetracker.nerdfortress.dev # Modify according to your server's URL
|
||||||
metrics:
|
metrics:
|
||||||
logs: # Reports metrics in the logs
|
logs: # Reports metrics in the logs
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@ -141,7 +141,7 @@ jhipster:
|
|||||||
# allow-credentials: true
|
# allow-credentials: true
|
||||||
# max-age: 1800
|
# max-age: 1800
|
||||||
mail:
|
mail:
|
||||||
from: crusadetracker@localhost
|
from: crusadetracker@send.nerdfortress.dev
|
||||||
swagger:
|
swagger:
|
||||||
default-include-pattern: /api/.*
|
default-include-pattern: /api/.*
|
||||||
title: crusadetracker API
|
title: crusadetracker API
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<databaseChangeLog
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
|
||||||
|
|
||||||
|
<property name="autoIncrement" value="true"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Update the entity UnitArmy.
|
||||||
|
to remove entity UnitBase
|
||||||
|
-->
|
||||||
|
<changeSet id="20210808083300_add_codex_points-1" author="mitch" runOnChange="true">
|
||||||
|
<addColumn tableName="army">
|
||||||
|
<column name="codex_specific_points" type="bigint">
|
||||||
|
<constraints nullable="true" />
|
||||||
|
</column>
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<databaseChangeLog
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
|
||||||
|
|
||||||
|
<property name="autoIncrement" value="true"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Update the entity UnitArmy.
|
||||||
|
to remove entity UnitBase
|
||||||
|
-->
|
||||||
|
<changeSet id="20210808083300_add_army_race-1" author="mitch" runOnChange="true">
|
||||||
|
<addColumn tableName="army">
|
||||||
|
<column name="army_race" type="varchar(255)">
|
||||||
|
<constraints nullable="true" />
|
||||||
|
</column>
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
@ -21,6 +21,8 @@
|
|||||||
<include file="config/liquibase/changelog/20200727033716_added_entity_constraints_Army.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20200727033716_added_entity_constraints_Army.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/changelog/20200727033816_added_entity_constraints_UnitArmy.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20200727033816_added_entity_constraints_UnitArmy.xml" relativeToChangelogFile="false"/>
|
||||||
<include file="config/liquibase/changelog/20200823170000_merge_unit_army_and_base.xml" relativeToChangelogFile="false"/>
|
<include file="config/liquibase/changelog/20200823170000_merge_unit_army_and_base.xml" relativeToChangelogFile="false"/>
|
||||||
|
<include file="config/liquibase/changelog/20210808083300_add_codex_points.xml" relativeToChangelogFile="false"/>
|
||||||
|
<include file="config/liquibase/changelog/20210808130500_add_army_race.xml" relativeToChangelogFile="false"/>
|
||||||
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
|
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
|
||||||
<!-- jhipster-needle-liquibase-add-incremental-changelog - JHipster will add incremental liquibase changelogs here -->
|
<!-- jhipster-needle-liquibase-add-incremental-changelog - JHipster will add incremental liquibase changelogs here -->
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
@ -61,21 +61,33 @@
|
|||||||
|
|
||||||
<div class="crusade-cards" style="padding-top: 10px">
|
<div class="crusade-cards" style="padding-top: 10px">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6" style="border: 1px solid black;">CRUSADE CARDS</div>
|
<div class="col-md-3" style="border: 1px solid black;">CRUSADE CARDS</div>
|
||||||
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">POWER RATING</div>
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">RANK</div>
|
||||||
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">CRUSADE POINTS</div>
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">POWER RATING</div>
|
||||||
|
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">BATTLE HONOURS</div>
|
||||||
|
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">BATTLE SCARS</div>
|
||||||
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">CRUSADE POINTS</div>
|
||||||
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">ADD TO FORCE</div>
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f;">ADD TO FORCE</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let unit of army.units; let rowIndex=index">
|
<div *ngFor="let unit of army.units; let rowIndex=index">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3" style="border: 1px solid black;">Unit {{rowIndex + 1}}:</div>
|
<div class="col-md-3" style="border: 1px solid black;">
|
||||||
<div class="col-md-3" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">
|
Unit {{rowIndex + 1}}:
|
||||||
<a [routerLink]="['/unit-army', unit.id, 'view']"> {{ unit.unitName }}</a>
|
<a [routerLink]="['/unit-army', unit.id, 'view']"> {{ unit.unitName }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">
|
||||||
|
{{ unit.rank }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">
|
||||||
{{ unit.unitPowerLevel }}
|
{{ unit.unitPowerLevel }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">{{unit.crusadePointsUnit}}</div>
|
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">
|
||||||
|
{{ unit.battleHonours}}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">
|
||||||
|
{{ unit.battleScars}}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1" style="border: 1px solid black; background: whitesmoke; color: #0f0f0f">{{unit.crusadePointsUnit}}</div>
|
||||||
<button type="add" class="btn btn-success"
|
<button type="add" class="btn btn-success"
|
||||||
(click)="addForceUnit(unit)"
|
(click)="addForceUnit(unit)"
|
||||||
>Add</button>
|
>Add</button>
|
||||||
|
@ -29,6 +29,7 @@ export class ArmyUpdateComponent implements OnInit {
|
|||||||
armyPoints: [],
|
armyPoints: [],
|
||||||
armyPointsOrPL: [],
|
armyPointsOrPL: [],
|
||||||
requisition: [],
|
requisition: [],
|
||||||
|
// armyCodexSpecificPoints: [],
|
||||||
battleTally: [],
|
battleTally: [],
|
||||||
battlesWon: [],
|
battlesWon: [],
|
||||||
ownerId: [null, Validators.required],
|
ownerId: [null, Validators.required],
|
||||||
@ -61,6 +62,7 @@ export class ArmyUpdateComponent implements OnInit {
|
|||||||
armyPoints: army.armyPoints,
|
armyPoints: army.armyPoints,
|
||||||
armyPointsOrPL: army.armyPointsOrPL,
|
armyPointsOrPL: army.armyPointsOrPL,
|
||||||
requisition: army.requisition,
|
requisition: army.requisition,
|
||||||
|
// armyCodexSpecificPoints: army.armyCodexSpecificPoints,
|
||||||
battleTally: army.battleTally,
|
battleTally: army.battleTally,
|
||||||
battlesWon: army.battlesWon,
|
battlesWon: army.battlesWon,
|
||||||
ownerId: army.ownerId,
|
ownerId: army.ownerId,
|
||||||
@ -104,10 +106,12 @@ export class ArmyUpdateComponent implements OnInit {
|
|||||||
armyDescription: this.editForm.get(['armyDescription'])!.value,
|
armyDescription: this.editForm.get(['armyDescription'])!.value,
|
||||||
armyName: this.editForm.get(['armyName'])!.value,
|
armyName: this.editForm.get(['armyName'])!.value,
|
||||||
armyFaction: this.editForm.get(['armyFaction'])!.value,
|
armyFaction: this.editForm.get(['armyFaction'])!.value,
|
||||||
|
// armyRace: this.editForm.get(['armyRace'])!.value,
|
||||||
armyPowerLevel: this.editForm.get(['armyPowerLevel'])!.value,
|
armyPowerLevel: this.editForm.get(['armyPowerLevel'])!.value,
|
||||||
armyPoints: this.editForm.get(['armyPoints'])!.value,
|
armyPoints: this.editForm.get(['armyPoints'])!.value,
|
||||||
armyPointsOrPL: this.editForm.get(['armyPointsOrPL'])!.value,
|
armyPointsOrPL: this.editForm.get(['armyPointsOrPL'])!.value,
|
||||||
requisition: this.editForm.get(['requisition'])!.value,
|
requisition: this.editForm.get(['requisition'])!.value,
|
||||||
|
// armyCodexSpecificPoints: this.editForm.get(['armyCodexSpecificPoints'])!.value,
|
||||||
battleTally: this.editForm.get(['battleTally'])!.value,
|
battleTally: this.editForm.get(['battleTally'])!.value,
|
||||||
battlesWon: this.editForm.get(['battlesWon'])!.value,
|
battlesWon: this.editForm.get(['battlesWon'])!.value,
|
||||||
ownerId: this.editForm.get(['ownerId'])!.value,
|
ownerId: this.editForm.get(['ownerId'])!.value,
|
||||||
|
@ -19,11 +19,13 @@ export class ForceComponent implements OnInit {
|
|||||||
units?: UnitArmy[] | null;
|
units?: UnitArmy[] | null;
|
||||||
public isMobileResolution: boolean;
|
public isMobileResolution: boolean;
|
||||||
responsiveService: ResponsiveService = new ResponsiveService();
|
responsiveService: ResponsiveService = new ResponsiveService();
|
||||||
|
localUnits: IUnitArmy[] | [];
|
||||||
|
|
||||||
constructor(protected dataUtils: JhiDataUtils, protected activatedRoute: ActivatedRoute, protected unitArmyService: UnitArmyService) {
|
constructor(protected dataUtils: JhiDataUtils, protected activatedRoute: ActivatedRoute, protected unitArmyService: UnitArmyService) {
|
||||||
const localStorageList = localStorage.getItem('forceAddedListStored');
|
const localStorageList = localStorage.getItem('forceAddedListStored');
|
||||||
this.forceList = localStorageList ? JSON.parse(localStorageList) : [];
|
this.forceList = localStorageList ? JSON.parse(localStorageList) : [];
|
||||||
this.isMobileResolution = this.responsiveService.getMobileStatus();
|
this.isMobileResolution = this.responsiveService.getMobileStatus();
|
||||||
|
this.localUnits = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@ -32,7 +34,22 @@ export class ForceComponent implements OnInit {
|
|||||||
|
|
||||||
loadAll(): void {
|
loadAll(): void {
|
||||||
for (let lookupUnitId of this.forceList) {
|
for (let lookupUnitId of this.forceList) {
|
||||||
this.unitArmyService.query(lookupUnitId).subscribe((res: HttpResponse<UnitArmy[]>) => (this.units = res.body));
|
// @ts-ignore
|
||||||
|
this.unitArmyService.find(lookupUnitId).subscribe((res: HttpResponse<IUnitArmy>) => (this.localUnits?.push(res.body)));
|
||||||
|
// this.unitArmyService.query(lookupUnitId).subscribe((res: HttpResponse<UnitArmy[]>) => (this.units = res.body));
|
||||||
|
// console.log(this.units.))
|
||||||
|
// console.log(lookupUnitId)
|
||||||
|
// console.log(this.units)
|
||||||
|
// this.unitArmyService.query(lookupUnitId).subscribe((res: HttpResponse<UnitArmy[]>) => (console.log(res.body)));
|
||||||
|
//this.units is full list of units
|
||||||
|
// @ts-ignore
|
||||||
|
// for (const _unit of this.units) {
|
||||||
|
// console.log(_unit.id)
|
||||||
|
// console.log(lookupUnitId)
|
||||||
|
// if (_unit.id === lookupUnitId) {
|
||||||
|
// this.localUnits.push(_unit);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
lookupUnitId = 1;
|
lookupUnitId = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,19 @@
|
|||||||
formControlName="unitName"/>
|
formControlName="unitName"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-control-label" for="field_battlefieldRole">Battlefield Role</label>
|
||||||
|
<select class="form-control" id="field_battlefieldRole" name="battlefieldRole" formControlName="battlefieldRole">
|
||||||
|
<option value="HQ">HQ</option>
|
||||||
|
<option value="Troop">Troop</option>
|
||||||
|
<option value="Elite">Elite</option>
|
||||||
|
<option value="Fast Attack">Fast Attack</option>
|
||||||
|
<option value="Flyer">Flyer</option>
|
||||||
|
<option value="Superheavy">Superheavy</option>
|
||||||
|
<option value="Fortification">Fortification</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-control-label" for="field_unitDescription">Unit Description</label>
|
<label class="form-control-label" for="field_unitDescription">Unit Description</label>
|
||||||
<textarea class="form-control" name="unitDescription" id="field_unitDescription"
|
<textarea class="form-control" name="unitDescription" id="field_unitDescription"
|
||||||
|
@ -5,10 +5,12 @@ export interface IArmy {
|
|||||||
armyDescription?: any;
|
armyDescription?: any;
|
||||||
armyName?: string;
|
armyName?: string;
|
||||||
armyFaction?: string;
|
armyFaction?: string;
|
||||||
|
// armyRace?: string;
|
||||||
armyPowerLevel?: number;
|
armyPowerLevel?: number;
|
||||||
armyPoints?: number;
|
armyPoints?: number;
|
||||||
armyPointsOrPL?: boolean;
|
armyPointsOrPL?: boolean;
|
||||||
requisition?: number;
|
requisition?: number;
|
||||||
|
// armyCodexSpecificPoints?: number;
|
||||||
battleTally?: number;
|
battleTally?: number;
|
||||||
battlesWon?: number;
|
battlesWon?: number;
|
||||||
ownerLogin?: string;
|
ownerLogin?: string;
|
||||||
@ -22,12 +24,14 @@ export class Army implements IArmy {
|
|||||||
public armyDescription?: any,
|
public armyDescription?: any,
|
||||||
public armyName?: string,
|
public armyName?: string,
|
||||||
public armyFaction?: string,
|
public armyFaction?: string,
|
||||||
|
// public armyRace?: string,
|
||||||
public armyPowerLevel?: number,
|
public armyPowerLevel?: number,
|
||||||
public armyPoints?: number,
|
public armyPoints?: number,
|
||||||
public armyPointsOrPL?: boolean,
|
public armyPointsOrPL?: boolean,
|
||||||
public ownerId?: number,
|
public ownerId?: number,
|
||||||
public ownerLogin?: string,
|
public ownerLogin?: string,
|
||||||
public requisition?: number,
|
public requisition?: number,
|
||||||
|
// public armyCodexSpecificPoints?: number,
|
||||||
public battleTally?: number,
|
public battleTally?: number,
|
||||||
public battlesWon?: number,
|
public battlesWon?: number,
|
||||||
public units?: IUnitArmy[]
|
public units?: IUnitArmy[]
|
||||||
|
Loading…
Reference in New Issue
Block a user