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
Adding Dynamo Dictionary link to Context Menu Help Popup #7572
Conversation
@yeexinc - Does the link go to the node's page in the dictionary or just to the front page? If it is just to the front page, that is fine for now. But, in the future, we should file another task to get the link pointing to the node's page. Is that doable? |
@Racel , for now it only takes the user to the front page. Though I do agree that going to the node's page would make it a better feature. |
@yeexinc as discussed you can easily link each node to its own help page in DynamoDictionary as suggested by @Racel . You would need to bind to the |
Thank you for the review @aparajit-pratap , the new changes should direct the user to the node's help page now. |
|
||
// Obtain the node's default name from its creation name. | ||
// e.g. For creation name DSCore.Math.Max@double,double - the name "Max" is obtained and appended to the final link. | ||
int indexAfter = (CreationName.LastIndexOf('@') == -1) ? CreationName.Length : CreationName.LastIndexOf('@'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be an easier more straightforward way to retrieve the node name. Try using the Nickname
or Name
property of NodeModel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aparajit-pratap , it appears that some nodes have empty strings as their Name
(an example is AnalysisExtensions.IsAlmostEqualTo). Though, the actual name is still obtainable from CreationName
, something which I don't quite understand as CreationName
seems to return the node's Name
property from their get
method (line 77 of the code in this file).
Nickname
changes accordingly with the UI when the user renames the node. Hence, I think that CreationName
gives a better accuracy among the three.
string finalLink = Configurations.DynamoDictionary + "#/"; | ||
if (category == null || category == "") | ||
{ | ||
return finalLink; // if there is no category, return the link to home page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you simply return Configurations.DynamoDictionary
. That way you won't have to wrap this up in a try-catch
below, would you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was concerned that ((TextBlock)sender).Tag.ToString()
in NodeHelpPrompt.xaml.cs
may throw some unexpected errors, but that seems unlikely in this case. Will fix that in my next commit. Thanks!
@yeexinc please take a look at my comments and give them some thought. Thanks! |
@aparajit-pratap @yeexinc - This is great that you got some of the nodes pointing to the correct dictionary location. Please keep in mind overloads where the category/node model approach might not be enough. Take for instance, Point.ByCoordinates. In the dictionary, the first overload works as outlined in the approach @aparajit-pratap suggested. The subsequent overloads use the additional parameters as part of the url...http://dictionary.dynamobim.com/#/Geometry/Point/Create/ByCoordinates(x_double-y_double-z_double) |
@Racel in the case of overloads therefore, the link may be misleading as it will always lead the user to the first overload. @riteshchandawar any thoughts? |
@aparajit-pratap - I agree, we should not lead the user to the first overload. Is it not possible to just use similar logic to what is used for the dictionary? Checking with ModeLab about this... |
@aparajit-pratap @yeexinc - Please check out line 273 of https://github.com/ekatzenstein/DynamoDictionary_React/blob/master/src/App.js for routing logic setup in dictionary |
@aparajit-pratap @yeexinc - Just checking in on this? How is it going? And are we ready to merge? |
@Racel - We were still looking into the issue with overloads. |
@yeexinc - I think the overloads are loaded alphabetically. So, the first overload alphabetically will not have the parameters in the URL. See if that works... |
@Racel - Checking the overloads alphabetically works for some cases, but not all. Take "Point.ByCoordinates" as an example, the overloads for this method in alphabetical order are Point.ByCoordinates(x,y) and Point.ByCoordinates(x,y,z). This will generate valid URLs, since only the subsequent overload contains parameters in its URL. It would be good if there is a rule to decide which function requires parameters and which does not, for consistency. |
(Note: operations to append parameters are not included in this commit)
@Racel I had written an email to Erick from Modelab to ask if they could consistently add parameters to all overloads in the DynamoDictionary website. Could you confirm with him if that's possible? |
@aparajit-pratap - The current state of this PR will always direct the user to the first overload, with no parameters added, as adding parameters will take the user to a blank page if the URL is invalid. It can be merged if you think it is okay for the time being. |
Thanks @yeexinc please cross-merge into |
Thank you for the review @aparajit-pratap ! |
…1.2.3_master (#7620) * Added Dynamo Dictionary Link to Context Menu Help Popup * Redirect user to the node's page * Updated codes based on previous review (Note: operations to append parameters are not included in this commit) * Reverted NodeHelpPrompt.xaml * Reupdate NodeHelpPrompt.xaml * Removed JsonIgnore for RC1.2.3
Purpose
This PR is to address DYN-306
A link to Dynamo Dictionary is added at the bottom of help menu popup window.
If the size of the content is longer than the default window size, user has to scroll down to see the link. E.g.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@aparajit-pratap
FYIs
@riteshchandawar @Racel