#753 Activity log - Make links instead of text in log message#869
Conversation
|
Not sure, maybe it would be better to store all the links into the database. |
This file should not be changed on this commit.
|
Hello @NikolaSvobodova1983 Thanks a lot for your contribution, however, I'm curious if it's not too complex and a complicated approach to this task. There is a lot of changes when I thought and expected to have a much simpler solution. I don't know if it's worth overall to implement such a lot of code, just to show links in Activity Log. We will think about that. |
Hello @PatrykPorabik |
Resolves #753 Activity log - Make links instead of text in log message
Type: feature
Solution
LinkedCommentFormatter class adds the link to old activity log comment, already storing in DB.
It tries to find the comment's string pattern by system keyword, parses the comment, and changes the parameter of the comment to link.
LinkedCommentCreator class adding the link to the newly created activity log comment, which is about to insert to DB.
It uses comment's pattern, comment's parameters and activity log system keyword to create linked comment and store it to DB.
Links patterns to the entities are stored in ActivityEntityKeywordsProvider class.
Breaking changes
CustomerActivityService.InsertActivity - on each invoke the method calls LinkedCommentCreator.CreateLinkedComment.
In case CreateLinkedComment method throws an exception, it throws the exception further.
Cshtml view files are changed so that the column 'comments' are not encoded anymore - so the link is shown in the correct way. May be not safe.
Testing
Added unit tests:
LinkedCommentFormatterTests
LinkedCommentCreatorTests