Skip to content

Commit de5abcc

Browse files
authored
Merge pull request #1104 from utmstack/bugfix/10.7.1/add-organization-name-settings
Bugfix/10.7.1/add organization name settings
2 parents 0ac9a0c + 4dc3ddd commit de5abcc

File tree

16 files changed

+124
-42
lines changed

16 files changed

+124
-42
lines changed

CHANGELOG.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# UTMStack 10.7.1 Release Notes
22

33
### Bug Fixes
4-
- Fixed responsive text alignment for action buttons in Log Explorer to enhance visual consistency.
4+
-- Fixed responsive text alignment for action buttons in Log Explorer to enhance visual consistency.
5+
-- Fixed issues with loading data from saved queries in Log Explorer, ensuring the correct filter values are applied.
6+
-- Fixed issue where tabs remained open when navigating outside the Log Explorer scope to improve user experience.
7+
-- Fixed time filter issue where the date range was not applied correctly.
8+
-- Fixed incorrect query behavior when filtering incidents by ID.
9+
510

611
## New Features and Improvements
7-
- Added organization name in app settings to distinguish alert and notification emails for better clarity.
8-
- Enhanced the email notification system by including the organization name to improve recipient identification.
9-
- Introduced new compliance reports aligned with the PCI DSS standard to expand auditing capabilities.
10-
- Resolves issues with malformed queries when filtering incidents by id.
12+
-- Added organization name in app settings to distinguish alert and notification emails for better clarity.
13+
-- Enhanced the email notification system by including the organization name to improve recipient identification.
14+
-- Introduced new compliance reports aligned with the PCI DSS standard to expand auditing capabilities.
15+
-- Added new menu item **New Dashboard**.
16+
-- Added new menu item **New Visualization**.

