Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filtering contribution list by custom fields #6214

Merged
merged 20 commits into from
May 15, 2024

Conversation

micsucmed
Copy link
Contributor

@micsucmed micsucmed commented Mar 1, 2024

closes #6213

Contribution custom fields can now be filtered, and columns can now be hidden/showed:
image

@ThiefMaster ThiefMaster changed the title Contribition custom fields filters Allow filtering contribution list by custom fields Mar 1, 2024
@micsucmed micsucmed marked this pull request as ready for review March 5, 2024 09:07
@ThiefMaster ThiefMaster force-pushed the contrib-custom-fields-filters branch from f6bbdb8 to 0aabac0 Compare March 5, 2024 15:58
@ThiefMaster
Copy link
Member

Just to mention it here as well, I think it would be good to also allow displaying those custom fields in the list (we already have this in the list of abstracts).

@micsucmed micsucmed force-pushed the contrib-custom-fields-filters branch from 0aabac0 to 5448719 Compare March 14, 2024 16:19
@ThiefMaster ThiefMaster marked this pull request as draft March 18, 2024 12:55
@micsucmed micsucmed force-pushed the contrib-custom-fields-filters branch from 169d0ed to fc351ab Compare March 19, 2024 11:07
@micsucmed micsucmed marked this pull request as ready for review March 19, 2024 11:15
@ThiefMaster ThiefMaster force-pushed the contrib-custom-fields-filters branch 2 times, most recently from 7b795b3 to d8b641f Compare March 20, 2024 19:29
@ThiefMaster
Copy link
Member

ThiefMaster commented Mar 20, 2024

The default view looks kind of broken (see the table headers near the end):

image

It looks like the "Material" header is always missing and there's no header above the action button.

Also, IMHO we should keep the columns that were shown by default before enabled by default.

The Contribution "Type" column also changed its place


:return: a list of {'id': ..., 'caption': ...} dicts
"""
return [{'id': id_, 'caption': self.static_items[id_]['title']} for id_ in self.static_items if id_ in ids]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the ids are guaranteed to be a subset of static_items keys, you could simply:

Suggested change
return [{'id': id_, 'caption': self.static_items[id_]['title']} for id_ in self.static_items if id_ in ids]
return [{'id': id_, 'caption': self.static_items[id_]['title']} for id_ in ids]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they are not necessarily a subset of static items since the function separating the ids takes as dynamic any item that has an id that is not a str

@micsucmed micsucmed force-pushed the contrib-custom-fields-filters branch from 5d12cd9 to 1f45690 Compare March 25, 2024 15:52
@ThiefMaster
Copy link
Member

ThiefMaster commented May 6, 2024

Are you hiding the contribution type by default on purpose? It also changed places...

@micsucmed
Copy link
Contributor Author

I am hiding it on purpose since now the table is being rendered dynamically, and if there is no contribution types the column would be empty. It also changed places because of the dynamic rendering, since the order of the columns is not given by a static table

@ThiefMaster
Copy link
Member

What do you think about enabling it by default if the event has contribution types defined? I think it's important information for conference organizers that should be shown by default.

Of course in cases like someone first changing the display settings and then creating a contribution type this would need to be manually enabled (since the config is stored in the session), but the most common case would be covered by it.

@micsucmed
Copy link
Contributor Author

I'm looking into it, let me get back when I get something

@micsucmed
Copy link
Contributor Author

I included Type as a default column checking if there are any contribution types. There is a small bug bothering me that I can't seem to find the issue, when the first contribution type is created you need to refresh the page for the column to appear, but when the last one is deleted, as soon as the contribution type dialog is closed the Type column disappears.

@ThiefMaster ThiefMaster force-pushed the contrib-custom-fields-filters branch from 1794fa0 to 62b78a8 Compare May 10, 2024 13:29
@ThiefMaster ThiefMaster merged commit da7142b into indico:master May 15, 2024
9 checks passed
@ThiefMaster ThiefMaster added this to the v3.3 milestone May 15, 2024
@micsucmed micsucmed deleted the contrib-custom-fields-filters branch May 24, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contributions: add filter capability on custom fields
3 participants