diff --git a/frontend/src/components/AdminNavBar.jsx b/frontend/src/components/AdminNavBar.jsx
index 2a480c95..fbbc391d 100644
--- a/frontend/src/components/AdminNavBar.jsx
+++ b/frontend/src/components/AdminNavBar.jsx
@@ -92,9 +92,14 @@ const AdminNavBar = (props) => {
const HandleVisibleTabs = () => {
if (userdata?.id?.length > 0) {
if (userdata?.active_org?.role === "admin" || userdata?.support) {
- setVisibleItems(items);
+ if (isChildOrg) {
+ const filteredItems = items.filter(item => item.text !== "Partner");
+ setVisibleItems(filteredItems);
+ }else {
+ setVisibleItems(items);
+ }
}else {
- const filteredItems = items.filter(item => item.text !== "Users" && item.text !== "Files" && item.text !== "Datastore" && item.text !== "Triggers" && item.text !== "Locations");
+ const filteredItems = items.filter(item => item.text !== "Users" && item.text !== "Files" && item.text !== "Datastore" && item.text !== "Triggers" && item.text !== "Locations" && item.text !== "Partner");
setVisibleItems(filteredItems);
}
}
@@ -105,12 +110,12 @@ const AdminNavBar = (props) => {
// Filter out Users and Tenants tabs
if (userdata?.active_org?.role === "admin" || userdata?.support) {
const filteredItems = items.filter(item =>
- item.text !== "Users" && item.text !== "Tenants"
+ item.text !== "Users" && item.text !== "Tenants" && item.text !== "Partner"
);
setVisibleItems(filteredItems);
}else {
const filteredItems = items.filter(item =>
- item.text !== "Users" && item.text !== "Tenants" && item.text !== "Files" && item.text !== "Datastore" && item.text !== "Triggers" && item.text !== "Locations"
+ item.text !== "Users" && item.text !== "Partner" && item.text !== "Tenants" && item.text !== "Files" && item.text !== "Datastore" && item.text !== "Triggers" && item.text !== "Locations"
);
setVisibleItems(filteredItems);
}
@@ -191,7 +196,7 @@ const AdminNavBar = (props) => {
const params = new URLSearchParams(location.search);
const tab = params?.get('tab')?.toLowerCase();
- if (tab === "users" || tab === "tenants") {
+ if (tab === "users" || tab === "tenants" || tab === "partner") {
toast.info("You are not allowed to access this tab. Please contact your admin for more information. Redirecting to Organization Configuration tab.");
setTimeout(() => {
setSelectedItem("Organization");
@@ -200,6 +205,7 @@ const AdminNavBar = (props) => {
}
, 3000);
}
+
} else if (userdata && isOrgLoaded && isUserDataLoaded && userdata?.active_org?.role !== "admin" && !userdata?.support) {
const queryParams = new URLSearchParams(location.search);
const tabName = queryParams?.get('admin_tab')?.toLowerCase();
diff --git a/frontend/src/components/AnalyticsTab.jsx b/frontend/src/components/AnalyticsTab.jsx
index c97560ed..c64dee56 100644
--- a/frontend/src/components/AnalyticsTab.jsx
+++ b/frontend/src/components/AnalyticsTab.jsx
@@ -2,7 +2,6 @@
// import Switch from '@mui/material/Switch';
// import { Typography, Button } from '@mui/material';
// import { useNavigate, Link, useParams } from "react-router-dom";
-// import { Bar } from 'react-chartjs-2';
// import Grid from '@mui/material/Grid';
// import SearchIcon from '@mui/icons-material/Search';
// import NewReleasesIcon from '@mui/icons-material/NewReleases';
diff --git a/frontend/src/components/Billing.jsx b/frontend/src/components/Billing.jsx
index 0b9daa6f..19698a13 100644
--- a/frontend/src/components/Billing.jsx
+++ b/frontend/src/components/Billing.jsx
@@ -94,9 +94,9 @@ const Billing = memo((props) => {
useEffect(() => {
if (userdata.app_execution_limit !== undefined && userdata.app_execution_usage !== undefined) {
- const percentage = (userdata.app_execution_usage / userdata.app_execution_limit) * 100;
+ const percentage = ((userdata.app_execution_usage + userdata.app_executions_suborgs) / userdata.app_execution_limit) * 100;
setCurrentAppRunsInPercentage(Math.round(percentage));
- setCurrentAppRunsInNumber(userdata.app_execution_limit - userdata.app_execution_usage);
+ setCurrentAppRunsInNumber(userdata.app_execution_limit - userdata.app_execution_usage - userdata.app_executions_suborgs);
}
if (userdata?.id?.length > 0 && isLoggedIn === false){
@@ -1860,19 +1860,6 @@ const Billing = memo((props) => {
const updateAlertThreshold = (index, field, value) => {
- if (field === 'percentage') {
- if (value > 100 || value < 0) {
- value = 0
- toast("The percentage value should be between 0 and 100")
- }
- } else if (field === 'count') {
- if (value < 0 || value >= userdata.app_execution_limit) {
- value = 0
- toast("The count value should be greater than 0 and less than the total app execution limit")
- }
- }
-
-
const totalValue = userdata.app_execution_limit;
const newAlertThresholds = alertThresholds.map((threshold, i) => {
if (i === index) {
@@ -2423,9 +2410,21 @@ const Billing = memo((props) => {
}}
/>