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

Styling options in Rich attributes #887

Open
1 of 4 tasks
yankovs opened this issue Nov 1, 2023 · 1 comment
Open
1 of 4 tasks

Styling options in Rich attributes #887

yankovs opened this issue Nov 1, 2023 · 1 comment
Labels
type:feature New feature description e.g. which involves implementation of new components zone:frontend MWDB frontend tasks

Comments

@yankovs
Copy link
Contributor

yankovs commented Nov 1, 2023

Feature Category

  • Correctness
  • User Interface / User Experience
  • Performance
  • Other (please explain)

Hey! :)

This isn't really a feature suggestion but the feature category seemed the most appropriate. This is more of a question.

Recently I used the rich attribute feature in MWDB, and in there I made a table, where one of the fields in it is sha256 hash and it is very long. This makes the table come out of the attribute boundaries and overall this is hard to work with for the end user as part of the table is under another UI element. What I would like to have as a user is either a way to specify I want the text to wrap, or maybe to show a short part of the hash (first 8 letters for example) and have it show the full value on hover and let you copy it somehow.

Generally mustache & markdown feels very restrictive, but maybe it is possible in some way. I was also thinking about maybe letting the user straight up write JS (so for example, a user can use substr to show part of a string), maybe by throwing their input into eval() but it seems not safe at all 😓.

Edit: Maybe what I'm thinking of is more in the line of filters in Jinja2. Would be pretty cool if it was possible to do {{hash|substr(0,8)}}

@psrok1
Copy link
Member

psrok1 commented Nov 2, 2023

Hi!

I really like the idea with filters! I'm also not really sure about executing arbitrary JS from the template, but set of predefined filters extensible by plugins should work pretty OK.

Most of the rendering machinery is in these files:

@psrok1 psrok1 added type:feature New feature description e.g. which involves implementation of new components zone:frontend MWDB frontend tasks labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature description e.g. which involves implementation of new components zone:frontend MWDB frontend tasks
Projects
None yet
Development

No branches or pull requests

2 participants