Coder Social home page Coder Social logo

Comments (5)

alanablett avatar alanablett commented on June 16, 2024

Hi @awcodes I'm not sure if this one is totally fixed? I Was still able to select previously uploaded files when using the acceptedFilesTypes argument on my CuratorPicker field.

I was taking a look through the code for the curator panel component and saw that the getFiles method actually uses a property called types to check for file types. So I went ahead and created an override of vendor/awcodes/filament-curator/resources/views/components/actions/picker-action.blade.php locally and passed through the acceptedFilesTypes but passed them through to the types property. This seems to work as expected. However I didnt know if there was a specific reason you'd done it in the way you have. My picker-action.blade.php looks like this

<livewire:curator-panel
    :accepted-file-types="$acceptedFileTypes"
    :types="$acceptedFileTypes" // copy of the acceptedFileTypes
    :disk-name="$diskName"
    :directory="$directory"
    :image-crop-aspect-ratio="$imageCropAspectRatio"
    :image-resize-mode="$imageResizeMode"
    :image-resize-target-width="$imageResizeTargetWidth"
    :image-resize-target-height="$imageResizeTargetHeight"
    :is-limited-to-directory="$isLimitedToDirectory"
    :is-multiple="$isMultiple"
    :max-items="$maxItems"
    :max-width="$maxWidth"
    :min-size="$minSize"
    :max-size="$maxSize"
    :modal-id="$modalId"
    :path-generator="$pathGenerator"
    :rules="$rules"
    :selected="$selected ?? []"
    :should-preserve-filenames="$shouldPreserveFilenames"
    :state-path="$statePath"
    :visibility="$visibility"
/>

from filament-curator.

awcodes avatar awcodes commented on June 16, 2024

Are you on v2 or v3 of the plug-in? It does work on v2. Unless I'm misunderstanding what issue you're having.

from filament-curator.

alanablett avatar alanablett commented on June 16, 2024

Are you on v2 or v3 of the plug-in? It does work on v2. Unless I'm misunderstanding what issue you're having.

I'm using awcodes/filament-curator:3.0.0 and filament/filament:3.0.41

I just went ahead and created a test project using awcodes/filament-curator:2.10.1 and filament/filament:2.17.53 and can confirm that the acceptedFileTypes array does work as expected. The list of available files is filtered down to just the types that I specify on the field. So it looks like a v3 specific issue.

from filament-curator.

awcodes avatar awcodes commented on June 16, 2024

Ok. I'll get it corrected as soon as I can. Thank you.

from filament-curator.

alanablett avatar alanablett commented on June 16, 2024

Ok. I'll get it corrected as soon as I can. Thank you.

Thank you so much for the awesome plugin 👏👏

from filament-curator.

Related Issues (20)

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.