Git Product home page Git Product logo

strapi-plugin-multi-select's Introduction

strapi-plugin-multi-select's People

Contributors

iamandrewluca avatar manhhn01 avatar yuku avatar zaydme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

strapi-plugin-multi-select's Issues

Feature Request

I have a multi-select with a TON of options.

It would be really nice to be able to type in the available options with a autocomplete of whats available in the list as well as the checkboxes.

Thanks!

Preserve selected order

From options list ['a', 'b', 'c'] choose b, then a, selected values list would be ['b', 'a']

On reload, selected values lose their order, as they're filtered by possibleOptions in sanitizedValue and become ['a', 'b']

Would appreciate for this feature, thanks!

Unselected MultiSelect field shown as empty array in API

Hi, 

I have a multi-select field X which is a non-required field. Initially, I got null from the API if I didn't select any values for it. However, once I selected multiple items and unselected them, I got an empty array instead of null from the API. Could you please make a change so that if there is no value selected, the API returns null?

The reason that I need such a change is that the filters don't work well with empty arrays in Strapi.

Thank you

Not filterable

I've noticed the plugin isnt filterable on admin panel. Any chances to get that integrated?
Screenshot 2023-10-31 at 11 05 57
Should have projects in the list, but it's missing. It's really crucial to have it for good workflow.

Empty field even if value stored in database

I'm using last version of Strapi (v4.20.5). When I load a page with the custom field, the field is always empty, even if it has data stored.

The problem I see: There are two renders of MultiSelect component. A first one with value props empty ('') and a second one with the filled value. But as it uses the defaultValue props of React Select to provide the value, the first empty value is kept.

If I replace defaultValue by value in React Select props, field is correctly filled.

Does anyone else have the same problem with the last version of Strapi ?

TypeError: Cannot read properties of null (reading 'includes') when adding component with custom plugin

Strapi version: 4.6.0
strapi-plugin-multi-select: 1.1.0

When adding a component with the custom multi-select plugin field to a dynamic zone, I get a "Whoops! Something went wrong. Please, try again." (see screenshot below). I've also included the console error:

TypeError: Cannot read properties of null (reading 'includes')
    at ht (main.ee2267fb.js:12894:988)
    at main.ee2267fb.js:12894:1690
    at Array.map (<anonymous>)
    at be (main.ee2267fb.js:12894:1249)
    at _o (main.ee2267fb.js:9836:54688)
    at l4 (main.ee2267fb.js:9840:9133)
    at Fd (main.ee2267fb.js:9840:989)
    at vc (main.ee2267fb.js:9840:917)
    at Cc (main.ee2267fb.js:9840:768)
    at Ec (main.ee2267fb.js:9838:11068)
qr @ main.ee2267fb.js:9838

Screen Shot 2023-03-10 at 4 11 27 PM

Default value

Hi,
is possible for required field set a default value?

Thanks a lot. Great Job!!

Cant filter with `$in` operator

I know you can use $containsi but it doesn't really achieve what I want.

Let's use this example

schema.json

"page": {
  "type": "customField",
  "options": ["My Account:my-account", "Account:account", "Account Edit:account-edit"],
  "customField": "plugin::multi-select.multi-select"
},

HTTP Request

$in

filters[page][$in]=account

Does not return any data, even if I have multiple entries that have account selected

$containsi

filters[page][$containsi]=account

Returns any entries that page value includes the account characters and not only the account value

Current Behaviour

[
    {
        "id": 1,
        "attributes": {
            "page": [
                "my-account"
            ]
        }
    },
    {
        "id": 3,
        "attributes": {
            "page": [
                "account-edit"
            ]
        }
    },
    {
        "id": 5,
        "attributes": {
            "page": [
                "account"
            ]
        }
    }
]

Expected Behaviour using $in

[
    {
        "id": 5,
        "attributes": {
            "page": [
                "account"
            ]
        }
    }
]

At the moment, I can't use this plugin due to this missing feature.

Unless I am missing something. Any help would be greatly appreciated.

Extension installed but doesn't show in custom fields

Hi there, I've installed your extension following the instructions on the Strapi extension info page. I can see it is installed by looking at:
image
and
image

However, when I go to add the field to a content-type I see this:
image

Is there something I'm missing? I've restarted Strapi after installing the extension

Label does not support other languages

[
    "中文:1", // Chinese
    "option 2:2",
    "option 3:3"
]

for column 'value' at row 1
Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87...' for column 'value' at row 1

Cannot read properties of undefined (reading 'register')

企业微信截图_16728865181728
error: Cannot read properties of undefined (reading 'register')
TypeError: Cannot read properties of undefined (reading 'register')
at Object.module.exports [as register] (D:\xampp\htdocs\strapi\strapi-v4\node_modules\strapi-plugin-multi-select\server\register.js:5:25)
at Object.register (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\core\domain\module\index.js:47:46)
at Object.register (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\core\registries\modules.js:33:19)
at async Strapi.runLifecyclesFunctions (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:510:5)
at async Strapi.register (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:379:5)
at async Strapi.load (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:456:5)
at async Strapi.start (D:\xampp\htdocs\strapi\strapi-v4\node_modules@strapi\strapi\lib\Strapi.js:198:9)

Filtering by MultiSelect field returns error

I'm trying to use the operator $contains as $in doesn't work.

However, I get the following error from Strapi:

select "t0".*, "t0"."id" from "public"."articles" as "t0" where (("t0"."locale" = $1 and "t0"."featured" = $2 and "t0"."topics" like $3) and "t0"."published_at" is not null) order by "t0"."published_on" desc limit $4 - operator does not exist: jsonb ~~ unknown
error: select "t0".*, "t0"."id" from "public"."articles" as "t0" where (("t0"."locale" = $1 and "t0"."featured" = $2 and "t0"."topics" like $3) and "t0"."published_at" is not null) order by "t0"."published_on" desc limit $4 - operator does not exist: jsonb ~~ unknown
    at Parser.parseErrorMessage (/opt/app/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/opt/app/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/opt/app/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/opt/app/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:514:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

How to filter by this field?

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.