Minor fixes everywhere
This commit is contained in:
@@ -33,6 +33,9 @@ const AdminNavBar = (props) => {
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
//const leadinfo = selectedOrganization.lead_info === undefined || selectedOrganization.lead_info === null || selectedOrganization.lead_info === "" ? "" : JSON.stringify(selectedOrganization.lead_info)
|
||||
//const isPartner = leadinfo.includes("partner")
|
||||
|
||||
useEffect(() => {
|
||||
const queryParams = new URLSearchParams(location.search);
|
||||
const tabName = queryParams.get('tab');
|
||||
|
||||
@@ -61,7 +61,7 @@ const menuData = {
|
||||
description:
|
||||
"Connect and run actions seamlessly between different platforms.",
|
||||
icon: "/images/logos/singul.svg",
|
||||
path: "https://singul.io/",
|
||||
path: "https://singul-docs.gitbook.io/singul/getting-started",
|
||||
gaData: {
|
||||
category: "navbar",
|
||||
action: "products_click",
|
||||
|
||||
@@ -120,7 +120,7 @@ const OrganizationTab = (props) => {
|
||||
isLoaded={isLoaded}
|
||||
/>
|
||||
);
|
||||
case 'branding(beta)':
|
||||
case 'branding':
|
||||
return <Branding
|
||||
isCloud={isCloud}
|
||||
userdata={userdata}
|
||||
@@ -140,7 +140,7 @@ const OrganizationTab = (props) => {
|
||||
return (
|
||||
<div style={{ height: "100%", width: "100%", color: '#FFFFFF', backgroundColor: '#212121', borderTopRightRadius: '8px', borderBottomRightRadius: 8, borderLeft: "1px solid #494949", boxSizing: 'border-box' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-around', width: "100%", borderBottom: '1px solid #494949' ,boxSizing: 'border-box' }}>
|
||||
{['Org Configuration', "sso", "Notifications", 'Billing & Stats', 'Branding (Beta)'].map((tabName, index) => (
|
||||
{['Org Configuration', "sso", "Notifications", 'Billing & Stats', 'Branding'].map((tabName, index) => (
|
||||
<Tooltip
|
||||
key={index}
|
||||
title={
|
||||
|
||||
@@ -818,9 +818,18 @@ const ParsedAction = (props) => {
|
||||
if (foundResult) {
|
||||
const valid = validateJson(foundResult.result);
|
||||
if (valid.valid) {
|
||||
if (valid.result.success !== false) {
|
||||
exampleData = valid.result
|
||||
break
|
||||
|
||||
// Check if array, and if first item is object + success
|
||||
if (Array.isArray(valid.result) && valid.result.length > 0 && typeof valid.result[0] === "object") {
|
||||
if (valid.result[0].success !== false) {
|
||||
exampleData = valid.result[0]
|
||||
break
|
||||
}
|
||||
} else {
|
||||
if (valid.result.success !== false) {
|
||||
exampleData = valid.result
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
secondaryExample = foundResult.result
|
||||
|
||||
@@ -902,6 +902,8 @@ const CodeEditor = (props) => {
|
||||
// Whelp this is inefficient af. Single loop pls
|
||||
// When the found array is empty.
|
||||
if (found !== null && found !== undefined) {
|
||||
|
||||
//console.log("FOUND: ", found)
|
||||
try {
|
||||
for (var i = 0; i < found.length; i++) {
|
||||
try {
|
||||
@@ -936,28 +938,72 @@ const CodeEditor = (props) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find the location to ensure replacements happen correctly
|
||||
var foundlocation = -1
|
||||
for (var j = 0; j < input.length; j++) {
|
||||
const foundStringSize = fixedVariable.length
|
||||
const foundslice = input.slice(j, j + foundStringSize)
|
||||
//console.log("FOUNDSLICE: ", foundslice)
|
||||
if (fixedVariable !== foundslice) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Check if it matches EXACTLY or not, as there may be more AFTER the found[i]
|
||||
const nextchar = input.slice(j + foundStringSize, j + foundStringSize + 1)
|
||||
if (nextchar === ".") {
|
||||
continue
|
||||
}
|
||||
|
||||
foundlocation = j
|
||||
break
|
||||
}
|
||||
|
||||
// FIXME: There is something wrong here with:
|
||||
// $variable.#
|
||||
// vs
|
||||
// $variable.#.subvalue
|
||||
// if you put both of those lines in the same editor, then it will replace both (somehow). Make sure $variable.#.subvalue exists while testing.
|
||||
console.log("FOUNDLOC: ", fixedVariable, foundlocation)
|
||||
for (var j = 0; j < actionlist.length; j++) {
|
||||
if (fixedVariable.slice(1,).toLowerCase() !== actionlist[j].autocomplete.toLowerCase()) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Look for the location of found[i] in the input, as to make sure to skip parts of the input in the replace. Find ALL spots for it
|
||||
valuefound = true
|
||||
var newvalue = ""
|
||||
try {
|
||||
if (typeof actionlist[j].example === "object") {
|
||||
|
||||
input = input.replace(found[i], JSON.stringify(actionlist[j].example), -1);
|
||||
if (typeof actionlist[j].example === "object") {
|
||||
newvalue = JSON.stringify(actionlist[j].example)
|
||||
|
||||
} else if (actionlist[j].example.trim().startsWith("{") || actionlist[j].example.trim().startsWith("[")) {
|
||||
input = input.replace(found[i], JSON.stringify(actionlist[j].example), -1);
|
||||
|
||||
newvalue = JSON.stringify(actionlist[j].example)
|
||||
} else {
|
||||
const newExample = fixStringInput(actionlist[j].example)
|
||||
input = input.replace(found[i], newExample, -1)
|
||||
|
||||
newvalue = newExample
|
||||
}
|
||||
} catch (e) {
|
||||
input = input.replace(found[i], actionlist[j].example, -1)
|
||||
newvalue = actionlist[j].example
|
||||
}
|
||||
|
||||
try {
|
||||
console.log("REPLACE: ", foundlocation, fixedVariable, newvalue)
|
||||
if (newvalue !== "") {
|
||||
if (foundlocation === -1) {
|
||||
input = input.replace(fixedVariable, newvalue, 1)
|
||||
} else {
|
||||
// Ensures we don't just randomly replace the first value we find
|
||||
const replacedSlice = input.slice(foundlocation, input.length).replace(fixedVariable, newvalue, 1)
|
||||
input = input.slice(0, foundlocation) + replacedSlice
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Replace error: ", e)
|
||||
}
|
||||
}
|
||||
|
||||
if (!valuefound) {
|
||||
|
||||
@@ -30,6 +30,8 @@ import {
|
||||
Apps as AppsIcon,
|
||||
Business as BusinessIcon,
|
||||
Flag,
|
||||
ArrowDropDown as ArrowDropDownIcon,
|
||||
|
||||
} from "@mui/icons-material";
|
||||
|
||||
import { toast } from 'react-toastify';
|
||||
@@ -58,6 +60,8 @@ const TenantsTab = memo((props) => {
|
||||
const [parentOrgRegionName, setParentOrgRegionName] = React.useState("UK");
|
||||
const [loadOrgs, setLoadOrgs] = React.useState(true);
|
||||
const [, forceUpdate] = React.useState();
|
||||
const [suborglistOpen, setSuborglistOpen] = React.useState(false);
|
||||
const [allTenantsOpen, setAllTenantsOpen] = React.useState(false);
|
||||
const itemColor = "black";
|
||||
|
||||
useEffect(() => {
|
||||
@@ -482,8 +486,8 @@ const TenantsTab = memo((props) => {
|
||||
|
||||
const createSubOrg = (currentOrgId, name) => {
|
||||
const data = { name: name, org_id: currentOrgId };
|
||||
console.log(data);
|
||||
const url = globalUrl + `/api/v1/orgs/${currentOrgId}/create_sub_org`;
|
||||
setSuborglistOpen(true)
|
||||
|
||||
fetch(url, {
|
||||
mode: "cors",
|
||||
@@ -791,7 +795,7 @@ const TenantsTab = memo((props) => {
|
||||
Create, manage and change to sub-organizations (tenants)! {" "}
|
||||
{isCloud
|
||||
? "You can only make a sub organization if you are a customer of shuffle or running a POC of the platform. Please contact support@shuffler.io to try it out."
|
||||
: ''}
|
||||
: ''}
|
||||
<a
|
||||
href="/docs/organizations"
|
||||
target="_blank"
|
||||
@@ -1150,168 +1154,212 @@ const TenantsTab = memo((props) => {
|
||||
overflowX: "auto",
|
||||
paddingBottom: 0,
|
||||
}}>
|
||||
<ListItem
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "table-row",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
verticalAlign: "middle",
|
||||
}}>
|
||||
<ListItemText
|
||||
primary="Logo"
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
paddingLeft: 20,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
textAlign: "center",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}} />
|
||||
<ListItemText
|
||||
primary="Name"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center",
|
||||
}} />
|
||||
{isCloud && (
|
||||
<ListItemText
|
||||
primary="Region"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
borderBottom: "1px solid #494949",
|
||||
padding: "0px 8px 8px 8px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<ListItemText
|
||||
primary="id"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Action"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
{subOrgs.map((data, index) => {
|
||||
let regiontag = "UK";
|
||||
let regionCode = "gb";
|
||||
{!suborglistOpen ?
|
||||
<ListItem
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "table-row",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
verticalAlign: "middle",
|
||||
itemAlign: "center",
|
||||
|
||||
if (data.region_url?.length > 0) {
|
||||
const regionsplit = data.region_url.split(".");
|
||||
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
|
||||
const namesplit = regionsplit[0].split("/");
|
||||
regiontag = namesplit[namesplit.length - 1];
|
||||
if (regiontag === "california") {
|
||||
regiontag = "US";
|
||||
regionCode = "us";
|
||||
} else if (regiontag === "frankfurt") {
|
||||
regiontag = "EU-2";
|
||||
regionCode = "eu";
|
||||
} else if (regiontag === "ca") {
|
||||
regiontag = "CA";
|
||||
regionCode = "ca";
|
||||
}}
|
||||
>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Button
|
||||
fullWidth
|
||||
variant="secondary"
|
||||
style={{
|
||||
textTransform: 'none',
|
||||
}}
|
||||
onClick={() => setSuborglistOpen(true)}
|
||||
>
|
||||
Show Sub-Organizations <ArrowDropDownIcon />
|
||||
</Button>
|
||||
}
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
paddingLeft: 20,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
textAlign: "center",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
:
|
||||
<span>
|
||||
<ListItem
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "table-row",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
verticalAlign: "middle",
|
||||
}}>
|
||||
<ListItemText
|
||||
primary="Logo"
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
paddingLeft: 20,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
textAlign: "center",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}} />
|
||||
<ListItemText
|
||||
primary="Name"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center",
|
||||
}} />
|
||||
{isCloud && (
|
||||
<ListItemText
|
||||
primary="Region"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
borderBottom: "1px solid #494949",
|
||||
padding: "0px 8px 8px 8px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<ListItemText
|
||||
primary="id"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Action"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
{subOrgs.map((data, index) => {
|
||||
let regiontag = "UK";
|
||||
let regionCode = "gb";
|
||||
|
||||
if (data.region_url?.length > 0) {
|
||||
const regionsplit = data.region_url.split(".");
|
||||
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
|
||||
const namesplit = regionsplit[0].split("/");
|
||||
regiontag = namesplit[namesplit.length - 1];
|
||||
if (regiontag === "california") {
|
||||
regiontag = "US";
|
||||
regionCode = "us";
|
||||
} else if (regiontag === "frankfurt") {
|
||||
regiontag = "EU-2";
|
||||
regionCode = "eu";
|
||||
} else if (regiontag === "ca") {
|
||||
regiontag = "CA";
|
||||
regionCode = "ca";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<ListItem key={index} style={{ backgroundColor: index % 2 === 0 ? '#1A1A1A' : '#212121', width: "100%", borderBottomLeftRadius: 8, display:'table-row', borderBottomRightRadius: 8 }}>
|
||||
<ListItemText primary={<img alt={data?.name} src={data.image || theme.palette.defaultImage} style={imageStyle} />} style={{ width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
padding: "8px 8px 8px 20px",
|
||||
textAlign: "center", }} />
|
||||
<ListItemText primary={data.name} style={{ minWidth: 100,
|
||||
maxWidth: 300,
|
||||
overflow: "hidden",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center", }} />
|
||||
return (
|
||||
<ListItem key={index} style={{ backgroundColor: index % 2 === 0 ? '#1A1A1A' : '#212121', width: "100%", borderBottomLeftRadius: 8, display:'table-row', borderBottomRightRadius: 8 }}>
|
||||
<ListItemText primary={<img alt={data?.name} src={data.image || theme.palette.defaultImage} style={imageStyle} />} style={{ width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
padding: "8px 8px 8px 20px",
|
||||
textAlign: "center", }} />
|
||||
<ListItemText primary={data.name} style={{ minWidth: 100,
|
||||
maxWidth: 300,
|
||||
overflow: "hidden",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center", }} />
|
||||
|
||||
{isCloud && (
|
||||
<ListItemText
|
||||
primary={
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<img
|
||||
alt={regiontag}
|
||||
src={`https://flagcdn.com/w20/${regionCode}.png`}
|
||||
style={{ width: "30px", height: "20px", marginRight: "5px" }}
|
||||
/>
|
||||
<ListItemText primary={regiontag?.toUpperCase()} />
|
||||
</div>
|
||||
}
|
||||
style={{ display: "table-cell", padding: 8, verticalAlign: "middle" }}
|
||||
/>
|
||||
)}
|
||||
<ListItemText primary={data.id} style={{ minWidth: 300,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle", }} />
|
||||
{isCloud && (
|
||||
<ListItemText
|
||||
primary={
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<img
|
||||
alt={regiontag}
|
||||
src={`https://flagcdn.com/w20/${regionCode}.png`}
|
||||
style={{ width: "30px", height: "20px", marginRight: "5px" }}
|
||||
/>
|
||||
<ListItemText primary={regiontag?.toUpperCase()} />
|
||||
</div>
|
||||
}
|
||||
style={{ display: "table-cell", padding: 8, verticalAlign: "middle" }}
|
||||
/>
|
||||
)}
|
||||
<ListItemText primary={data.id} style={{ minWidth: 300,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle", }} />
|
||||
|
||||
<ListItemText
|
||||
primary={
|
||||
<Tooltip title={data.id === userdata?.active_org?.id ? "You are already in this organization." : ""} disableInteractive>
|
||||
<Button
|
||||
color="primary"
|
||||
variant='outlined'
|
||||
disabled={data.id === userdata?.active_org?.id}
|
||||
onClick={() => {
|
||||
handleClickChangeOrg(data.id);
|
||||
}}
|
||||
sx={{
|
||||
boxShadow:"none", textTransform:"capitalize",
|
||||
fontSize:16,
|
||||
'&.Mui-disabled': {
|
||||
backgroundColor: 'rgba(200, 200, 200, 0.5)',
|
||||
color: '#A9A9A9',
|
||||
},
|
||||
}}
|
||||
>
|
||||
Change Active Org
|
||||
</Button>
|
||||
</Tooltip>
|
||||
}
|
||||
style={{ display: "table-cell", verticalAlign: "middle" }}
|
||||
/>
|
||||
</ListItem>
|
||||
)})}
|
||||
|
||||
</span>}
|
||||
|
||||
<ListItemText
|
||||
primary={
|
||||
<Tooltip title={data.id === userdata?.active_org?.id ? "You are already in this organization." : ""} disableInteractive>
|
||||
<Button
|
||||
color="primary"
|
||||
variant='outlined'
|
||||
disabled={data.id === userdata?.active_org?.id}
|
||||
onClick={() => {
|
||||
handleClickChangeOrg(data.id);
|
||||
}}
|
||||
sx={{
|
||||
boxShadow:"none", textTransform:"capitalize",
|
||||
fontSize:16,
|
||||
'&.Mui-disabled': {
|
||||
backgroundColor: 'rgba(200, 200, 200, 0.5)',
|
||||
color: '#A9A9A9',
|
||||
},
|
||||
}}
|
||||
>
|
||||
Change Active Org
|
||||
</Button>
|
||||
</Tooltip>
|
||||
}
|
||||
style={{ display: "table-cell", verticalAlign: "middle" }}
|
||||
/>
|
||||
</ListItem>
|
||||
)})}
|
||||
</List>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1366,247 +1414,289 @@ const TenantsTab = memo((props) => {
|
||||
paddingBottom: 0,
|
||||
}}
|
||||
>
|
||||
<ListItem
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "table-row",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
>
|
||||
<ListItemText
|
||||
primary="Logo"
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
paddingLeft: 20,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
textAlign: "center",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Name"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center",
|
||||
}}
|
||||
/>
|
||||
{isCloud && (
|
||||
<ListItemText
|
||||
primary="Region"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
borderBottom: "1px solid #494949",
|
||||
padding: "0px 8px 8px 8px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<ListItemText
|
||||
primary="id"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Action"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
{!allTenantsOpen ?
|
||||
<ListItem
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "table-row",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
verticalAlign: "middle",
|
||||
itemAlign: "center",
|
||||
|
||||
{userdata?.orgs?.length <= 0 ? (
|
||||
[...Array(6)].map((_, rowIndex) => (
|
||||
<ListItem
|
||||
key={rowIndex}
|
||||
style={{
|
||||
display: "table-row",
|
||||
backgroundColor: "#212121",
|
||||
}}
|
||||
>
|
||||
{Array(7)
|
||||
.fill()
|
||||
.map((_, colIndex) => (
|
||||
<ListItemText
|
||||
key={colIndex}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: "8px",
|
||||
}}
|
||||
>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
sx={{
|
||||
backgroundColor: "#1a1a1a",
|
||||
height: "20px",
|
||||
borderRadius: "4px",
|
||||
}}
|
||||
/>
|
||||
</ListItemText>
|
||||
))}
|
||||
</ListItem>
|
||||
))
|
||||
) : (
|
||||
userdata?.orgs?.length > 0 &&
|
||||
userdata.orgs.map((data, index) => {
|
||||
let regiontag = "UK";
|
||||
let regionCode = "gb";
|
||||
|
||||
if (data.region_url?.length > 0) {
|
||||
const regionsplit = data.region_url.split(".");
|
||||
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
|
||||
const namesplit = regionsplit[0].split("/");
|
||||
regiontag = namesplit[namesplit.length - 1];
|
||||
|
||||
if (regiontag === "california") {
|
||||
regiontag = "US";
|
||||
regionCode = "us";
|
||||
} else if (regiontag === "frankfurt") {
|
||||
regiontag = "EU-2";
|
||||
regionCode = "eu";
|
||||
} else if (regiontag === "ca") {
|
||||
regiontag = "CA";
|
||||
regionCode = "ca";
|
||||
}}
|
||||
>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Button
|
||||
fullWidth
|
||||
variant="secondary"
|
||||
style={{
|
||||
textTransform: 'none',
|
||||
}}
|
||||
onClick={() => setAllTenantsOpen(true)}
|
||||
>
|
||||
Show ALL your tenants <ArrowDropDownIcon />
|
||||
</Button>
|
||||
}
|
||||
}
|
||||
}
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
paddingLeft: 20,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
textAlign: "center",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
:
|
||||
<span>
|
||||
<ListItem
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "table-row",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
>
|
||||
<ListItemText
|
||||
primary="Logo"
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
paddingLeft: 20,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
textAlign: "center",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Name"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center",
|
||||
}}
|
||||
/>
|
||||
{isCloud && (
|
||||
<ListItemText
|
||||
primary="Region"
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
borderBottom: "1px solid #494949",
|
||||
padding: "0px 8px 8px 8px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<ListItemText
|
||||
primary="id"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Action"
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
display: "table-cell",
|
||||
padding: "0px 8px 8px 8px",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
borderBottom: "1px solid #494949",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
|
||||
return (
|
||||
<ListItem
|
||||
key={index}
|
||||
style={{
|
||||
display: "table-row",
|
||||
verticalAlign: "middle",
|
||||
padding: 8,
|
||||
backgroundColor: index % 2 === 0 ? "#1A1A1A" : "#212121",
|
||||
borderBottomLeftRadius:
|
||||
userdata?.orgs?.length - 1 === index ? 8 : 0,
|
||||
borderBottomRightRadius:
|
||||
userdata?.orgs?.length - 1 === index ? 8 : 0,
|
||||
}}
|
||||
>
|
||||
<ListItemText
|
||||
primary={
|
||||
<img
|
||||
alt={data.name}
|
||||
src={data.image || theme.palette.defaultImage}
|
||||
style={imageStyle}
|
||||
/>
|
||||
}
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
padding: "8px 8px 8px 20px",
|
||||
textAlign: "center",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary={data?.name}
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
overflow: "hidden",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center",
|
||||
}}
|
||||
></ListItemText>
|
||||
{isCloud ? (
|
||||
<ListItemText
|
||||
primary={
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<img
|
||||
alt={regiontag}
|
||||
src={`https://flagcdn.com/w20/${regionCode}.png`}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
{userdata?.orgs?.length <= 0 ? (
|
||||
[...Array(6)].map((_, rowIndex) => (
|
||||
<ListItem
|
||||
key={rowIndex}
|
||||
style={{
|
||||
display: "table-row",
|
||||
backgroundColor: "#212121",
|
||||
}}
|
||||
>
|
||||
{Array(7)
|
||||
.fill()
|
||||
.map((_, colIndex) => (
|
||||
<ListItemText
|
||||
key={colIndex}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: "8px",
|
||||
}}
|
||||
>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
sx={{
|
||||
backgroundColor: "#1a1a1a",
|
||||
height: "20px",
|
||||
borderRadius: "4px",
|
||||
}}
|
||||
/>
|
||||
</ListItemText>
|
||||
))}
|
||||
</ListItem>
|
||||
))
|
||||
) : (
|
||||
userdata?.orgs?.length > 0 &&
|
||||
userdata.orgs.map((data, index) => {
|
||||
let regiontag = "UK";
|
||||
let regionCode = "gb";
|
||||
|
||||
<ListItemText primary={regiontag} />
|
||||
</div>
|
||||
}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
></ListItemText>
|
||||
) : null}
|
||||
<ListItemText
|
||||
primary={data.id}
|
||||
style={{
|
||||
minWidth: 300,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Button
|
||||
variant="outlined"
|
||||
style={{
|
||||
whiteSpace: "nowrap",
|
||||
textTransform: "none",
|
||||
fontSize: 16,
|
||||
}}
|
||||
disabled={data?.id === userdata?.active_org?.id}
|
||||
onClick={() => {
|
||||
handleClickChangeOrg(data?.id);
|
||||
}}
|
||||
>
|
||||
Change Active Org
|
||||
</Button>
|
||||
}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
></ListItemText>
|
||||
</ListItem>
|
||||
);
|
||||
})
|
||||
)}
|
||||
if (data.region_url?.length > 0) {
|
||||
const regionsplit = data.region_url.split(".");
|
||||
if (regionsplit.length > 2 && !regionsplit[0].includes("shuffler")) {
|
||||
const namesplit = regionsplit[0].split("/");
|
||||
regiontag = namesplit[namesplit.length - 1];
|
||||
|
||||
if (regiontag === "california") {
|
||||
regiontag = "US";
|
||||
regionCode = "us";
|
||||
} else if (regiontag === "frankfurt") {
|
||||
regiontag = "EU-2";
|
||||
regionCode = "eu";
|
||||
} else if (regiontag === "ca") {
|
||||
regiontag = "CA";
|
||||
regionCode = "ca";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<ListItem
|
||||
key={index}
|
||||
style={{
|
||||
display: "table-row",
|
||||
verticalAlign: "middle",
|
||||
padding: 8,
|
||||
backgroundColor: index % 2 === 0 ? "#1A1A1A" : "#212121",
|
||||
borderBottomLeftRadius:
|
||||
userdata?.orgs?.length - 1 === index ? 8 : 0,
|
||||
borderBottomRightRadius:
|
||||
userdata?.orgs?.length - 1 === index ? 8 : 0,
|
||||
}}
|
||||
>
|
||||
<ListItemText
|
||||
primary={
|
||||
<img
|
||||
alt={data.name}
|
||||
src={data.image || theme.palette.defaultImage}
|
||||
style={imageStyle}
|
||||
/>
|
||||
}
|
||||
style={{
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
maxWidth: 100,
|
||||
display: "table-cell",
|
||||
padding: "8px 8px 8px 20px",
|
||||
textAlign: "center",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary={data?.name}
|
||||
style={{
|
||||
minWidth: 100,
|
||||
maxWidth: 300,
|
||||
overflow: "hidden",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
textAlign: "center",
|
||||
}}
|
||||
></ListItemText>
|
||||
{isCloud ? (
|
||||
<ListItemText
|
||||
primary={
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<img
|
||||
alt={regiontag}
|
||||
src={`https://flagcdn.com/w20/${regionCode}.png`}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
|
||||
<ListItemText primary={regiontag} />
|
||||
</div>
|
||||
}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
></ListItemText>
|
||||
) : null}
|
||||
<ListItemText
|
||||
primary={data.id}
|
||||
style={{
|
||||
minWidth: 300,
|
||||
maxWidth: 300,
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Button
|
||||
variant="outlined"
|
||||
style={{
|
||||
whiteSpace: "nowrap",
|
||||
textTransform: "none",
|
||||
fontSize: 16,
|
||||
}}
|
||||
disabled={data?.id === userdata?.active_org?.id}
|
||||
onClick={() => {
|
||||
handleClickChangeOrg(data?.id);
|
||||
}}
|
||||
>
|
||||
Change Active Org
|
||||
</Button>
|
||||
}
|
||||
style={{
|
||||
display: "table-cell",
|
||||
padding: 8,
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
></ListItemText>
|
||||
</ListItem>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</span>}
|
||||
</List>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user