Skip to content

Commit 1fc103c

Browse files
authored
Merge pull request #913 from utmstack/bugfix/10.5.17/Unable-to-change-status-to-complete-if-observations-contain-french-characters
Unable to change status to complete if observations contain french characters
2 parents e40cc08 + 8c27ca1 commit 1fc103c

File tree

72 files changed

+211
-2222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+211
-2222
lines changed

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# UTMStack 10.5.17 Release Notes
1+
# UTMStack 10.5.18 Release Notes
22
## Bugfix
3-
-Fixed an issue preventing incident status updates when entering long solutions.
4-
-Fixed an issue blocking incident creation from the Alerts panel.
5-
-Added Asia/Jakarta timezone to the TIMEZONES list.
6-
-Fixed Timezone changes on an instance don't get updated when access by Federation Server
7-
-Fixed Last log not displayed for a generated alert
3+
-Fixed unable-to-change-status-to-complete-if-observations-contain-french-characters.
4+
-Fixed Elastic filter time adds unnecessary /d to intervals in Log Explorer
5+
-Fixed handle special characters in password query parameter
6+
-Fixed filter duplication issue in Log Explorer when removing filters
7+

backend/src/main/java/com/park/utmstack/service/impl/UtmAlertServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.park.utmstack.service.elasticsearch.ElasticsearchService;
2222
import com.park.utmstack.service.elasticsearch.SearchUtil;
2323
import com.park.utmstack.service.soc_ai.SocAIService;
24+
import com.park.utmstack.util.UnicodeReplacer;
2425
import com.park.utmstack.util.enums.AlertStatus;
2526
import com.park.utmstack.util.events.RulesEvaluationEndEvent;
2627
import com.park.utmstack.util.exceptions.DashboardOverviewException;
@@ -187,6 +188,8 @@ public void updateStatus(List<String> alertIds, int status, String statusObserva
187188
String script = String.format(ruleScript, status,
188189
AlertStatus.getByCode(status).getName(), StringEscapeUtils.escapeJava(statusObservation));
189190

191+
script = UnicodeReplacer.replaceUnicode(script);
192+
190193
elasticsearchService.updateByQuery(SearchUtil.toQuery(filters),
191194
Constants.SYS_INDEX_PATTERN.get(SystemIndexPattern.ALERTS), script);
192195
} catch (Exception e) {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.park.utmstack.util;
2+
3+
import java.util.regex.Matcher;
4+
import java.util.regex.Pattern;
5+
6+
public class UnicodeReplacer {
7+
// Pattern to detect Unicode sequences like \u00E9
8+
private static final Pattern UNICODE_PATTERN = Pattern.compile("\\\\u([0-9A-Fa-f]{4})");
9+
10+
/**
11+
* Method to replace Unicode sequences with their corresponding characters.
12+
*
13+
* @param input The text containing Unicode sequences.
14+
* @return The text with Unicode sequences replaced by their actual characters.
15+
*/
16+
public static String replaceUnicode(String input) {
17+
Matcher matcher = UNICODE_PATTERN.matcher(input);
18+
StringBuffer result = new StringBuffer();
19+
20+
while (matcher.find()) {
21+
// Converts the Unicode sequence to its equivalent character
22+
String unicode = matcher.group(1);
23+
char character = (char) Integer.parseInt(unicode, 16);
24+
matcher.appendReplacement(result, String.valueOf(character));
25+
}
26+
27+
matcher.appendTail(result);
28+
return result.toString();
29+
}
30+
31+
}
32+

backend/src/main/resources/config/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spring:
4444
cache: false
4545

4646
server:
47-
port: 8080
47+
port: 8081
4848

4949
jhipster:
5050
# CORS is only enabled by default with the "dev" profile

backend/src/main/resources/config/liquibase/changelog/20241120001_update_compliance_menu.xml

Lines changed: 0 additions & 20 deletions
This file was deleted.

backend/src/main/resources/config/liquibase/master.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,4 @@
6767

6868
<include file="/config/liquibase/changelog/20241122001_alter_action_detail_length.xml" relativeToChangelogFile="false"/>
6969

70-
<include file="/config/liquibase/changelog/20241120001_update_compliance_menu.xml" relativeToChangelogFile="false"/>
71-
72-
7370
</databaseChangeLog>

frontend/src/app/app.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ export class AppComponent implements OnInit {
120120
}
121121

122122
isInExportRoute() {
123-
return this.router.url.includes('dashboard/export/') ||
124-
this.router.url.includes('dashboard/export-compliance') ||
125-
this.router.url.includes('compliance/print-view') ||
123+
return this.router.url.includes('dashboard/export/') || this.router.url.includes('dashboard/export-compliance') ||
126124
this.router.url.includes('/getting-started') ||
127125
this.router.url.includes('/dashboard/export-report/') || this.iframeView || this.router.url.includes('/data/alert/detail/');
128126
}

frontend/src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {NewAlertBehavior} from './shared/behaviors/new-alert.behavior';
3535
import {TimezoneFormatService} from './shared/services/utm-timezone.service';
3636
import {UtmSharedModule} from './shared/utm-shared.module';
3737
import {AccountService} from "./core/auth/account.service";
38-
import {AlertManagementSharedModule} from "./data-management/alert-management/shared/alert-management-shared.module";
3938

4039
export function initTimezoneFormat(timezoneService: TimezoneFormatService) {
4140
return () => timezoneService.loadTimezoneAndFormat();
@@ -74,7 +73,6 @@ export function initTimezoneFormat(timezoneService: TimezoneFormatService) {
7473
Ng2TelInputModule,
7574
NgxFlagIconCssModule,
7675
Ng2Webstorage.forRoot(),
77-
AlertManagementSharedModule,
7876
],
7977
providers: [
8078
LocalStorageService,

frontend/src/app/compliance/compliance-report-viewer/compliance-report-viewer.component.css

Lines changed: 0 additions & 43 deletions
This file was deleted.

frontend/src/app/compliance/compliance-report-viewer/compliance-report-viewer.component.html

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)