Skip to content

Commit 5660dd8

Browse files
committed
added forks/children to history
1 parent 69bb8da commit 5660dd8

3 files changed

Lines changed: 25 additions & 22 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
tXqFvoVB0S_TOJuOTesdVresV7RX8Z2odjroznhnmrjUbEcH4RC8nO7iRcjk2wmKubXhsiHbaEk3fhux943eM-hbLSpmtFddcb48e2jd7zkgx8EdPtr60F4vYrfRUzeWzRqN1PHXA_3GKFOpVt7KlJQS3-JVuvuBh-sJCeGvoP83_LnwUpwe9nX1ZOktRryG03woyiLFzioDptLjf1legXE9c1fWh8iSOPo9M8CE8UnwHA6zA9qilwtOd3Sy_d1a_WL_ee23fMYVbF4qjXodCK1MTmY1GpViojtlauB6Nhd2Kr-AgfG-zqtVXNwcDKUrXDqcfgPf8ygiSpY90G0rmr1ihHDW49cbwmnZwkQlqJAcgJ4I3xWA-8_iWsuB09zWw04IlTu5OAwBJh_wrv3VGLoLl7Tx4v2DrMaXjyio3Ri8ygZO1T_ETqHN7sZiJYVmgXWpQofWA2N2ubTftmdH-Vr6x5UUHBGfuKgroAZlQzZtFXhQJc_k7LldVRBCCz9EnGXr3diRIU3GeKnZTVFSy5arOnyP4lCaL7UW9YTvLFRaqLsS1n1H0BhrsM9C4DpQvcqGSvj_VcUxJhpFf_nSfJ7Ec-Op_ttY2NfT6W8HvCI_jx2I4lva5Rw1JjD5dvNriUBOL6wKOQjSSGxYzCric0hlDn12VfkfBGlNda6atb8
1+
ud4GOzPZP5RvqMRJIWemjPal0w1c31OhUfYrlW08rYTmegGqMei3PFwyh-Rldhe6W2oYu1yzKe-Me3EE2abvh31WIYDm6aA2wKKoewsKgry80xDNNT2ST27VsnkdV19-EPbDfQtr4OcxX6iD4Vl-KZrEXsBKmIWJOzGRl9lE5Ue1lVvi_mXacGRPxLMAyOMNW0DHkjIBHWuBa4ov76b0gnWAevILEcv6gEeHrNU80JyV0myY6VGmG7NvuVUlLsZLbg--C_OLvgKFunqZ5F6O08lADFcwGCgEvjhI4N0JzLSgT8SgbS8XlIp7GGfdQPdfFalkKN0komqBpl9A1t_9a4w65a-2JykCH6p9qRzsYQN8OoD2K-x-p27NiTF5cAM4cKuMnxS0Rq2M9RNz8LFj6vf3GAvpSubTDc9ElSHQdQ_iqN_Vp1cdI1FrzvlKP5BG0ECPujHkQkWxPL-NsisUQmsHk6neFtIoD-8D-Ze4P2tupslidPHwlbNgVlVfzmo-OrYWm2TLkUdAwR0KVo01gLEfAcvqU_qUGBtIlU3yNnrI0nNPJ7l2GP_JqJUEhCSAG0BdRocjmzjHibI0nRmnpHTe0xjsFdxj6iJp5zz0jSwHplzDPrE0X-Zf5cSGFu73piA9dsHoa16D8ELnCJ9XERL364j2tGxGWrP6zzYzybk

