mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 17:27:40 +00:00
feat:only sort on reorder and cleanup changes
This commit is contained in:
@@ -266,9 +266,12 @@ export default function Dashboard() {
|
|||||||
* Reorder rows alphabetically or in the opprosite order
|
* Reorder rows alphabetically or in the opprosite order
|
||||||
*/
|
*/
|
||||||
const reorderRows = () => {
|
const reorderRows = () => {
|
||||||
setSortMethod(
|
setSortMethod(prevSort =>
|
||||||
sortMethod == "alphabetical" ? "-alphabetical" : "alphabetical"
|
prevSort == "alphabetical"
|
||||||
|
? "-alphabetical"
|
||||||
|
: "alphabetical"
|
||||||
);
|
);
|
||||||
|
|
||||||
sortValuesHandler()
|
sortValuesHandler()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -404,9 +407,8 @@ export default function Dashboard() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once "Save changed is clicked", disable that button and sort values
|
// Once "Save changed is clicked", disable that button
|
||||||
setButtonReady(false);
|
setButtonReady(false);
|
||||||
sortValuesHandler()
|
|
||||||
pushKeys({ obj, workspaceId: router.query.id, env });
|
pushKeys({ obj, workspaceId: router.query.id, env });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -449,8 +451,6 @@ export default function Dashboard() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sortValuesHandler = () => {
|
const sortValuesHandler = () => {
|
||||||
console.log(sortMethod)
|
|
||||||
|
|
||||||
const sortedData = data.sort((a, b) =>
|
const sortedData = data.sort((a, b) =>
|
||||||
sortMethod == "alphabetical"
|
sortMethod == "alphabetical"
|
||||||
? a.key.localeCompare(b.key)
|
? a.key.localeCompare(b.key)
|
||||||
@@ -600,7 +600,7 @@ export default function Dashboard() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="ml-2 min-w-max flex flex-row items-start justify-start">
|
<div className="ml-2 min-w-max flex flex-row items-start justify-start">
|
||||||
<Button
|
<Button
|
||||||
onButtonPressed={reorderRows}
|
onButtonPressed={() => reorderRows()}
|
||||||
color="mineshaft"
|
color="mineshaft"
|
||||||
size="icon-md"
|
size="icon-md"
|
||||||
icon={
|
icon={
|
||||||
|
|||||||
Reference in New Issue
Block a user