From 1e002a3ab6cf7f97d5fff4f6ddb5cb0923b6b467 Mon Sep 17 00:00:00 2001 From: charles-ramos Date: Mon, 3 Aug 2026 13:34:03 -0300 Subject: [PATCH] update-security --- .../AppSecurityReport.react.js | 21 +++++++++++++------ src/lib/ParseApp.js | 4 ++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/dashboard/AppSecurityReport/AppSecurityReport.react.js b/src/dashboard/AppSecurityReport/AppSecurityReport.react.js index 397e3c1ebd..b7ca6b7e68 100644 --- a/src/dashboard/AppSecurityReport/AppSecurityReport.react.js +++ b/src/dashboard/AppSecurityReport/AppSecurityReport.react.js @@ -14,6 +14,8 @@ import styles from './AppSecurityReport.scss'; import DashboardView from 'dashboard/DashboardView.react'; import stylesTable from 'dashboard/TableView.scss'; import B4aLoaderContainer from 'components/B4aLoaderContainer/B4aLoaderContainer.react'; +import Icon from 'components/Icon/Icon.react'; +import browserStyles from 'dashboard/Data/Browser/Browser.scss'; @withRouter @@ -24,6 +26,7 @@ class AppSecurityReport extends DashboardView { this.subsection = 'Security'; this.state = { isLoadingSecurityReport: true, + loading: true, securityReport: null, securityReportError: null, }; @@ -48,11 +51,12 @@ class AppSecurityReport extends DashboardView { } onRefresh() { - this.loadData(); + this.loadData(true); } - loadData() { - this.context.getSecurityReport().then(res => { + loadData(refresh = false) { + this.setState({ loading: true, securityReportError: null }); + this.context.getSecurityReport(refresh).then(res => { this.setState({ securityReport: res, }); @@ -61,16 +65,21 @@ class AppSecurityReport extends DashboardView { securityReportError: new Error(err.message || err.msg || 'Something went wrong'), }); }).finally(() => { - this.setState({ isLoadingSecurityReport: false }); + this.setState({ isLoadingSecurityReport: false, loading: false }); }); } renderToolbar() { return ( - {/* + - */} + ); } diff --git a/src/lib/ParseApp.js b/src/lib/ParseApp.js index bb3ca2ee3a..5524a3fa63 100644 --- a/src/lib/ParseApp.js +++ b/src/lib/ParseApp.js @@ -1636,12 +1636,12 @@ export default class ParseApp { } } - async getSecurityReport() { + async getSecurityReport(refresh = false) { try { return ( await axios.get( // eslint-disable-next-line no-undef - `${b4aSettings.BACK4APP_API_PATH}/security-report/${this.slug}?fromdashboard=true`, + `${b4aSettings.BACK4APP_API_PATH}/security-report/${this.slug}?fromdashboard=true${refresh ? '&refresh=true' : ''}`, { withCredentials: true } ) ).data;