mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: keep main page filters enabled by default for UI and only disable query via permissions
This commit is contained in:
@@ -106,11 +106,12 @@ export const SecretMainPage = () => {
|
||||
const defaultFilterState = {
|
||||
tags: {},
|
||||
searchFilter: (router.query.searchFilter as string) || "",
|
||||
// these should always be on by default for the UI, they will be disabled for the query below based off permissions
|
||||
include: {
|
||||
[RowType.Folder]: true,
|
||||
[RowType.Import]: canReadSecretImports,
|
||||
[RowType.DynamicSecret]: canReadDynamicSecret,
|
||||
[RowType.Secret]: canReadSecret
|
||||
[RowType.Import]: true,
|
||||
[RowType.DynamicSecret]: true,
|
||||
[RowType.Secret]: true
|
||||
}
|
||||
};
|
||||
|
||||
@@ -118,19 +119,6 @@ export const SecretMainPage = () => {
|
||||
const [debouncedSearchFilter, setDebouncedSearchFilter] = useDebounce(filter.searchFilter);
|
||||
const [filterHistory, setFilterHistory] = useState<Map<string, Filter>>(new Map());
|
||||
|
||||
// change filters if permissions change at different paths/env
|
||||
useEffect(() => {
|
||||
setFilter((prev) => ({
|
||||
...prev,
|
||||
include: {
|
||||
[RowType.Folder]: true,
|
||||
[RowType.Import]: canReadSecretImports,
|
||||
[RowType.DynamicSecret]: canReadDynamicSecret,
|
||||
[RowType.Secret]: canReadSecret
|
||||
}
|
||||
}));
|
||||
}, [canReadSecret, canReadSecretImports, canReadDynamicSecret]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
!isWorkspaceLoading &&
|
||||
|
||||
Reference in New Issue
Block a user