Added support for tag mode on short URLs list

This commit is contained in:
Alejandro Celaya
2022-01-31 10:15:25 +01:00
parent 1011b062ae
commit 2de0276195
7 changed files with 67 additions and 8 deletions

View File

@@ -33,7 +33,10 @@ const ShortUrlsList = (ShortUrlsTable: FC<ShortUrlsTableProps>, ShortUrlsFilteri
settings,
}: ShortUrlsListProps) => {
const serverId = getServerId(selectedServer);
const [{ tags, search, startDate, endDate, orderBy }, toFirstPage ] = useShortUrlsQuery({ history, match, location });
const [
{ tags, search, startDate, endDate, orderBy, tagsMode },
toFirstPage,
] = useShortUrlsQuery({ history, match, location });
const [ actualOrderBy, setActualOrderBy ] = useState(
// This separated state handling is needed to be able to fall back to settings value, but only once when loaded
orderBy ?? settings.shortUrlsList?.defaultOrdering ?? DEFAULT_SHORT_URLS_ORDERING,
@@ -61,8 +64,9 @@ const ShortUrlsList = (ShortUrlsTable: FC<ShortUrlsTableProps>, ShortUrlsFilteri
startDate,
endDate,
orderBy: actualOrderBy,
tagsMode,
});
}, [ match.params.page, search, selectedTags, startDate, endDate, actualOrderBy ]);
}, [ match.params.page, search, selectedTags, startDate, endDate, actualOrderBy, tagsMode ]);
return (
<>