-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add support for opening external programs in infoclick
#1319
Comments
I've had a look at this. When we're using markdown, the component rendering the markdown does some uri-transformations. (We're using react-markdown, see: their GitHub page. React-markdown makes sure that the provided url follows a few rules, one of which is that the protocol has to be one of the following: However, i found that the uri-tranformer can be overridden, see below: <ReactMarkdown
transformLinkUri={(x) => x}
remarkPlugins={[gfm]} // GitHub Formatted Markdown adds support for Tables in MD
rehypePlugins={rehypePlugins} // Needed to parse HTML, activated in admin
components={this.components} // Custom renderers for components, see definition in this.components
children={this.markdown} // Our MD, as a text string
/> We could create out own function and pass it in the I made a quick test with |
This solution must be properly tested. Also, the `transformLinkUri` key must be added to the admin-application.
Added a solution that could possibly work. Feel free to check out and test for yourself. |
I'll check it out later today, seems promising! |
I added the setting to admin as well in the branch |
I have tested now and it works very well. However, the check box in admin does not seem to read the saved value in the config file. The checkbox is checked regardless of the value in config. Could it be related to the .NET backend or is it the same in NodeJS? Great job regardless! |
PR please, @Hallbergs? |
* (Proposal) simple solution for #1319 (WIP, see desc) This solution must be properly tested. Also, the `transformLinkUri` key must be added to the admin-application. * Added proposed url-setting to admin * Fixed default value in admin for `transformLinkUri` * Fixed bad default value for `transformLinkUri` in infoClick
Description
The current
infoclick
functionality does not support including links that open external programs, causing inconvenience for users. They must manually switch between programs or use less efficient workarounds while working withinfoclick
.Example
In the
layers
configuration file, the link can look like the example below:a href=\"appcontainer:ExternalApp/OpenIssue?issueid={issueid}
However, when rendered in
infoclick
, it is converted toa href="javascript:void(0)"
, which results in a client error and prevents the link from functioning as intended.Suggested solution
Implement a feature that allows users to include links within
infoclick
that can open external programs, such as installed desktop applications or other non-browser-based tools.The text was updated successfully, but these errors were encountered: