enhanced contact table to allow for filtering and sorting #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ich hab die Erweiterung der Tabelle aus dem anderen Branch heraus gelöst, sodass es hier erstmal nur um die Erweiterung der Kontakte-Tabelle gehen soll.
Grob funktioniert es wie folgt:
core_componentswurde um ein paar Attribute ergänzt, durch die einzelne Spalten optional als sortier- bzw. filterbar markiert werden könnenSortAndFilterTableHelper. Dort werden durch ein Makro Event-Handler für die Sortier- /Filter-Events der Tabelle bereitgestellt.ContactsTableComponent, muss für das Makro die Funktionencolumn_to_database_field/1,column_to_getter/1undload_data/3bereitstellen. Über load_data soll dabei sowohl das Filter- als auch das Sortieren in der Datenbank übernommen werden. Dafür gibt es inPersonal-Kontext die Funktionlist_contacts/3. Sofern Sortieren oder Filtern nicht direkt auf der Datenbank möglich sind, machtSortAndFilterTableHelperes in-memory.Um das ganze besser testen zu können, habe ich außerdem die seeds-Datei angepasst. Kontakte zu einem Verein werden dort jetzt in
Sportyweb.ContactSeedHelper::add_contact/1angelegt wo intern die Funktionadd_contractmerhmals verwendet werden kann.