OpenWaterFoundation / owf-app-dev-ng

Open Water Foundation Angular application to develop common libraries
0 stars 1 forks source link

Dashboard text widget - feedback #43

Open smalers opened 2 years ago

smalers commented 2 years ago

The text widget properties could be improved to be more consistent with other widgets:

  1. The type should be a single value corresponding to the widget type and underlying code. In this case it should be text. In general, widgets should have a single type that identifies the type of widget and simplifies code.
  2. The content type (Markdown, HTML, text), etc. could be specified in one of the following ways and should be compared with other code for consistency:
    1. Add a contentType=Markdown or similar property to indicate the content type. The path could then generically be textPath=.... This has the advantage of being more explicit and is similar to mime type.
    2. Indicate the content type in the file extension and use a generic property name, for example textPath=/something.md. The disadvantage is that the file extensions would need to be interpreted and supplying text in a property would still require something like contentType (see below).
    3. Indicate the content type in the property name, and allow any filename, for example markdownPath=/something.md. The disadvantage is that different JSON properties would need to be handled for each content type (this complicates the code if we build a dashboard configuration UI tool.
  3. Could allow the text to be specified as a property, for example using text=.... If the contentType property is used, the text would be handled accordingly. This would allow specifying inlined text in the configuration without having to read a file, which would simplify the configuration for simple text.
  4. Should more complex CSS be allowed? For example, what if a large file is used? The documentation could explain how the showdown or application CSS is used by default. I don't know if it makes sense to supply a CSS file specific to a document.