ff61a00ac32a8610c9bcbe2bb00131da/update/sp_widget_0182c9d793ea0a10b653ffbd1dba10b1.xml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ For example: [INPUT YOUR NAME HERE]`;*/
238238
//copy direct link to this prompt,
239239
//see all posts by this author
240240
//see all posts for this form
241-
//see children in history
242241
243242
//configuration
244243
data.debug = true;
@@ -455,14 +454,14 @@ For example: [INPUT YOUR NAME HERE]`;*/
455454
<sys_created_by>earl.duque</sys_created_by>
456455
<sys_created_on>2024-06-07 18:15:31</sys_created_on>
457456
<sys_id>0182c9d793ea0a10b653ffbd1dba10b1</sys_id>
458-
<sys_mod_count>482</sys_mod_count>
457+
<sys_mod_count>489</sys_mod_count>
459458
<sys_name>library</sys_name>
460459
<sys_package display_value="ServiceNow GenAI Prompt Library" source="x_snc_ehd_servic_0">ff61a00ac32a8610c9bcbe2bb00131da</sys_package>
461460
<sys_policy/>
462461
<sys_scope display_value="ServiceNow GenAI Prompt Library">ff61a00ac32a8610c9bcbe2bb00131da</sys_scope>
463462
<sys_update_name>sp_widget_0182c9d793ea0a10b653ffbd1dba10b1</sys_update_name>
464463
<sys_updated_by>earl.duque</sys_updated_by>
465-
<sys_updated_on>2024-06-22 07:35:42</sys_updated_on>
464+
<sys_updated_on>2024-06-22 07:48:54</sys_updated_on>
466465
<template><![CDATA[<div class="page-intro">
467466
<div class="h1">
468467
ServiceNow Generative AI Prompt Library
@@ -511,9 +510,11 @@ For example: [INPUT YOUR NAME HERE]`;*/
511510
</div>
512511
</div>
513512
</div>
514-
<div class="history" ng-if="prompt.parent !==''" ng-click="c.openHistory(prompt)">
513+
<div class="history" ng-if="prompt.parents.length > 0 || prompt.children.length > 0" ng-click="c.openHistory(prompt)">
515514
<!--<span class="icon-tree"></span> Fork from {{prompt.parents[prompt.parents.length- 1].number}} by {{prompt.parents[prompt.parents.length- 1].author}}-->
516-
<span class="icon-tree"></span> Fork from {{prompt.parents[0].number}} by {{prompt.parents[0].author}} ({{prompt.parents.length + prompt.children.length + 1}} iterations)
515+
<span class="icon-tree"></span>
516+
<span ng-if="prompt.parents.length > 0"> {{prompt.parents.length + 1}} iteration{{prompt.parents.length == 1 ? '' : 's'}} from {{prompt.parents[0].number}} by {{prompt.parents[0].author}}.</span>
517+
<span ng-if="prompt.children.length > 0"> {{prompt.children.length}} fork{{prompt.children.length == 1 ? '' : 's'}} from this.</span>
517518
</div>
518519
<div class="engagement">
519520
<div class="icon-tree-right fork" ng-click="c.addPrompt(prompt, true)">
@@ -553,7 +554,7 @@ For example: [INPUT YOUR NAME HERE]`;*/
553554
<nav aria-label="Page navigation" ng-if="data.count > 0">
554555
<ul class="pagination">
555556
<li class="page-item">
556-
<a class="page-link" href="?id=prompt&page={{data.page-1}}&display={{data.display}}" aria-label="Previous" ng-if="data.page > 1">
557+
<a class="page-link" href="?id=library&page={{data.page-1}}&display={{data.display}}" aria-label="Previous" ng-if="data.page > 1">
557558
<span aria-hidden="true">&laquo;</span>
558559
<span class="sr-only">Previous</span>
559560
</a>
@@ -562,9 +563,9 @@ For example: [INPUT YOUR NAME HERE]`;*/
562563
<span class="sr-only">Previous</span>
563564
</a>
564565
</li>
565-
<li class="page-item" ng-repeat="page in data.pages track by $index" ng-class="{active: page == data.page}"><a class="page-link" href="?id=prompt&page={{page}}&display={{data.display}}" ng-if="page != '...'">{{page}}</a><span ng-if="page == '...'">...</span></li>
566+
<li class="page-item" ng-repeat="page in data.pages track by $index" ng-class="{active: page == data.page}"><a class="page-link" href="?id=library&page={{page}}&display={{data.display}}" ng-if="page != '...'">{{page}}</a><span ng-if="page == '...'">...</span></li>
566567
<li class="page-item">
567-
<a class="page-link" href="?id=prompt&page={{data.page+1}}&display={{data.display}}" aria-label="Next" ng-if="data.page < data.pages[data.pages.length - 1]">
568+
<a class="page-link" href="?id=library&page={{data.page+1}}&display={{data.display}}" aria-label="Next" ng-if="data.page < data.pages[data.pages.length - 1]">
568569
<span aria-hidden="true">&raquo;</span>
569570
<span class="sr-only">Next</span>
570571
</a>
@@ -647,7 +648,7 @@ For example: [INPUT YOUR NAME HERE]`;*/
647648
<script type="text/ng-template" id="historyModal">
648649
<div class="panel panel-default">
649650
<div class="panel-heading">
650-
<h4 class="panel-title">History</h4>
651+
<h4 class="panel-title">History (newest versions at top)</h4>
651652
</div>
652653
<div class="panel-body wrapper-xl">
653654
<div ng-repeat="child in prompt.children">

ff61a00ac32a8610c9bcbe2bb00131da/update/sp_widget_902d233bc336c610c9bcbe2bb00131a6.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,14 @@ For example: [INPUT YOUR NAME HERE]`;*/
353353
<sys_created_by>earl.duque</sys_created_by>
354354
<sys_created_on>2024-06-22 06:13:36</sys_created_on>
355355
<sys_id>902d233bc336c610c9bcbe2bb00131a6</sys_id>
356-
<sys_mod_count>65</sys_mod_count>
356+
<sys_mod_count>67</sys_mod_count>
357357
<sys_name>prompt</sys_name>
358358
<sys_package display_value="ServiceNow GenAI Prompt Library" source="x_snc_ehd_servic_0">ff61a00ac32a8610c9bcbe2bb00131da</sys_package>
359359
<sys_policy/>
360360
<sys_scope display_value="ServiceNow GenAI Prompt Library">ff61a00ac32a8610c9bcbe2bb00131da</sys_scope>
361361
<sys_update_name>sp_widget_902d233bc336c610c9bcbe2bb00131a6</sys_update_name>
362362
<sys_updated_by>earl.duque</sys_updated_by>
363-
<sys_updated_on>2024-06-22 07:35:27</sys_updated_on>
363+
<sys_updated_on>2024-06-22 07:49:29</sys_updated_on>
364364
<template><![CDATA[<div>
365365
<div class="page-intro">
366366
<div>
@@ -421,9 +421,11 @@ For example: [INPUT YOUR NAME HERE]`;*/
421421
</div>
422422
</div>
423423
</div>
424-
<div class="history" ng-if="prompt.parent !==''" ng-click="c.openHistory(prompt)">
424+
<div class="history" ng-if="prompt.parents.length > 0 || prompt.children.length > 0" ng-click="c.openHistory(prompt)">
425425
<!--<span class="icon-tree"></span> Fork from {{prompt.parents[prompt.parents.length- 1].number}} by {{prompt.parents[prompt.parents.length- 1].author}}-->
426-
<span class="icon-tree"></span> Fork from {{prompt.parents[0].number}} by {{prompt.parents[0].author}} ({{prompt.parents.length + prompt.children.length + 1}} iterations)
426+
<span class="icon-tree"></span>
427+
<span ng-if="prompt.parents.length > 0"> {{prompt.parents.length + 1}} iteration{{prompt.parents.length == 1 ? '' : 's'}} from {{prompt.parents[0].number}} by {{prompt.parents[0].author}}.</span>
428+
<span ng-if="prompt.children.length > 0"> {{prompt.children.length}} fork{{prompt.children.length == 1 ? '' : 's'}} from this.</span>
427429
</div>
428430
<div class="engagement">
429431
<div class="icon-tree-right fork" ng-click="c.addPrompt(prompt, true)">
@@ -502,30 +504,30 @@ For example: [INPUT YOUR NAME HERE]`;*/
502504
<script type="text/ng-template" id="historyModal">
503505
<div class="panel panel-default">
504506
<div class="panel-heading">
505-
<h4 class="panel-title">History</h4>
507+
<h4 class="panel-title">History (newest versions at top)</h4>
506508
</div>
507509
<div class="panel-body wrapper-xl">
508510
<div ng-repeat="child in prompt.children">
509511
<a href="?id=prompt&sys_id={{child.sys_id}}" target="_self"><div><b>Fork {{$index + 1}}. {{child.author}}</b> {{child.number}}</div></a>
510512
<div>
511513
<textarea class="form-control" rows="5" disabled>{{child.prompt}}</textarea><br>
512-
</div>
513-
</div>
514+
</div>
515+
</div>
514516
<div><b>This prompt</b></div>
515517
<div>
516518
<textarea class="form-control" rows="5" disabled>{{prompt.prompt}}</textarea><br>
517-
</div>
519+
</div>
518520
<div ng-repeat="parent in prompt.parents">
519521
<a href="?id=prompt&sys_id={{parent.sys_id}}" target="_self"><div><b>{{$index + 1}}. {{parent.author}}</b> {{parent.number}}</div></a>
520522
<div>
521523
<textarea class="form-control" rows="5" disabled>{{parent.prompt}}</textarea><br>
522-
</div>
523-
</div>
524+
</div>
525+
</div>
524526
</div>
525527
<div class="panel-footer text-right">
526528
<button class="btn btn-primary" ng-click="c.closeModal()">${Close History}</button>
527-
</div>
528-
</div>
529+
</div>
530+
</div>
529531
</script>]]></template>
530532
</sp_widget>
531533
</record_update>

0 commit comments

Comments
 (0)