manager-ui icon indicating copy to clipboard operation
manager-ui copied to clipboard

Media App: Add Sort & Filter parameters to the page URL

Open zcolah opened this issue 2 years ago • 3 comments

When a user applies a time or file type filter, append text to the URL in a format similar to: "?from=2022-09-30&to=2022-11-23& filetype="PNG"

zcolah avatar Nov 21 '22 23:11 zcolah

const [params, setParams] = useParams()

agalin920 avatar Nov 22 '22 23:11 agalin920

@zcolah Is there a parameter for sort?

Also, when a user bookmarks a preset selection, e.g. "Today" and then visits that link many days later, what is the expectation? Does it navigate to the current day (?dateFilter=today), or does the link save "Today" as a date (?on=2022-11-22) in the link?

rjpals avatar Nov 22 '22 23:11 rjpals

Ryan thank you for initiating this discussion and asking for more context. I appreciate the attention to detail.

Here are my thoughts on what should be done. These are open to discussion and revision.

Sort By The initial scope did not include scope but on reflection I believe it should. The options should be:

?sortby=AtoZ ?sortby=ZtoA ?sortby=dateadded

Filters ?dateFilter=today should link to the present ?dateFilter=last7days should link to the last 7 days ?dateFilter=last14days should link to the last 14 days ?dateFilter=last30days should link to the last 30 days ?dateFilter=last3months should link to the last 3 months ?dateFilter=last12months should link to the last 12 months

zcolah avatar Nov 28 '22 23:11 zcolah