Skip to content

Commit 8e2da7d

Browse files
authored
Merge pull request #911 from utmstack/bugfix/10.5.13/compliance-report-module
Add compliance report viewer
2 parents e1c48f1 + dce6c3f commit 8e2da7d

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="20241120001" author="Manuel">
8+
<sql dbms="postgresql" splitStatements="true" stripComments="true">
9+
UPDATE utm_menu
10+
SET
11+
name = 'Overview',
12+
url = 'compliance/report-viewer'
13+
WHERE id = 505;
14+
15+
ALTER TABLE utm_compliance_report_config
16+
ADD COLUMN note TEXT;
17+
18+
</sql>
19+
</changeSet>
20+
</databaseChangeLog>

frontend/src/app/shared/components/auth/login/login.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {UtmToastService} from '../../../alert/utm-toast.service';
1212
import {MenuBehavior} from '../../../behaviors/menu.behavior';
1313
import {ThemeChangeBehavior} from '../../../behaviors/theme-change.behavior';
1414
import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE, DEMO_URL, USER_ROLE} from '../../../constants/global.constant';
15-
import {stringParamToQueryParams} from '../../../util/query-params-to-filter.util';
15+
import {extractQueryParamsForNavigation, stringParamToQueryParams} from '../../../util/query-params-to-filter.util';
1616
import {PasswordResetInitComponent} from '../password-reset/init/password-reset-init.component';
1717

1818
@Component({
@@ -100,7 +100,8 @@ export class LoginComponent implements OnInit {
100100
});
101101
});
102102
} else {
103-
this.router.navigate([route]);
103+
const { path, queryParams } = extractQueryParamsForNavigation(url);
104+
this.router.navigate([path], {queryParams});
104105
}
105106
}
106107
} else {

frontend/src/app/shared/util/query-params-to-filter.util.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,23 @@ export function getIndexPattern(param: string) {
162162
}
163163
return '';
164164
}
165+
166+
export function extractQueryParamsForNavigation(url: string): { path: string, queryParams: Record<string, string> } {
167+
const queryParamsStart = url.indexOf('?');
168+
169+
if (queryParamsStart !== -1) {
170+
const path = url.slice(0, queryParamsStart); // Obtén la ruta base
171+
const queryParamsString = url.slice(queryParamsStart + 1);
172+
const searchParams = new URLSearchParams(queryParamsString);
173+
const queryParams: Record<string, string> = {};
174+
175+
searchParams.forEach((value, key) => {
176+
queryParams[key] = value; // No decodifiques nada aquí
177+
});
178+
179+
return { path, queryParams };
180+
}
181+
182+
return { path: url, queryParams: {} }; // Si no hay parámetros, devuelve solo la ruta base
183+
}
184+

0 commit comments

Comments
 (0)