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

Add clear filters from within big filter #10

Open
LorenzoSapora opened this issue Oct 3, 2019 · 7 comments
Open

Add clear filters from within big filter #10

LorenzoSapora opened this issue Oct 3, 2019 · 7 comments

Comments

@LorenzoSapora
Copy link

Hey, great package. Feature suggestion: Adding the 'clear filter' button to the big filter.

Here's the codeblock from the default component.

                <div v-if="filtersAreApplied" class="bg-30 border-b border-60">
                    <button
                        @click="$emit('clear-selected-filters')"
                        class="py-2 w-full block text-xs uppercase tracking-wide text-center text-80 dim font-bold focus:outline-none"
                    >
                        {{ __('Reset Filters') }}
                    </button>
                </div>

I'm not 100% up on my vue lang, but I assume this is all that's needed, if you're extending the existing filter (with a few css class tweaks).

@LorenzoSapora
Copy link
Author

Hmm. I was just looking around, to see if I could push a PR for this issue, and it appears you've already started on this

In resources/js/components/Card.vue

            <!--<div v-if="filtersAreApplied" class="bg-30 border-b border-60">-->
            <!--<button-->
            <!--@click="$emit('clear-selected-filters')"-->
            <!--class="py-2 w-full block text-xs uppercase tracking-wide text-center text-80 dim font-bold focus:outline-none"-->
            <!--&gt;-->
            <!--{{ __('Reset Filters') }}-->
            <!--</button>-->
            <!--</div>-->

@jerrychee94
Copy link

Lorenzo, unfortunately $emit('clear-selected-filters') in FilterMenu.vue(default filter from laravel nova) is emitting event to Index.vue (default index from laravel nova) and it will trigger clearSelectedFilters method from laravel packages. I found a solution for this and I hope to include it in the PR.

@LorenzoSapora
Copy link
Author

Excellent, look forward to seeing the PR

@jerrychee94
Copy link

Here you go. I've added a PR but I'm not sure it's right way to make a PR or not. It's my first ever PR on GitHub. #18

@edanisko
Copy link
Collaborator

edanisko commented Nov 28, 2019 via email

@jerrychee94
Copy link

Hi @edanisko,

Appreciate your attention here. Hope this fix will help :)

Jerry Chee

@flatcapco
Copy link

Is this possible to merge? @edanisko

Thank you

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

No branches or pull requests

4 participants