Home Community Uploads
image

Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.

DISCLAIMER

All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.

Cireson does not and will not support or maintain these enhancements, extensions, and scripts.

For Team Cireson uploads click here.

Custom expanded action log (comments)

13»

Comments

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    edited April 2018
    @Giovanni_Perini
    I've actually just done this, but not in the same way, that Martin was going to do it. You can add this snippet in the beginning of the GetCommentHtml function, replace the string with your service account name (remember domain and escape the backslash with another backslash), and it'll hide entries from the workflow account for non-analysts. If you want it for analysts too, just delete the whole first if on the third line.
    function GetCommentHtml(comment) {<br>&nbsp;&nbsp;&nbsp; // Hide ActionLogs from service account for non-analysts<br>&nbsp;&nbsp;&nbsp; if(pageForm.isAnalyst == 0) // Delete this whole line to hide from everybody<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(comment.EnteredBy == "DOMAIN\\ACCOUNT") return " ";<br>[...]

  • Mikkel_MadsenMikkel_Madsen Customer Advanced IT Monkey ✭✭✭
    I've added 
    "white-space": "pre",
    So linebreaks and spaces are preserved in the actionlog. It makes is more readable for the users :smiley:

    &nbsp;addRule(".chat", {<br>&nbsp;<i>&nbsp;</i><b><i>"white-space": "pre",</i></b><br>&nbsp;&nbsp;"list-style": "none",<br>&nbsp;&nbsp;"margin": "10px 0 0 0",<br>&nbsp;&nbsp;"padding": "10px 0 0 0",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "border-top": "3px solid #a3b8c2"<br>&nbsp;});



  • Gerhard_GoossensGerhard_Goossens Customer Advanced IT Monkey ✭✭✭
    I had a request from the analysts to display a number next to the comments so that they can quickly refer to a previous comment. @Martin_Blomgren will this be possible and can you please provide some guidance on how to accomplish this.

    Regards
    G
  • Kevin_StaceyKevin_Stacey Customer IT Monkey ✭
    Is this compatible with portal versions 8.6.*? I've tried in two separate environments and it's not working in either. I've tried the original code in the first post by @Martin_Blomgren as well as the modified code by @Brian_Wiest with the same results. For testing I've tried removing our 'incident.js' in the customspace folder with no luck, tried copying & pasting the script right in to custom.js as opposed to calling it, no joy!
    I believe our users would very much like the functionality of the auto-expanded comments, hopefully I can get this working for them :smile:
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    What errors are you getting in Dev tools. Have been running that same code for a number of versions. Currently at 8.7.0.2016 all without issue on IE11 and Chrome. 
  • Kevin_StaceyKevin_Stacey Customer IT Monkey ✭
    Thanks Brian. Wasn't getting any errors, tried it in Firefox and then it threw-up, seems there is a missing '}' somewhere. Went back to IE and changed emulation to 'Surface Pro 4' and the same missing '}' error, not sure why it wouldn't show in default.
    So removed everything from custom.js except the custom Action log and it loaded fine. Added it to our PROD and it loaded fine as well. Seems our DEV enviro is out of control and needs a refresh :smile:
  • Gerhard_GoossensGerhard_Goossens Customer Advanced IT Monkey ✭✭✭
    Im running this on 8.7.2.2016 on 1807 and it is working like a charm.
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Myself and with the help of a team mate(s) made a few changes to the customization.

    We ran into issues processing comments where analysts would copy content that had HTML references, (poorly done)
    One example is that someone liked to have <Script> as a place holder in emails so the code would hang up on the tag. (Since there was no </Script> tav)
    The script block now converts everything to a txt format, so all scripting if added into the comments just displays instead of trying to run. (Line 50)

    Added another Error catch if a entry had undefined either thru user error or billable time, you will now get a row of just No Comment(s) Available. (Line 50)

    Also added ability to add custom css blocks for workflow account. Line 53 add your Domain\\UserAccount to have the CSS Tag applied.

    Split the solution into two files one just for the JS and one for the CSS.
    Add both into your customspace
    Add the CSS to your custom.css import

    Enjoy
  • Joakim_NormannJoakim_Normann Customer IT Monkey ✭

    @Brian_Wiest I've been trying to get rid of the input from the workflow account in the action log using your customization above, but it still shows up in the action log. I have added the domain and the username of the workflow account on Line 53 as well as the display name of the account. Am I missing something in the modification in order to get it to work as expected?

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    @Joakim_Normann

    Brian's code does not hide the workflow comments, it just marks them separately. But you can add display: none; to the li.workflowaccnt ruleset in the css, to make it hide the comment.

  • Joakim_NormannJoakim_Normann Customer IT Monkey ✭

    @Konstantin_Slavin-Bo Thanks for clearing that up. I misunderstood the code and thought that it would remove the workflow comments. I did as you suggested and now the comments from the workflow account is hidden which makes the action log look more clean. Thanks for the tip! :)

  • Matt_OvertonMatt_Overton Customer IT Monkey ✭

    This is such a massive improvement, thank you so much guys! Is there a way I can suppress the "No Comment(s) Available" lines so they don't actually appear on the page at all? I'm no good at CSS so don't really know how to achieve this.

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    @Matt_Overton You'll need to rewrite line 50 in the .js file a bit, such that it returns an empty string, if there's no comments. This should work:

    if(typeof comment.Description === 'undefined' || comment.Description == null) return " ";
    var commentDescription = comment.Description.replace(/</g, '&lt;').replace(/>/g, '&gt;');
    

    Replace line 50 with those two lines.

  • Matt_OvertonMatt_Overton Customer IT Monkey ✭

    @Konstantin_Slavin-Bo This is perfect, thank you! It's looking so good now, this is just brilliant! :)

  • Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭
    edited July 2020

    Just got to test this in our lab environment , this is truly awesome. Any idea however, on how to make this load / work on the new activity pages in introduced in 9.6.1 as well please? (You can have actionlog enabled there as well but it's not loading there) 😊

    I'd be VERY grateful if you could help me out with this ☺️

  • Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭

    Also noticed as of now that the contents of Send Email are mapped to the actionlog as "undefined" , any help on this as well?

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭

    Currently known @Gabriel_Lences. PR98305

  • Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭

    Thanks for clearing that up Adam, thought it had to do something with the customization :)

  • Matt_OvertonMatt_Overton Customer IT Monkey ✭

    I've noticed there's a new feature in the latest portal that allows you to edit action log entries you've added before clicking Save/Apply (with a little pencil icon next to them). Is there any way to make that work with this customisation? I'm loathe to go back to the classic action log if I can avoid it...

Sign In or Register to comment.