Skip to content

Commit

Permalink
WFNEWS-2203 WFIM-3176 : Visible Flames boolean (#2081)
Browse files Browse the repository at this point in the history
* Visible Flames boolean

* Fix dependencies
  • Loading branch information
sukhpalp committed Sep 20, 2024
1 parent d2ffbda commit 4da52bb
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 31 deletions.
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.bc.gov.nrs.wfnews</groupId>
<artifactId>wfnews-parent</artifactId>
<version>2.3.8</version>
<version>2.3.9</version>
<packaging>pom</packaging>
<name>wfnews-parent</name>
<modules>
Expand Down
2 changes: 1 addition & 1 deletion client/wfnews-ear/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>ca.bc.gov.nrs.wfnews</groupId>
<artifactId>wfnews-parent</artifactId>
<version>2.3.8</version>
<version>2.3.9</version>
</parent>
<artifactId>wfnews-ear</artifactId>
<packaging>ear</packaging>
Expand Down
2 changes: 1 addition & 1 deletion client/wfnews-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.bc.gov.nrs.wfnews</groupId>
<artifactId>wfnews-parent</artifactId>
<version>2.3.8</version>
<version>2.3.9</version>
</parent>
<artifactId>wfnews-war</artifactId>
<packaging>war</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 155
versionName "2.3.8"
versionName "2.3.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
2 changes: 1 addition & 1 deletion client/wfnews-war/src/main/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wildfire",
"version": "2.3.8",
"version": "2.3.9",
"license": "MIT",
"engines": {
"node": "^18.16.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"application": {
"wfnewsApiKey": "fake-api-key",
"acronym": "WFNEWS",
"version": "2.3.8-SNAPSHOT",
"version": "2.3.9-SNAPSHOT",
"buildNumber": ".0000",
"environment": "LOCAL",
"baseUrl": "http://localhost:6200/",
Expand Down
2 changes: 1 addition & 1 deletion server/wfnews-api/wfnews-service-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>ca.bc.gov.nrs.wfim</groupId>
<artifactId>wfim-incidents-api-rest-common</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.9.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<dependency>
<groupId>ca.bc.gov.nrs.wfim</groupId>
<artifactId>wfim-incidents-api-rest-common</artifactId>
<version>1.6.1</version>
<version>1.9.5-SNAPSHOT</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>ca.bc.gov.nrs.wfim</groupId>
<artifactId>wfim-incidents-api-rest-common</artifactId>
<version>1.6.1</version>
<version>1.9.5-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ public class RecordRoFServiceImpl implements RecordRoFService {
EmailNotificationService emailNotificationService;

private Date codeTableRefresh;
private String visibleFlameString = "Visible Flames = Yes; ";
private String noVisibleFlameString = "Visible Flames = No; ";
private String noCommentVisibleFlameString = "Visible Flames = N/C; ";
private String noCommentString = "No comments";
private FileService fileService;
private CodeTableListRsrc codeTables;
private Properties applicationProperties;
Expand Down Expand Up @@ -574,26 +570,18 @@ private String prepareRoF(JSONObject rofFormDataJson, ObjectMapper mapper)
rof.setSubmittedTimestamp(Date.from(submittedDateTime.atZone(ZoneId.systemDefault()).toInstant()));
}

// set default visible flame string as No Comment
String visibleFlame = noCommentVisibleFlameString;

if (rofFormDataJson.has("visibleFlame") && rofFormDataJson.optJSONArray("visibleFlame") != null) {
if (rofFormDataJson.optJSONArray("visibleFlame").isEmpty()) {
visibleFlame = noCommentVisibleFlameString;
} else if (rofFormDataJson.getJSONArray("visibleFlame").toString().replace("[", "").replace("]", "")
.replace("\"", "").equalsIgnoreCase("YES")) {
visibleFlame = visibleFlameString;
} else if (rofFormDataJson.getJSONArray("visibleFlame").toString().replace("[", "").replace("]", "")
.replace("\"", "").equalsIgnoreCase("NO")) {
visibleFlame = noVisibleFlameString;
}
}
Boolean visibleFlame = rofFormDataJson.has("visibleFlame")
&& rofFormDataJson.optJSONArray("visibleFlame") != null
&& rofFormDataJson.getJSONArray("visibleFlame").toString()
.replace("[", "").replace("]", "")
.replace("\"", "")
.equalsIgnoreCase("YES");
rof.setFlamesVisibleInd(visibleFlame);


if (rofFormDataJson.has("otherInfo") && !rofFormDataJson.optString("otherInfo", "").equals(""))
rof.setCallerReportDetails(visibleFlame + rofFormDataJson.optString("otherInfo"));
else if (rofFormDataJson.has("otherInfo") && rofFormDataJson.optString("otherInfo", "").equals(""))
rof.setCallerReportDetails(visibleFlame + noCommentString);
if (rofFormDataJson.has("otherInfo") && !rofFormDataJson.optString("otherInfo", "").isEmpty()) {
rof.setCallerReportDetails(rofFormDataJson.optString("otherInfo"));
}

logger.info(" ### START POST - Serializing and executing RoF POST...");
mapper.activateDefaultTyping(mapper.getPolymorphicTypeValidator(), ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT,
Expand Down

0 comments on commit 4da52bb

Please sign in to comment.