adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

Multi select dropdown for filters

Open tomups opened this issue 2 years ago • 13 comments

Describe the problem feature solves Right now you can only select a single value to filter for in dropdowns.

Describe the solution you'd like It would be good to be able to select multiple values.

Describe alternatives you've considered Might be a duplicate of #438 ... ?

Acceptance criteria Being able to select multiple values in filter dropdowns, and being able to filter by those.

Now:

image

Enhancement:

image

tomups avatar Jul 03 '22 20:07 tomups

I would like to work on this issue.

Hat52 avatar Jul 11 '22 22:07 Hat52

@Hat52 Awesome, go one and create the Pull Request 🚀 . If you need any help drop me a message on Slack, or comment here.

krzysztofstudniarek avatar Jul 12 '22 08:07 krzysztofstudniarek

@krzysztofstudniarek Do i need to fork the dev repo?

Hat52 avatar Jul 12 '22 10:07 Hat52

@Hat52 I believe you'll need to fork adminjs and adminjs-desig-system repositories. But @dziraf might have more insights here 😄

krzysztofstudniarek avatar Jul 12 '22 14:07 krzysztofstudniarek

@krzysztofstudniarek why do I need to fork two repositories?

Hat52 avatar Jul 12 '22 15:07 Hat52

@Hat52 @krzysztofstudniarek not sure if forking adminjs-design-system will be required as it's possible it's already got required UI components. You might have to fork adapter's repositories, e. g. adminjs-typeorm so that it supports array filters.

dziraf avatar Jul 12 '22 15:07 dziraf

@dziraf do I need to configure both repo on my local to achive the desired result.

Hat52 avatar Jul 12 '22 15:07 Hat52

mkdir adminjs-development
cd adminjs-development
git clone [email protected]:SoftwareBrothers/adminjs.git
cd adminjs
yarn install
yarn link
yarn dev
yarn bundle:globals
cd ..
git clone [email protected]:SoftwareBrothers/adminjs-typeorm.git
cd adminjs-typeorm
yarn install
yarn link
yarn dev
cd ..
mkdir adminjs-test-app # or clone e. g. adminjs-example-app repository
cd adminjs-test-app
yarn init # setup test app project if you're going to work on your own test app
yarn link "adminjs"
yarn link "@adminjs/typeorm"

the steps above should make you see your local changes in your test app

you should clone your forked repositories though

dziraf avatar Jul 12 '22 15:07 dziraf

@dziraf thanks🙂

Hat52 avatar Jul 12 '22 15:07 Hat52

@tomtastico can you share the step to reach to the filter that you mentioned?

Hat52 avatar Jul 13 '22 09:07 Hat52

@Hat52 thanks for looking into this!

You can get this kind of filter by having a resource using a mongoose schema that has a property of type enum, something like this:

@Prop({
  type: String,
  enum: StatusEnum,
})
status: StatusEnum;

With the enum being something like:

enum StatusEnum {
  VERIFIED = 'verified',
  VERIFYING = 'verifying',
  UNVERIFIED = 'unverified',
  BLOCKED = 'blocked',
}

tomups avatar Jul 13 '22 10:07 tomups

@dziraf How do I run the test app. I have linked it with adminjs and the @adminjs/typeorm.

Hat52 avatar Jul 19 '22 19:07 Hat52

image this is how my project structure look for now

Hat52 avatar Jul 19 '22 20:07 Hat52

This issue is a part of https://github.com/SoftwareBrothers/adminjs/issues/251, hence I'm closing it and move conversation there.

krzysztofstudniarek avatar Aug 16 '22 09:08 krzysztofstudniarek