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

Enable hyperlinks in in-tool Help field #3579

Closed
allanaaa opened this issue Feb 4, 2021 · 8 comments · Fixed by #3648
Closed

Enable hyperlinks in in-tool Help field #3579

allanaaa opened this issue Feb 4, 2021 · 8 comments · Fixed by #3648
Assignees
Labels
Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. grel The default expression language, GREL, could be improved in many ways! Module: Frontend These issues involve working on HTML, CSS, and JavaScript code that affects the user interface. Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements.
Milestone

Comments

@allanaaa
Copy link
Contributor

allanaaa commented Feb 4, 2021

The expressions editor window includes a Help tab that has some plain-text information about each variable and function.

display3

I am editing this text right now to match the user manual. I'd like the fields to render with links (they currently just have full URLS that users can copy-paste).

If you look into the code, you'll find that the function files themselves support the Help entries, for example for cross():

@Override
public String getDescription() {
    return "Looks up the given value in the target column of the target project, returns an array of matched rows. Two values match if and only if they have the same string representation. " +
            "The first argument will be interpreted as cell.value if set to cell. " +
            "The second argument will be interpreted as the current project name if omitted or set to \"\". " +
            "The third argument will be interpreted as the index (starts from 0) column if omitted or set to \"\"";
}

@Override
public String getParams() {
    return "cell or value, string projectName (optional), string columnName (optional)";
}

@Override
public String getReturns() {
    return "array";
}

Proposed solution

Render these text entries with hyperlinks, somehow! Whether it's simple HTML or markdown or what-have-you, I can work with it.

@allanaaa allanaaa added Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. labels Feb 4, 2021
@sarahelshabrawy
Copy link
Contributor

I would like to help with this issue

@wetneb
Copy link
Sponsor Member

wetneb commented Feb 4, 2021

Thanks! Note that there will be a few design decisions to do on this issue, so perhaps it's worth discussing your approach here before opening a pull request, to make sure we agree on the direction.

@wetneb wetneb added expression language Support for scripting languages (GREL, Python…) Module: Frontend These issues involve working on HTML, CSS, and JavaScript code that affects the user interface. grel The default expression language, GREL, could be improved in many ways! and removed Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators expression language Support for scripting languages (GREL, Python…) labels Feb 5, 2021
@sarahelshabrawy
Copy link
Contributor

So my approach is to delete the String URL reference from all translation .json files and add an anchor tag in expression-preview-dialog class to stand for all languages, Another change is to replace .text() with .html() in order to render the html content of the String of the table cell
Below is a screenshot of the link rendered
image
Is that okay ?
As for the other link I have a question about it.

@wetneb
Copy link
Sponsor Member

wetneb commented Feb 10, 2021

I think allowing HTML in translations is a sensible way to go. Since we review the translation updates as pull requests we can consider these strings as trusted. Allowing HTML markup could be an opportunity to style code samples more nicely (such as row.index instead of 'row.index').

@sarahelshabrawy
Copy link
Contributor

I agree, I will go with that approach then and create a pull request.

@NikitaEmberi
Copy link

Hey, I am new to open source contribution. I see even though @sarahelshabrawy has issued a pull request, there were merge conflicts. This issue seems like something I could work on. I am not sure if @sarahelshabrawy is already working on it, can I also try for the same issue?

@tfmorris
Copy link
Member

@NikitaEmberi The issue is still assigned to them and the last activity was only a few days ago. Please choose an issue which isn't assigned to anyone.

@sarahelshabrawy
Copy link
Contributor

I solved the conflicts I had.
I opened a new PR and I'm waiting for a review.

@wetneb wetneb linked a pull request Feb 20, 2021 that will close this issue
@wetneb wetneb added this to the 3.5 milestone Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. grel The default expression language, GREL, could be improved in many ways! Module: Frontend These issues involve working on HTML, CSS, and JavaScript code that affects the user interface. Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants