ploi / roadmap

Open source roadmapping software
https://roadmap.ploi.io
MIT License
407 stars 80 forks source link

Disable upload in markdown editor public page #74

Closed Cannonb4ll closed 1 year ago

Cannonb4ll commented 2 years ago

As of now, it is possible to upload images in the markdown editor. We should make it configurable if this is allowed, or not.

On the markdown editor filament component:

->disableToolbarButtons(['attachFiles'])
msaadm commented 2 years ago

Hey @Cannonb4ll, My name is Saad, and I want to contribute to this Issue. It is my first issue on OpenSource, so Kindly bear with me on that part :) I have a good amount of experience with PHP/Laravel, so I am feeling comfortable with the codebase. (Btw I am new with filament and livewire)

~~I setup the project and did some research and found that I have to implement your suggested code in Filename: app\Http\Livewire\Modals\Item\CreateItemModal.php on Line#70 to disable it When Submitting Item.~~

But on which condition we want to remove this ability, can you guide me on this please. For example: Except admin no one should able to upload image, or something allowed to individual user.

I think I got it wrong, I just viewed Admin area, so there is a whole settings area, I believe we need an option there to allow/disallow upload in markdown. Can you let me know what we refer as 'public page', Is Item single page where other user(s) can view item and comment on it considered as a public page?

Cannonb4ll commented 2 years ago

Hey @Cannonb4ll, My name is Saad, and I want to contribute to this Issue. It is my first issue on OpenSource, so Kindly bear with me on that part :)

I have a good amount of experience with PHP/Laravel, so I am feeling comfortable with the codebase.

(Btw I am new with filament and livewire)

~~I setup the project and did some research and found that I have to implement your suggested code in

Filename: app\Http\Livewire\Modals\Item\CreateItemModal.php on Line#70 to disable it When Submitting Item.~~

But on which condition we want to remove this ability, can you guide me on this please. For example: Except admin no one should able to upload image, or something allowed to individual user.

I think I got it wrong, I just viewed Admin area, so there is a whole settings area, I believe we need an option there to allow/disallow upload in markdown. Can you let me know what we refer as 'public page', Is Item single page where other user(s) can view item and comment on it considered as a public page?

Hey Saad!

Great to hear you want to contribute🥳

I'm not sure what you mean with public page and all, but what we want with this is a setting (toggle) inside the settings page that blocks the upload of files inside the markdown editor.

Let me know if you have any other questions!

msaadm commented 2 years ago

I'm not sure what you mean with public page and all

It's inside the title of the issue "Disable upload in markdown editor public page"

Do we want to disable Upload of files inside all markdown editor instances found anywhere in the system by using that admin settings? or there may be any other case?

Cannonb4ll commented 2 years ago

@msaadm Yes correct, in the frontend (not admin) it should be possible to block image uploads (you can drag and drop images inside the editor).

There's 2 places where you can find the editor:

  1. Create item modal
  2. Comment on items