This commit is contained in:
2021-01-29 19:20:57 +00:00
parent b2740ab4c7
commit 7e781627e4

View File

@@ -16,43 +16,49 @@ How it works:
server can fix or modify filters as necessary any time on changes, server can vet filter or sort and make sure it's ok
client can be simpler and doesn't need the caching fuckery
changing filter or sort is simpler at the client, just set it and fetch teh list again to update the datatable UI automatically
Appearance
Filter icon beside filterable column header:
Filtered columns have a highlighted filter icon showing they are filtered (clickable)
Unfiltered columns have a duller looking filter icon (clickable)
Sort icon
uses built in v-data-table sort and sort order icon system
ColumnView UI
UI opens up to same type of form as current ay-data-list-view but with only the columns visibility and order settable, no need for names it's user default
after changes just saves as users sole default for that listkey,userid combo easy peasy
Server sends columnorder and sort anyway so no need to do antyhing but trigger a fetch of the datatable data
Filter and UI
Filter and filter UI
datatable has drop down with list of filters available for the datalistkey, public adn personal, defaults to default
User is *always* using a saved at server filter, it's just that it's the default for the datalist if they haven't modified it yet
Server always sends what filter collection is in effect WITH the data which is in turn stored only in a variable in the vue vm, NOT cached in any way
User can select from named filters or default (which is actually a named filter equivalent, just always has the same name "-")
There is no "unsaved" filter, it always saves, just that there is always a default that user doesn't have to name to save a step
Server always uses a filter, either an empty default if not customized yet or a named one but in all cases it uses db datalistsavedfilter
Filter from atop each grid column by clicking a button there which opens FILTER UI
Filter widget Ui contains filtering settings for that column and shows existing
Filter widget UI also has:
Save, SaveAs (separate), Delete (if not default), Cancel, Reset (reset current filter to server list default)
Name box editable if not default otherwise just shows "-"
Thus they can update existing, save working default filter to a named filter
On save it saves to the server the updated filter collection object in it's entirety, on saveAs it saves as to the server and updates the local filter picklist to select it
On delete it updates local filter picklist to remove it and goes back to default
on cancel it does nothing at all as if it waas never clicked
on reset it tells teh server to reset it RESET ROUTE
On any exit from this UI other than cancel it triggers a getdata for the datatable which also returns the freshly updated filter collection as the server sees it
If there is a named filter in effect that name appears in the filter UI to rename during save / accept or save to new filter
If there isn't a named filter then it's their default filter for that column with no name, is still persisted to server when save but under singleton default
server will need to know or make the default and have identified it in db so knows which is which
User wants to filter
Any change to an existing filter results in
user clicks on a column heading filter icon and opens up a filter ui for that column showing existing in effect as well as can modify
this is a mirror of code already in ay-data-list-view.vue form snipped out and local for just that column
user accepts their changes in ui
if it's a named filter then
filter widget saves this one changed column to server
server fixes up existing or makes new filter at server
FILTER COLUMN WIDGET
filter button beside each filterable column header
Ui contains filtering settings for that column and shows existing, basically same as filter portion of existing ay-data-list-view.vue
has accept / cancel buttons, on accept immediately updates current filter (named or default) filter collection object in it's entirety
FILTER DROPDOWN
Defaults to default filter on page open
has an edit button appended for opening FILTER MANAGER UI:
Save, SaveAs (separate), Delete (NOT VISIBLE IF DEFAULT), Cancel, Reset resets current filter to server list default
Name box (IF NOT DEFAULT otherwise otherwise goes read only and just shows "-")
All users checkbox for shared filters (DOES NOT SHOW if default filter)
Thus they can update existing, save working default filter to a named filter
On SAVE triggers update of Filter dropdown (which triggers getdata) and exits
On SAVEAS it saves as new copy to the server, sets the current filter id to that new filter exits and triggers filter picklist to update itself triggering also getdata
On DELETE it updates local filter picklist to remove it, sets the current filter id to 0/default, exits and triggers filter picklist to udpate itself which also triggers getdata
on CANCEL it only closes the filter manager UI and does nothing else
on RESET it tells teh server to reset the current filter to default via RESET ROUTE , exits and triggers filter picklist to udpate itself triggering a getdata
SERVER / GETDATA
when server returns data for table it also includes the sort and filter in effect which is saved locally inside the vm data for use by filter UI (doesn't survive refresh)
REFRESH OF DATATABLE PAGE
full page refresh / reload causes reset to default filter which triggers the fetch of the data which fills the local collection and sets teh ui for filter sort
UI
LISTVIEW REPLACEMENT
columns and sort are a singleton per datalistkey,userid persisted automatically (no alternative "views" just one of these). User can set them or reset them to default.