mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 09:28:52 +00:00
Fix merge conflicts for index
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { faCircle, faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
@@ -26,7 +25,6 @@ const InputField = (
|
||||
Pick<JSX.IntrinsicElements['input'], 'autoComplete' | 'id'>
|
||||
) => {
|
||||
const [passwordVisible, setPasswordVisible] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
if (props.static === true) {
|
||||
return (
|
||||
|
||||
@@ -41,7 +41,7 @@ interface LayoutProps {
|
||||
export default function Layout({ children }: LayoutProps) {
|
||||
const router = useRouter();
|
||||
const [workspaceList, setWorkspaceList] = useState([]);
|
||||
const [workspaceMapping, setWorkspaceMapping] = useState([{ 1: 2 }]);
|
||||
const [workspaceMapping, setWorkspaceMapping] = useState([{ '1': '2' }]);
|
||||
const [workspaceSelected, setWorkspaceSelected] = useState('∞');
|
||||
const [newWorkspaceName, setNewWorkspaceName] = useState('');
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
@@ -221,20 +221,20 @@ export default function Layout({ children }: LayoutProps) {
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (
|
||||
workspaceMapping[Number(workspaceSelected)] &&
|
||||
`${workspaceMapping[Number(workspaceSelected)]}` !==
|
||||
workspaceMapping[workspaceSelected as any] &&
|
||||
`${workspaceMapping[workspaceSelected as any]}` !==
|
||||
router.asPath
|
||||
.split('/')
|
||||
[router.asPath.split('/').length - 1].split('?')[0]
|
||||
) {
|
||||
router.push(
|
||||
'/dashboard/' +
|
||||
workspaceMapping[Number(workspaceSelected)] +
|
||||
workspaceMapping[workspaceSelected as any] +
|
||||
'?Development'
|
||||
);
|
||||
localStorage.setItem(
|
||||
'projectData.id',
|
||||
`${workspaceMapping[Number(workspaceSelected)]}`
|
||||
`${workspaceMapping[workspaceSelected as any]}`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -63,13 +63,15 @@ const DropZone = ({
|
||||
if (event.target === null || event.target.result === null) return;
|
||||
// parse function's argument looks like to be ArrayBuffer
|
||||
const keyPairs = parse(event.target.result as Buffer);
|
||||
const newData = Object.keys(keyPairs).map((key, index) => [
|
||||
guidGenerator(),
|
||||
numCurrentRows + index,
|
||||
key,
|
||||
keyPairs[key as keyof typeof keyPairs],
|
||||
'shared'
|
||||
]);
|
||||
const newData = Object.keys(keyPairs).map((key, index) => {
|
||||
return {
|
||||
id: guidGenerator(),
|
||||
pos: numCurrentRows + index,
|
||||
key: key,
|
||||
value: keyPairs[key as keyof typeof keyPairs],
|
||||
type: 'shared'
|
||||
};
|
||||
});
|
||||
setData(newData);
|
||||
setButtonReady(true);
|
||||
};
|
||||
@@ -97,13 +99,15 @@ const DropZone = ({
|
||||
if (typeof result === 'string') {
|
||||
const newData = result
|
||||
.split('\n')
|
||||
.map((line: string, index: number) => [
|
||||
guidGenerator(),
|
||||
numCurrentRows + index,
|
||||
line.split('=')[0],
|
||||
line.split('=').slice(1, line.split('=').length).join('='),
|
||||
'shared'
|
||||
]);
|
||||
.map((line: string, index: number) => {
|
||||
return {
|
||||
id: guidGenerator(),
|
||||
pos: numCurrentRows + index,
|
||||
key: line.split('=')[0],
|
||||
value: line.split('=').slice(1, line.split('=').length).join('='),
|
||||
type: 'shared'
|
||||
};
|
||||
});
|
||||
setData(newData);
|
||||
setButtonReady(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user