backend/src/main/java/com/park/utmstack/service/mail_config/MailConfigService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public MailConfig getMailConfigFromParameters(List<UtmConfigurationParameter> pa
1818
mailConfig.setUsername(getParamValue(parameters, Constants.PROP_MAIL_USERNAME));
1919
mailConfig.setPassword(getParamValue(parameters, Constants.PROP_MAIL_PASSWORD));
2020
mailConfig.setAuthType(getParamValue(parameters, Constants.PROP_MAIL_SMTP_AUTH));
21-
mailConfig.setFrom(String.valueOf(new InternetAddress(Constants.CFG.get(Constants.PROP_MAIL_FROM), getParamValue(parameters, Constants.PROP_MAIL_ORGNAME))));
21+
mailConfig.setFrom(String.valueOf(new InternetAddress(getParamValue(parameters, Constants.PROP_MAIL_FROM), getParamValue(parameters, Constants.PROP_MAIL_ORGNAME))));
2222
mailConfig.setPort(Integer.parseInt(getParamValue(parameters, Constants.PROP_MAIL_PORT)));
2323

2424
return mailConfig;

backend/src/main/resources/config/liquibase/changelog/20250319001_add_organization_field_config_params.xml renamed to backend/src/main/resources/config/liquibase/changelog/20250319002_add_organization_field_config_params.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
66

7-
<changeSet id="20250319001" author="Manuel">
7+
<changeSet id="20250319002" author="Manuel">
88
<sql>
99
<![CDATA[
1010
INSERT INTO utm_configuration_parameter (id, section_id, conf_param_short, conf_param_large, conf_param_description, conf_param_value, conf_param_required, conf_param_datatype, modification_time, modification_user, conf_param_option, conf_param_regexp)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6+
7+
<changeSet id="20250325001" author="Manuel">
8+
<sql>
9+
<![CDATA[
10+
11+
INSERT INTO utm_menu (id, name, url, parent_id, type, dashboard_id, position, menu_active, menu_action, menu_icon, module_name_short)
12+
VALUES (118, 'New Dashboard', '/creator/dashboard/builder', 100, 1, null, 2, true, true, null, null);
13+
14+
INSERT INTO utm_menu (id, name, url, parent_id, type, dashboard_id, position, menu_active, menu_action, menu_icon, module_name_short)
15+
VALUES (119, 'New Visualization', '/creator/visualization/list?onInitAction=showCreateModal', 100, 1, null, 3, true, true, null, null);
16+
17+
18+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (118, 'ROLE_ADMIN');
19+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (118, 'ROLE_USER');
20+
21+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (119, 'ROLE_ADMIN');
22+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (119, 'ROLE_USER');
23+
24+
]]>
25+
</sql>
26+
</changeSet>
27+
28+
</databaseChangeLog>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@
7777

7878
<include file="/config/liquibase/changelog/20250303001_udpate_sophos_guide.xml" relativeToChangelogFile="false"/>
7979

80-
<include file="/config/liquibase/changelog/20250319001_add_organization_field_config_params.xml" relativeToChangelogFile="false"/>
80+
<include file="/config/liquibase/changelog/20250319002_add_organization_field_config_params.xml" relativeToChangelogFile="false"/>
8181

8282
<include file="/config/liquibase/changelog/20250319001_add_compliance_report.xml" relativeToChangelogFile="false"/>
8383

84+
<include file="/config/liquibase/changelog/20250325001_add_create_dashboard_visualization_menu.xml" relativeToChangelogFile="false"/>
85+
8486
</databaseChangeLog>

frontend/src/app/log-analyzer/explorer/log-analyzer-tabs/log-analyzer-tabs.component.ts

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import {TabService} from '../../shared/services/tab.service';
1010
import {LogAnalyzerQueryType} from '../../shared/type/log-analyzer-query.type';
1111
import {TabType} from '../../shared/type/tab.type';
1212
import {LogAnalyzerViewComponent} from '../log-analyzer-view/log-analyzer-view.component';
13+
import {
14+
ElasticFilterDefaultTime
15+
} from "../../../shared/components/utm/filters/elastic-filter-time/elastic-filter-time.component";
1316

1417
@Component({
1518
selector: 'app-log-analyzer-tabs',
@@ -32,23 +35,6 @@ export class LogAnalyzerTabsComponent implements OnInit, OnDestroy {
3235
private indexPatternBehavior: IndexPatternBehavior
3336
) {}
3437

35-
/*ngOnInit() {
36-
this.activatedRoute.queryParams.subscribe(params => {
37-
this.queryId = params.queryId;
38-
const tabName = params.active || null;
39-
if (this.queryId) {
40-
this.logAnalyzerQueryService.find(this.queryId).subscribe(vis => {
41-
this.query = vis.body;
42-
this.addNewTab(this.query.name, this.query, params);
43-
});
44-
} else {
45-
if (tabName) {
46-
this.tabService.deleteActiveTab();
47-
}
48-
this.addNewTab();
49-
}
50-
});*/
51-
5238
ngOnInit(): void {
5339
this.activatedRoute.queryParams
5440
.pipe(takeUntil(this.destroy$))
@@ -103,15 +89,31 @@ export class LogAnalyzerTabsComponent implements OnInit, OnDestroy {
10389
new UtmIndexPattern(1, 'log-*', true);
10490

10591
this.tabService.addTab(
106-
new TabType(LogAnalyzerViewComponent, (tabName ? tabName : 'New query ' + this.tabNumber),
107-
query ? query : {pattern}, true, null, uuid)
92+
new TabType(
93+
LogAnalyzerViewComponent,
94+
(tabName ? tabName : 'New query ' + this.tabNumber),
95+
query ? query : {pattern},
96+
true,
97+
null,
98+
uuid,
99+
this.getDefaultTime(query))
108100
);
109101

110102
if (tabName && pattern) {
111103
this.indexPatternBehavior.changePattern({pattern, tabUUID: uuid});
112104
}
113105
}
114106

107+
getDefaultTime(query: LogAnalyzerQueryType): ElasticFilterDefaultTime {
108+
if (query) {
109+
const timestampFilter = query.filtersType.find(f => f.field === '@timestamp');
110+
return timestampFilter ? new ElasticFilterDefaultTime(timestampFilter.value[0], timestampFilter.value[1]) :
111+
new ElasticFilterDefaultTime('now-24h', 'now');
112+
} else {
113+
return new ElasticFilterDefaultTime('now-24h', 'now');
114+
}
115+
}
116+
115117
removeTab(index: number): void {
116118
this.tabService.removeTab(index);
117119
}

frontend/src/app/log-analyzer/explorer/log-analyzer-view/log-analyzer-view.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
(onSaveQuery)="saveQuery()"
4646
[filters]="filters"
4747
[template]="'log-explorer'"
48-
*ngIf="defaultTime && pattern;else loadingPattern"
48+
*ngIf="defaultTime && pattern; else loadingPattern"
4949
[pattern]="pattern.pattern"
5050
[defaultTime]="defaultTime"
5151
class="flex-grow-1"></app-utm-elastic-filter>

frontend/src/app/log-analyzer/explorer/log-analyzer-view/log-analyzer-view.component.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@ app-log-analyzer-field {
1212
}
1313

1414
.search-container {
15-
flex-basis: 65%;
15+
flex-basis: 50%;
16+
}
17+
18+
@media screen and (min-width: 1550px) and (max-width: 1599px) {
19+
.search-container {
20+
flex-basis: 55%;
21+
}
22+
}
23+
24+
@media screen and (min-width: 1600px) {
25+
.search-container {
26+
flex-basis: 65%;
27+
}
1628
}
1729

1830
.btn-refresh {

frontend/src/app/log-analyzer/explorer/log-analyzer-view/log-analyzer-view.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {LogAnalyzerQueryType} from '../../shared/type/log-analyzer-query.type';
4949
export class LogAnalyzerViewComponent implements OnInit, OnDestroy {
5050
@Input() data: LogAnalyzerQueryType;
5151
@Input() uuid: string;
52+
@Input() defaultTime: ElasticFilterDefaultTime = new ElasticFilterDefaultTime('now-24h', 'now');
5253
fields: UtmFieldType[] = [];
5354
rows: any[] = [];
5455
page = 1;
@@ -79,7 +80,6 @@ export class LogAnalyzerViewComponent implements OnInit, OnDestroy {
7980
private sortBy = NatureDataPrefixEnum.TIMESTAMP + ',' + 'desc';
8081
patterns: UtmIndexPattern[];
8182
paramLoaded = false;
82-
defaultTime: ElasticFilterDefaultTime = new ElasticFilterDefaultTime('now-24h', 'now');
8383
dateFormat$: Observable<DatePipeDefaultOptions>;
8484
destroy$ = new Subject<void>();
8585
filterWidth: number;
@@ -96,8 +96,7 @@ export class LogAnalyzerViewComponent implements OnInit, OnDestroy {
9696
private elasticDataExportService: ElasticDataExportService,
9797
private timezoneFormatService: TimezoneFormatService,
9898
private logFilterBehavior: LogFilterBehavior,
99-
private router: Router,
100-
private tabService: TabService) {
99+
private router: Router) {
101100

102101
this.detailWidth = (this.pageWidth - 310);
103102
}

frontend/src/app/log-analyzer/queries/log-analyzer-query-list/log-analyzer-query-list.component.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
import {HttpResponse} from '@angular/common/http';
2-
import {Component, OnInit} from '@angular/core';
3-
import {Router} from '@angular/router';
2+
import {Component, OnDestroy, OnInit} from '@angular/core';
3+
import {NavigationStart, Router} from '@angular/router';
44
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
5+
import {Subject} from 'rxjs';
6+
import {filter, takeUntil, tap} from 'rxjs/operators';
57
import {ITEMS_PER_PAGE} from '../../../shared/constants/pagination.constants';
68
import {SortEvent} from '../../../shared/directives/sortable/type/sort-event';
79
import {SortByType} from '../../../shared/types/sort-by.type';
810
import {LogAnalyzerQueryService} from '../../shared/services/log-analyzer-query.service';
11+
import {TabService} from '../../shared/services/tab.service';
912
import {LogAnalyzerQueryType} from '../../shared/type/log-analyzer-query.type';
1013
import {LogAnalyzerQueryDeleteComponent} from '../log-analyzer-query-delete/log-analyzer-query-delete.component';
14+
import {query} from "@angular/animations";
15+
import {data} from "../../../active-directory/offline.data";
1116

1217
@Component({
1318
selector: 'app-log-analyzer-query-list',
1419
templateUrl: './log-analyzer-query-list.component.html',
1520
styleUrls: ['./log-analyzer-query-list.component.scss']
1621
})
17-
export class LogAnalyzerQueryListComponent implements OnInit {
22+
export class LogAnalyzerQueryListComponent implements OnInit, OnDestroy {
1823
fields: SortByType[] = [
1924
{
2025
fieldName: 'Name',
@@ -34,10 +39,12 @@ export class LogAnalyzerQueryListComponent implements OnInit {
3439
query: LogAnalyzerQueryType;
3540
private requestParams: any;
3641
private sortBy: SortEvent;
42+
destroy$ = new Subject<void>();
3743

3844
constructor(private logAnalyzerQueryService: LogAnalyzerQueryService,
3945
private router: Router,
40-
private modalService: NgbModal) {
46+
private modalService: NgbModal,
47+
private tabService: TabService) {
4148
}
4249

4350
ngOnInit() {
@@ -47,6 +54,16 @@ export class LogAnalyzerQueryListComponent implements OnInit {
4754
sort: this.sortBy,
4855
};
4956
this.getQueryList();
57+
58+
this.router.events.pipe(
59+
filter(event => event instanceof NavigationStart),
60+
tap((event: NavigationStart) => {
61+
if (event.url !== '/discover/log-analyzer-queries' && !event.url.includes('/discover/log-analyzer')) {
62+
this.tabService.closeAllTabs();
63+
}
64+
}),
65+
takeUntil(this.destroy$)
66+
).subscribe();
5067
}
5168

5269
onSearchQuery($event: string) {
@@ -65,7 +82,7 @@ export class LogAnalyzerQueryListComponent implements OnInit {
6582
queryId: query.id,
6683
queryName: query.name.toLowerCase().replace(' ', '_'),
6784
patternId: query.pattern.id,
68-
indexPattern: query.pattern.pattern
85+
indexPattern: query.pattern.pattern,
6986
}
7087
});
7188
}
@@ -98,4 +115,9 @@ export class LogAnalyzerQueryListComponent implements OnInit {
98115

99116
private onError(body: any) {
100117
}
118+
119+
ngOnDestroy(): void {
120+
this.destroy$.next();
121+
this.destroy$.complete();
122+
}
101123
}

0 commit comments

Comments
 (0)