Giter Site home page Giter Site logo

Comments (8)

MWedl avatar MWedl commented on June 2, 2024

When you edit the field in the "report fields" section, it is not updated in the "preview data" section, and as a result not updating in he pdf preview.

When the field definition is updated, the server also updates structure of the PDF preview data. Note that there might be problems when working with multiple browser tabs, but there should be a warning in the UI. The PDF designer initially loads the field definition via an API request. When the field definition is changed in another tab, the PDF designer does not know that and still uses the old version. Could this be the root cause of your problems?

Does force refreshing the pdf preview page in your browser resolve the out-of-sync field definition problems?

Also the old fields somehow get cached I guess and if you try to use the same id (even after deleting it), the old value still pops out in the pdf preview.

This is intended behavior. If someone accidentally deletes a field, the content is still on the server. When you restore the field (create the deleted field again with the same ID), the old content is still there.

from sysreptor.

valrdclr avatar valrdclr commented on June 2, 2024

I have a single browser tab. Basically this is my flow that leads to the bug:

  1. Go to "Report Fields", edit the content of my field and press "Save"
  2. Go to "PDF Designer" section and try to refresh PDF.
  3. After refreshing the value doesn't change and if you go to "Preview Data" section in PDF Designer, it remains the old value. Additionally, I tried to refresh the page after saving the field value, and then going to the preview, and no luck.

I used:
Google Chrome Version 120.0.6099.71 (Official Build) (64-bit)
and
Chromium Version 117.0.5938.149 (Official Build) Debian kali-rolling (64-bit)

Sysreptor
Software Version: 2023.136

from sysreptor.

MWedl avatar MWedl commented on June 2, 2024

Could you check if the bug is still present in the latest version or the main branch?

edit the content of my field

What did you edit exactly? Updating the field structure (id, type, moving fields) should also update in the PDF preview. However, changing the default value of fields will not override it in the PDF preview, because there is already a value.

from sysreptor.

valrdclr avatar valrdclr commented on June 2, 2024

Could you check if the bug is still present in the latest version or the main branch?

edit the content of my field

What did you edit exactly? Updating the field structure (id, type, moving fields) should also update in the PDF preview. However, changing the default value of fields will not override it in the PDF preview, because there is already a value.

Indeed. I was updating the default value fields. I thought the preview is grabbing the same values.
So basically I need to play with my values in preview and then copy them back as default values? (I was doing this so far to make it work)
Maybe this part of the architecture is confusing, at least for me. Because I am expecting to design my field and save it as default value ( because later I will use the template for reports ). If I just play it in the preview then, after creating a new project and using the template, it will use the default value of that and everything I used in the preview doesn't matter.

from sysreptor.

MWedl avatar MWedl commented on June 2, 2024

Sorry to confuse you. This was a deliberate design decision to be able to overwrite default values in the PDF preview. For example the default value for a finding description you might have just a rough boilerplate text and some TODOs, but in the Preview data you want to test formatting with longer texts, secreenshots, etc.

Maybe we could update the PDF preview fields if field contents were not overwritten (i.e. field != default). This would automatically update unchanged fields (like in your use-case), while preserving manually overwritten field contents (no data loss).

from sysreptor.

valrdclr avatar valrdclr commented on June 2, 2024

Sorry to confuse you. This was a deliberate design decision to be able to overwrite default values in the PDF preview. For example the default value for a finding description you might have just a rough boilerplate text and some TODOs, but in the Preview data you want to test formatting with longer texts, secreenshots, etc.

Maybe we could update the PDF preview fields if field contents were not overwritten (i.e. field != default). This would automatically update unchanged fields (like in your use-case), while preserving manually overwritten field contents (no data loss).

I understood what you mean. Then maybe adding a button dropdown named "Save as default" (under the "Save" button, or near it) so that I can save the current design without using CTRL-C , CTRL-V every time I'm done with a change. This would also ensure there is always a backup in the "default" value which can be overwritten using that specific button. And maybe a popup "Are you sure you want to overwrite the current default value".
What do you think?

from sysreptor.

MWedl avatar MWedl commented on June 2, 2024

Yes that would be possible. I would prefer to have a "save as default" button per field for more granular control.

from sysreptor.

valrdclr avatar valrdclr commented on June 2, 2024

Yes that would be possible. I would prefer to have a "save as default" button per field for more granular control.

Yes. Exactly, per field. And maybe a bullet light indicator in the corner of the button or somewhere else that shows if it's already saved. (similar the one we already have on "Save" button).

By the way, I changed the title to not confuse people as it was my mistake as I didn't understood the design here.
I think we could close the issue. Thanks for the clarifications.

from sysreptor.

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.