feat(studio): add reset all overrides action to organize imports dialog
This commit is contained in:
1 parent
e47bee16bb
commit
0f1da6c178
3 files changed
+22
-2
No files matched your search
@@ -277,6 +277,11 @@ export function OrganizeImportsDialog({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const resetAllOverrides = () => {
|
||||||
|
setOverrides({});
|
||||||
|
setApproved(Object.fromEntries(groups.map((g) => [g.name, true])));
|
||||||
|
};
|
||||||
|
|
||||||
const filteredGroups = useMemo(() => {
|
const filteredGroups = useMemo(() => {
|
||||||
const q = groupSearchQuery.trim().toLowerCase();
|
const q = groupSearchQuery.trim().toLowerCase();
|
||||||
if (!q) return groups;
|
if (!q) return groups;
|
||||||
@@ -672,6 +677,19 @@ export function OrganizeImportsDialog({
|
|||||||
>
|
>
|
||||||
{t("applyBatch")}
|
{t("applyBatch")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
{Object.keys(overrides).length > 0 && (
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
className="h-7 px-2 text-[10px] text-muted-foreground hover:text-foreground"
|
||||||
|
onClick={resetAllOverrides}
|
||||||
|
>
|
||||||
|
<RefreshCw className="mr-1 h-3 w-3" />
|
||||||
|
{t("resetAll")}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2243,7 +2243,8 @@
|
|||||||
"batchPrefix": "Add prefix to all titles",
|
"batchPrefix": "Add prefix to all titles",
|
||||||
"applyBatch": "Apply to all",
|
"applyBatch": "Apply to all",
|
||||||
"searchGroups": "Filter import groups...",
|
"searchGroups": "Filter import groups...",
|
||||||
"visualPreview": "Preview"
|
"visualPreview": "Preview",
|
||||||
|
"resetAll": "Reset overrides"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bulk": {
|
"bulk": {
|
||||||
|
|||||||
@@ -2011,7 +2011,8 @@
|
|||||||
"batchPrefix": "Prefix toevoegen aan titels",
|
"batchPrefix": "Prefix toevoegen aan titels",
|
||||||
"applyBatch": "Toepassen op alle",
|
"applyBatch": "Toepassen op alle",
|
||||||
"searchGroups": "Filter importgroepen...",
|
"searchGroups": "Filter importgroepen...",
|
||||||
"visualPreview": "Voorbeeld"
|
"visualPreview": "Voorbeeld",
|
||||||
|
"resetAll": "Wijzigingen herstellen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bulk": {
|
"bulk": {
|
||||||
|
|||||||
Reference in new issue
Block a user