Fix merge conflicts

This commit is contained in:
Tuan Dang
2022-12-12 00:26:37 -05:00
4 changed files with 107 additions and 87 deletions
@@ -7,8 +7,8 @@ import guidGenerator from '../utilities/randomId';
const REGEX = /([$]{.*?})/g;
interface DashboardInputFieldProps {
index: number;
onChangeHandler: (value: string, index: number) => void;
position: number;
onChangeHandler: (value: string, position: number) => void;
value: string;
type: 'varName' | 'value';
blurred: boolean;
@@ -18,7 +18,7 @@ interface DashboardInputFieldProps {
/**
* This component renders the input fields on the dashboard
* @param {object} obj - the order number of a keyPair
* @param {number} obj.index - the order number of a keyPair
* @param {number} obj.pos - the order number of a keyPair
* @param {function} obj.onChangeHandler - what happens when the input is modified
* @param {string} obj.type - whether the input field is for a Key Name or for a Key Value
* @param {string} obj.value - value of the InputField
@@ -28,7 +28,7 @@ interface DashboardInputFieldProps {
*/
const DashboardInputField = ({
index,
position,
onChangeHandler,
type,
value,
@@ -57,7 +57,7 @@ const DashboardInputField = ({
>
<input
onChange={(e) =>
onChangeHandler(e.target.value.toUpperCase(), index)
onChangeHandler(e.target.value.toUpperCase(), position)
}
type={type}
value={value}
@@ -87,7 +87,7 @@ const DashboardInputField = ({
>
<input
value={value}
onChange={(e) => onChangeHandler(e.target.value, index)}
onChange={(e) => onChangeHandler(e.target.value, position)}
onScroll={syncScroll}
className={`${
blurred
@@ -74,26 +74,26 @@ const getSecretsForProject = async ({
setFileState(tempFileState);
setData(
tempFileState.map((line, index) => [
guidGenerator(),
index,
line['key'],
line['value'],
line['type']
])
// .sort((a, b) =>
// sortMethod == "alphabetical"
// ? a[2].localeCompare(b[2])
// : b[2].localeCompare(a[2])
// )
tempFileState.map((line, index) => {
return {
id: guidGenerator(),
pos: index,
key: line['key'],
value: line['value'],
type: line['type']
};
})
);
return tempFileState.map((line, index) => [
guidGenerator(),
index,
line['key'],
line['value'],
line['type']
]);
return tempFileState.map((line, index) => {
return {
id: guidGenerator(),
pos: index,
key: line['key'],
value: line['value'],
type: line['type']
};
});
} catch (error) {
console.log('Something went wrong during accessing or decripting secrets.');
}