Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image button not consistently present in Markdown editor #268

Closed
unixerius opened this issue May 30, 2024 · 6 comments
Closed

Image button not consistently present in Markdown editor #268

unixerius opened this issue May 30, 2024 · 6 comments

Comments

@unixerius
Copy link

I'm running a PoC with Sysreptor. So far, so good! Kudos to your team for the ease of installation.

I'm using release 2024.43, as linked in your installation documentation.

I noticed while editing templates and findings, that the button to insert an image into a text area is not consistently present.

  1. When I start a "New template", none of the markdown editors have the image button.
  2. When I add the template to a report/engagement, the markdown editors DO have the image button.
  3. If I go back to the template section, to edit the template which I just added to a report, now the editors also have the image button.
  4. BUT! If I now create another "New template", none of the markdown editors have the image button.

It seems that the presence of the image button in the Template editors is triggered by something specific. I'd much rather not have that happen at all :D The image button should always be present.

Screenshot: Markdown editor in report and in template after the template was added to a report.

editor-with

Screenshot: Markdown editor in a brand-new template.

editor-without

@aronmolnar
Copy link
Contributor

Thanks for this hint.
I think this is due to legacy reasons because in the past it wasn't possible to add images to finding templates.

You should, however, be able to add images by just pasting them to the markdown editor.

@unixerius
Copy link
Author

I had a suspicion it might've been because of historical reasons.

It's good to know that copy/past will still work! But the lack of the button suggests that an image wouldn't be possible at all, so it'd be great if this little bug gets fixed in a future release.

Thank you for your swift response!

@aronmolnar
Copy link
Contributor

Definitely. 👍

@MWedl
Copy link
Contributor

MWedl commented May 31, 2024

It's not just legacy, there's a technical reason behind it. When creating a new template, you are writing the initial template texts at the page /templates/new/. At this time, the template is not saved yet in the API/database and does not have an ID yet. Uploading images at this stage is not possible, because the API does not know which template to assign the images to. Users have to save the template once (and are redirected to /templates/<id>/) in order to upload images.

I think we should change the behavior to immediately create a new empty template in the API to allow image uploads, instead of using an intermediate page. This change, has the effect that users are no longer able to cancel template creation, because the template resource is already created in the API/database.

When creating templates from findings of existing project, there is an intermediate page too where the template is not created in the API yet (and therefore image upload is not possible). This intermediate page is intended to remove any customer-specific infos from the template before saving it. I think we should not modify this page. If the template would be saved immediately, customer infos will remain in the template's history. We should give users the chance to remove those sensitive customer infos to not end up in the template and history for everyone to see.

@unixerius
Copy link
Author

Thank you for your thorough analysis @MWedl! I really appreciate it.

It's an interesting situation for sure, with lots of factors to weigh. I can definitely live with it if my original issue is not tackled, because it can be explained why it happens. If you feel this issue will not be addressed, please feel free to resolve this issue ticket.

@MWedl
Copy link
Contributor

MWedl commented Jun 18, 2024

@MWedl MWedl closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants