+
{action.name.replaceAll("_", " ")}
-
+
{action.description
? action.description
: ""}
@@ -2813,6 +2820,8 @@ const ActionResponse = memo(({ apiResponse, ExampleBody, isLoggedIn, isLoaded })
const [responseTabIndex, setResponseTabIndex] = useState(0)
const [oldResponse, setOldResponse] = useState(apiResponse)
const [highlight, setHighlight] = useState(false)
+ const {themeMode } = useContext(Context)
+ const theme = getTheme(themeMode)
const MIN_HEIGHT = 50
@@ -2934,7 +2943,7 @@ const ActionResponse = memo(({ apiResponse, ExampleBody, isLoggedIn, isLoaded })
style={{
width: '100%',
height: height,
- backgroundColor: '#1a1a1a',
+ backgroundColor: theme.palette.backgroundColor,
display: 'flex',
flexDirection: 'column',
borderTop: '1px solid rgba(255,255,255,0.2)',
@@ -2988,7 +2997,7 @@ const ActionResponse = memo(({ apiResponse, ExampleBody, isLoggedIn, isLoaded })
{
+
+ const {themeMode } = useContext(Context)
+ const theme = getTheme(themeMode)
+
const handleReactJsonClipboard = (copy) => {
const elementName = "copy_element_shuffle";
let copyText = document.getElementById(elementName);
@@ -3036,7 +3049,7 @@ const ResponseTabWrapper = memo(({ apiResponse }) => {
{
return collapseField(jsonField)
}}
@@ -3049,7 +3062,8 @@ const ResponseTabWrapper = memo(({ apiResponse }) => {
)})
const PaddingWrapper = memo(({ isLoggedIn, isLoaded, children }) => {
- const { leftSideBarOpenByClick, windowWidth } = useContext(Context);
+ const { leftSideBarOpenByClick, windowWidth, themeMode } = useContext(Context);
+ const theme = getTheme(themeMode)
return (
{
? windowWidth >= 1920 ? "calc(100% - 630px)" : "calc(100% - 570px)"
: windowWidth >= 1920 ? "calc(100vw - 460px)": "calc(100% - 410px)"
: windowWidth >= 1920 ? "calc(100% - 370px)" : "calc(100% - 320px)",
- backgroundColor: "#1a1a1a",
+ backgroundColor: theme.palette.backgroundColor,
position: "fixed",
bottom: 0,
right: 0,
diff --git a/frontend/src/components/AppAuthTab.jsx b/frontend/src/components/AppAuthTab.jsx
index f5821a1f..8c65366e 100644
--- a/frontend/src/components/AppAuthTab.jsx
+++ b/frontend/src/components/AppAuthTab.jsx
@@ -13,7 +13,7 @@ import {
} from "@mui/icons-material";
import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";
-import theme from "../theme.jsx";
+import {getTheme} from "../theme.jsx";
import Markdown from "react-markdown";
import AuthenticationOauth2 from "../components/Oauth2Auth.jsx";
import { isMobile } from "react-device-detect"
@@ -66,7 +66,7 @@ import { Context } from '../context/ContextApi.jsx';
const searchClient = algoliasearch(
"JNSS5CFDZZ",
- "db08e40265e2941b9a7d8f644b6e5240"
+ "c8f882473ff42d41158430be09ec2b4e"
)
const AppAuthTab = memo((props) => {
@@ -83,16 +83,17 @@ const AppAuthTab = memo((props) => {
const [appAuthenticationGroupId, setAppAuthenticationGroupId] = React.useState("");
const [appAuthenticationGroups, setAppAuthenticationGroups] = React.useState([]);
const [appAuthenticationGroupName, setAppAuthenticationGroupName] = React.useState("");
+ const [selectedSubOrg, setSelectedSubOrg] = useState([]);
const [appAuthenticationGroupDescription, setAppAuthenticationGroupDescription] = React.useState("");
const [appsForAppAuthGroup, setAppsForAppAuthGroup] = React.useState([]);
const [searchQuery, setSearchQuery] = React.useState("");
const [showAppModal, setShowAppModal] = useState(false)
+ const [selectedAuthId, setSelectedAuthId] = useState("");
+ const [showDistributionPopup, setShowDistributionPopup] = useState(false);
const [showAuthenticationLoader, setShowAuthenticationLoader] = useState(true)
- const [showAppAuthGroupLoader, setShowAppAuthGroupLoader] = useState(true)
- const changeDistribution = (data) => {
- //changeDistributed(data, !isDistributed)
- editAuthenticationConfig(data.id, "suborg_distribute")
- }
+ const [showAppAuthGroupLoader, setShowAppAuthGroupLoader] = useState(true)
+ const { themeMode, supportEmail, brandColor } = useContext(Context)
+ const theme = getTheme(themeMode, brandColor)
useEffect(() => {
getAppAuthentication();
@@ -212,11 +213,39 @@ const AppAuthTab = memo((props) => {
});
};
- const editAuthenticationConfig = (id, parentAction) => {
+ const handleSelectSubOrg = (id, action) => {
+ if (action === "all") {
+ const childOrgs = userdata.orgs.filter(
+ (data) => data.creator_org === userdata.active_org.id
+ );
+ setSelectedSubOrg((prev) => {
+ if (prev.length === childOrgs.length) {
+ // If all child orgs are already selected, clear the selection
+ return [];
+ } else {
+ // Otherwise, select all child org IDs
+ return childOrgs.map((data) => data.id);
+ }
+ });
+ } else if (action === "none") {
+ setSelectedSubOrg([]);
+ } else {
+ setSelectedSubOrg((prev) => {
+ if (prev.includes(id)) {
+ return prev.filter((data) => data !== id);
+ } else {
+ return [...prev, id];
+ }
+ });
+ }
+ };
+
+ const editAuthenticationConfig = (id, parentAction, selectedSuborgs) => {
const data = {
id: id,
action: parentAction !== undefined && parentAction !== null ? parentAction : "assign_everywhere",
- }
+ selected_suborgs: selectedSuborgs !== undefined && selectedSuborgs !== null ? selectedSuborgs : [],
+ }
const url = globalUrl + "/api/v1/apps/authentication/" + id + "/config";
@@ -238,6 +267,7 @@ const AppAuthTab = memo((props) => {
} else {
toast("Successfully updated auth!");
setSelectedUserModalOpen(false);
+ setShowDistributionPopup(false);
setTimeout(() => {
getAppAuthentication();
}, 1000);
@@ -249,6 +279,106 @@ const AppAuthTab = memo((props) => {
});
};
+
+ const changeDistribution = (id, selectedSubOrg) => {
+
+ editAuthenticationConfig(id, "suborg_distribute", [...new Set(selectedSubOrg)])
+ }
+
+
+ const cacheDistributionModal = showDistributionPopup ? (
+
+ ) : null;
+
const editAuthenticationModal = selectedAuthenticationModalOpen ? (