Coder Social home page Coder Social logo

nova-multicolumn-filter's People

Contributors

4n70w4 avatar dddeeemmmooonnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nova-multicolumn-filter's Issues

Make buttons translatable

Currently the "Add" and "Apply" buttons are hardcoded text. Would be great to use the language system to make them translateable to for example "Hinzufügen" und "Durchführen" in german.

Plus: Add a title "Remove filter" (also translateable) to the remove button.

Do you accept PR?

How can we change placeholder of box?

Thanks for the great customized option of all types of filters.
If we have to change the placeholder of the text box and select instead of "--" then how can we do?

Second Question:
Initially display the "Add" button can we display the first filter directly?

And any way to change the "Add" button text when no filter added? After adding one filter "Add" button text is Ok

Page number being reset to 1 when going into detail page of a resource and back to index

Hello,
I have been using your package and I noticed this issue where the page number is being reset to 1 after going into the detail page of a resource and then back to index. I found that when I remove the code that pushes all the columns to rows[] and handleChange() being called in mounted() it works. Would it okay to remove that and create a pull request?
Thanks

Make it more customizeable

Can you please make the Title "Nova Multicolumn Filter" translateable and can you please add a css class to the filter, so that we can easily change the styling of it by css?

Operator isn't url decoded

NovaMulticolumnFilter class -> apply function
$val['operator'] isn't urldecoded, if I use other then LIKE operator I get an sql error on date fields.

Cannot redeclare non static dddeeemmmooonnn\NovaMulticolumnFilter\NovaMulticolumnFilter::$default_column_type as static App\Services\ApplicationServices\Nova\Filters\ApplicationContractMultiFilter::$default_column_type

I copy UserFilter from readme and get error:

    "message": "Cannot redeclare non static dddeeemmmooonnn\\NovaMulticolumnFilter\\NovaMulticolumnFilter::$default_column_type as static App\\Services\\ApplicationServices\\Nova\\Filters\\ApplicationContractMultiFilter::$default_column_type",
    "exception": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
    "file": "/var/www/app/app/MyMultiFilter.php",
    "line": 9,

Allow single column and simple usecases

Great job with this package.

I know, its a multi column filter, but it would be great, if there would be an option, to only show a single filter and/or a single column (without selectbox).

Let my show you, what I mean. This is my class:

class MyFilter extends NovaMulticolumnFilter {
    protected $columns = [
        'model_id' => [
            'label' => 'Tabellen-ID',
            'defaultOperator' => '=',
            'preset' => true,
        ],
    ];
    public $name = "Tabellen-ID";


    protected function operatorsDefault() {
        return [
            '=' => '=',
        ];
    }
}

which results into this (with custom colors of course):

image

Do not show selectbox, when there is only one option

Since I have only one column, it would be great, if you wouldn't see an Selectbox, but just the name of the column. Something like this:

image

or alternativly, allow to hide this first selectbox, since you can already set the filter name (public $name = "Tabellen-ID";):

image

Allow to disable add/remove buttons

It would be great, if we could disable the add and remove buttons, since in the case you only have one column to filter and set it as preset, then this would be a nice enhancement:

image

Allow to disable operator

In case you only have one operator, there is no need for a selectbox, so please allow to disable (aka hide) it

image

Clear filter, after "Reset Filters" button was pressed

When you have set your filter and then click on top of the filter flyout on "Reset Filters", then the table is refreshed and the filter number indicator bubble is set to 0, but the filter nova-multicolumn-filter is still shown and the input/selectboxes are still filled with the values.

Update the number next to filter button based

  1. have a multicolumn filter with at least two columns defined
  2. filter columnA
  3. filter columnB
  4. see filter count = 1

expected: filter count = 2

Is it possible for this package to adjust the number here when more than one multi-column filter is applied?

image

Allow support for 'HAVING' in query

It would be handy to have the option to use this filter with aliased columns, eg count(id) AS totals, which would require supporting the HAVING totals > 100 SQL query

The select field stays empty when the option has accents

Hi,
I have a filter with this column:

protected $columns = [ 'province' => [ 'type' => 'select', 'options' => [ 'Almería' => 'Almería', 'Madrid' => 'Madrid', 'Ciudad Real' => 'Ciudad Real' ], 'label' => 'Province', ] ];

When I select 'Madrid' the select field shows 'Madrid', but if I select an option with accents or blanks like 'Almería' or 'Ciudad Real', the select field shows empty, although the data is filtered correctly.
The problem is that the user does not know what option has selected.

Best regards and thank you for this Nova package.

Incorrect link on novapackages

On your novapackages page for this repo, you have entered the link incorrectly, missing out the final "r" in "filter".

Current link

https://github.com/dddeeemmmooonnn/nova-multicolumn-filte

Should be:

https://github.com/dddeeemmmooonnn/nova-multicolumn-filter

[Question] Implementation of `whereIn` operator

I am trying to figure out how to implement the eloquent method whereIn in combination with an input field where the input is split by some delimiter.

Imagine a filter like so:

  • Field: id
  • Operator: in
  • Value: "1,2,3"

which would add the following query:

$query->whereIn('id', [1, 2, 3]);

where the array of id's are retrieved as

$values = explode($delimiter=',', $value);

This would make it possible to filter a resource based on an array of id's for example.

Do you have any pointers as how to implement something like this using your package? Thanks.

Do not add the query string when the user hasn't selected any filter

Hello

Even when no filter is selected, it adds a very long query string to the URL.

That is not super user-firendly, and also if we have the Nova Scroll To Top package, and haven't disabled it for the "on route change", it will trigger a scroll to the top every time we open relation tab when we are inside a resource details.

So is there a way to not add that query string when the user hasn't selected any filter yet ?

Thanks for you work !

Display bug when remove filter

  1. add filter1
  2. add filter2
  3. click X (remove) on filter1

result:
UI displays the last filter removed (filter2 in this case)

if you refresh the page it is corrected


expected:
UI should display filter1 removed

How to use

Hi.

It's not a bug report, just want to ask how can we use the filters?
Like I'm new in nova and I'm confused.

Where do I need to put this kind of code?

new NovaMulticolumnFilter([
'column' => '', //columns
],
$manual_update = false, // Apply filter with the button
$default_column_type = 'text', // Default input type
$name = 'filter' // Filter name
),

or if I wanna create a new one how can I use it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.