mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 12:28:56 +00:00
Solving merge conflicts
This commit is contained in:
@@ -43,8 +43,7 @@ const crypto = require("crypto");
|
|||||||
|
|
||||||
export default function Layout({ children }: LayoutProps) {
|
export default function Layout({ children }: LayoutProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [workspaceList, setWorkspaceList] = useState([]);
|
const [workspaceMapping, setWorkspaceMapping] = useState<Map<string, string>[]>([]);
|
||||||
const [workspaceMapping, setWorkspaceMapping] = useState([{ "1": "2" }]);
|
|
||||||
const [workspaceSelected, setWorkspaceSelected] = useState("∞");
|
const [workspaceSelected, setWorkspaceSelected] = useState("∞");
|
||||||
const [newWorkspaceName, setNewWorkspaceName] = useState("");
|
const [newWorkspaceName, setNewWorkspaceName] = useState("");
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
@@ -140,7 +139,11 @@ export default function Layout({ children }: LayoutProps) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
router.push("/dashboard/" + newWorkspaceId);
|
setWorkspaceMapping((prevState) => ({
|
||||||
|
...prevState,
|
||||||
|
[workspaceName]: newWorkspaceId
|
||||||
|
}))
|
||||||
|
setWorkspaceSelected(workspaceName);
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
setNewWorkspaceName("");
|
setNewWorkspaceName("");
|
||||||
} else {
|
} else {
|
||||||
@@ -227,9 +230,7 @@ export default function Layout({ children }: LayoutProps) {
|
|||||||
) {
|
) {
|
||||||
router.push("/dashboard/" + userWorkspaces[0]._id);
|
router.push("/dashboard/" + userWorkspaces[0]._id);
|
||||||
} else {
|
} else {
|
||||||
setWorkspaceList(
|
console.log(99, Object.keys(workspaceMapping))
|
||||||
userWorkspaces.map((workspace: any) => workspace.name)
|
|
||||||
);
|
|
||||||
setWorkspaceMapping(
|
setWorkspaceMapping(
|
||||||
Object.fromEntries(
|
Object.fromEntries(
|
||||||
userWorkspaces.map((workspace: any) => [
|
userWorkspaces.map((workspace: any) => [
|
||||||
@@ -255,7 +256,7 @@ export default function Layout({ children }: LayoutProps) {
|
|||||||
};
|
};
|
||||||
putUserInWorkSpace();
|
putUserInWorkSpace();
|
||||||
onboardingCheck({ setTotalOnboardingActionsDone });
|
onboardingCheck({ setTotalOnboardingActionsDone });
|
||||||
}, []);
|
}, [router.query.id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
@@ -297,14 +298,13 @@ export default function Layout({ children }: LayoutProps) {
|
|||||||
<div className="text-gray-400 self-start ml-1 mb-1 text-xs font-semibold tracking-wide">
|
<div className="text-gray-400 self-start ml-1 mb-1 text-xs font-semibold tracking-wide">
|
||||||
{t("nav:menu.project")}
|
{t("nav:menu.project")}
|
||||||
</div>
|
</div>
|
||||||
{workspaceList.length > 0 ? (
|
{Object.keys(workspaceMapping).length > 0 ? (
|
||||||
<Listbox
|
<Listbox
|
||||||
selected={workspaceSelected}
|
selected={workspaceSelected}
|
||||||
onChange={setWorkspaceSelected as any}
|
onChange={setWorkspaceSelected}
|
||||||
data={workspaceList}
|
data={Object.keys(workspaceMapping)}
|
||||||
buttonAction={openModal}
|
buttonAction={openModal}
|
||||||
text=""
|
text=""
|
||||||
// workspaceMapping={workspaceMapping as any}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
@@ -317,7 +317,7 @@ export default function Layout({ children }: LayoutProps) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
{workspaceList.length > 0 &&
|
{Object.keys(workspaceMapping).length > 0 &&
|
||||||
menuItems.map(({ href, title, emoji }) => (
|
menuItems.map(({ href, title, emoji }) => (
|
||||||
<li className="mt-0.5 mx-2" key={title}>
|
<li className="mt-0.5 mx-2" key={title}>
|
||||||
{router.asPath.split("/")[1] === href.split("/")[1] &&
|
{router.asPath.split("/")[1] === href.split("/")[1] &&
|
||||||
|
|||||||
Reference in New Issue
Block a user