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

Update to support persistent config/localStorage filters #119

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

gmt4
Copy link
Contributor

@gmt4 gmt4 commented Nov 13, 2024

This attempts to address #4 to provide two types of filters: 1) filters defined in settings.php, and, also provide 2) localStorage filters.

Works as far as I've been using it, but probably could be reworked to be cleaner/prettier.

@@ -15,6 +15,11 @@ $nfsen_config = [
'sources' => [
'source1', 'source2',
],
'filters' => [
'Filters',
Copy link
Owner

@mbolli mbolli Nov 14, 2024

Choose a reason for hiding this comment

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

can you move the "Filters" label to e.g.

updateDropdown('filters', ['Filters', ...stored_filters]); // if this works

Or is this not meant as label?

Copy link
Contributor Author

@gmt4 gmt4 Nov 14, 2024

Choose a reason for hiding this comment

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

There's a simpler solution I didn't know which is using a disabled option + title="Filters" so it shows 1) when no filter is selected, and 2) when on hover:

<select id="filterFiltersSelect" class="form-control form-select"  style="width:6em" title="Filter"> 
 <option value="" disabled selected>Filter</option>            
</select>                                                 

I've tried adding the above HTML to frontend/index.html, and removing the 'Filters' from the settings.php and checked it works as expected, I mean the "Filters" string is kept out of the list of applicable filters, and is just a presentation string in HTML that doesn't get into the JavaScript logic.

I'm rather new to PR reviews, if this suits, then feel free to make the edits.

@mbolli
Copy link
Owner

mbolli commented Nov 14, 2024

nice, thanks. I only have one thing that needs to be addressed. the rest can be done after the merge.

@mbolli mbolli merged commit fd34fb8 into mbolli:master Nov 18, 2024
@mbolli
Copy link
Owner

mbolli commented Nov 18, 2024

great, thanks!

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.

2 participants