Home Analyst Portal

Change position Support Group in MA form.

Roelof_LuingeRoelof_Luinge Customer IT Monkey ✭
Hi,

Is it possible to relocate Support Group field?
Before it was hard coded to the MA form we used custom code in the custom.js and was the Support Group located just below Description. We like to have this field back on that location.




Regards,

Roelof

Best Answers

  • Roelof_LuingeRoelof_Luinge Customer IT Monkey ✭
    Answer ✓
    Ryan_Lane said:
    Hello!
    There are a few ways to go about doing this as shown by the previous answers using custom task scripts to move the field.  In my case I went to the source templates for generating the HTML to make things a bit cleaner and help with page responsiveness on load.

    Activities are generated via HTML template files vs. the JSON files for Work Items (Incident.js/ServiceRequest.js) which are located in the "\Scripts\app\templates\activity" directory.  Modifying the relevant template file directly or using an HTTP Redirect will allow you to rearrange and add/remove fields on load.  In our business case we wanted to rearrange and simplify the Manual Activity interface in the Portal but the general steps are the same to modify just the arrangement of fields:


    To achieve this without modifying Cireson files I ran through the following steps:
    1. Copy the stock manual-activity.html from "\Scripts\app\templates\activity" to "CustomSpace\Scripts\app\templates\activity":

    2. Modify the new custom manual-activity.html so the Support Group (ServiceTeam in OP's case) field HTML is relocated where we'd like it.  In my case it was from Line 140 to Line 45 so Support Group and Assigned To fields share the same row:

    3. Create an HTTP Redirect from the stock manual-activity.html to our new custom manual-activity.html:


    We have implemented this in our production environment and have noted a couple pros/cons:

    Pros:
    - No additional scripts to run on clients to perform the rearrangement so page responsiveness isn't affected.
    - No modifications of Cireson source files so Portal upgrades and modifications are easier to track and patch when needed.

    Cons:
    -  IIS HTTP Redirects require minor maintenance on Portal upgrades to recreate either manually or via a script.
    -  If the source HTML template changes on a Portal upgrade then the custom HTML template file will need to be recreated to incorporate any changes.
    This works perfect! thanks!

    Regards

    Roelof

Answers

  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    try adding this to load on your workitems to move the support group on MA's
    $NSUDD = $('div.col-group div div label:contains("Support Group")').parent().parent().parent().parent();<br>$('div.col-group div div label:contains("Description")').parent().parent().parent().after($NSUDD)


  • Roelof_LuingeRoelof_Luinge Customer IT Monkey ✭
  • Roelof_LuingeRoelof_Luinge Customer IT Monkey ✭
    Jeff_Lang said:
    try adding this to load on your workitems to move the support group on MA's
    $NSUDD = $('div.col-group div div label:contains("Support Group")').parent().parent().parent().parent();<br>$('div.col-group div div label:contains("Description")').parent().parent().parent().after($NSUDD)



    Hi Jeff,

    Thanks for your response.

    Do I have to add this into the custom.js? Tryed this, but no results.

    Regards, Roelof

  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    sorry but i pasted that one real quick and assumed you would know to put it inside a formtasks.add for each workitem type, thy this one, since i'm not at work currently i haven't been able to test it, so i hope i didn't mistype something :smile: 
    app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {<br>	formObj.boundReady(function () {<br>    $NSUDD = $('div.col-group div div label:contains("Support Group")').parent().parent().parent().parent();<br>    $('div.col-group div div label:contains("Description")').parent().parent().parent().after($NSUDD)<br>	});<br>});<br>app.custom.formTasks.add('ServiceRequest', null, function (formObj, viewModel) {<br>	formObj.boundReady(function () {<br>    $NSUDD = $('div.col-group div div label:contains("Support Group")').parent().parent().parent().parent();<br>    $('div.col-group div div label:contains("Description")').parent().parent().parent().after($NSUDD)<br>	});<br>});<br>app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) {<br>	formObj.boundReady(function () {<br>    $NSUDD = $('div.col-group div div label:contains("Support Group")').parent().parent().parent().parent();<br>    $('div.col-group div div label:contains("Description")').parent().parent().parent().after($NSUDD)<br>	});<br>});<br>app.custom.formTasks.add('Problem', null, function (formObj, viewModel) {<br>	formObj.boundReady(function () {<br>    $NSUDD = $('div.col-group div div label:contains("Support Group")').parent().parent().parent().parent();<br>    $('div.col-group div div label:contains("Description")').parent().parent().parent().after($NSUDD)<br>	});<br>});<br>
  • Roelof_LuingeRoelof_Luinge Customer IT Monkey ✭
    Answer ✓
    Ryan_Lane said:
    Hello!
    There are a few ways to go about doing this as shown by the previous answers using custom task scripts to move the field.  In my case I went to the source templates for generating the HTML to make things a bit cleaner and help with page responsiveness on load.

    Activities are generated via HTML template files vs. the JSON files for Work Items (Incident.js/ServiceRequest.js) which are located in the "\Scripts\app\templates\activity" directory.  Modifying the relevant template file directly or using an HTTP Redirect will allow you to rearrange and add/remove fields on load.  In our business case we wanted to rearrange and simplify the Manual Activity interface in the Portal but the general steps are the same to modify just the arrangement of fields:


    To achieve this without modifying Cireson files I ran through the following steps:
    1. Copy the stock manual-activity.html from "\Scripts\app\templates\activity" to "CustomSpace\Scripts\app\templates\activity":

    2. Modify the new custom manual-activity.html so the Support Group (ServiceTeam in OP's case) field HTML is relocated where we'd like it.  In my case it was from Line 140 to Line 45 so Support Group and Assigned To fields share the same row:

    3. Create an HTTP Redirect from the stock manual-activity.html to our new custom manual-activity.html:


    We have implemented this in our production environment and have noted a couple pros/cons:

    Pros:
    - No additional scripts to run on clients to perform the rearrangement so page responsiveness isn't affected.
    - No modifications of Cireson source files so Portal upgrades and modifications are easier to track and patch when needed.

    Cons:
    -  IIS HTTP Redirects require minor maintenance on Portal upgrades to recreate either manually or via a script.
    -  If the source HTML template changes on a Portal upgrade then the custom HTML template file will need to be recreated to incorporate any changes.
    This works perfect! thanks!

    Regards

    Roelof
  • Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭

    Is there a way to take this one step further?

    Say I have two MA types.

    One is our typical OotB MA.

    The second type is used for Workstation Builds and will need 2 specialized CI pickers, both required, one for the Hardware Asset and the other Owner (AD User).

    Any way to branch to a custom MA template for Workstation Build MAs?

Sign In or Register to comment.