|
9 | 9 | top.window.location = "?id=library"; |
10 | 10 | } |
11 | 11 |
|
| 12 | + c.goToPrompt = function(sys_id){ |
| 13 | + top.window.location = "?id=prompt&sys_id=" + sys_id; |
| 14 | + } |
| 15 | +
|
| 16 | + c.goToAuthor = function(author, event){ |
| 17 | + if (event) event.stopPropagation(); |
| 18 | + top.window.location = "?id=library&display=" + c.data.display + "&query=opened_by.name=" + author; |
| 19 | + } |
| 20 | +
|
| 21 | + c.goHome = function(){ |
| 22 | + top.window.location = "?id=library&display=" + c.data.display; |
| 23 | + } |
| 24 | +
|
| 25 | + c.goToProfile = function(){ |
| 26 | + top.window.location = "?id=user_profile&sys_id=" + c.data.userId; |
| 27 | + } |
| 28 | +
|
12 | 29 | c.copyToClipboard = function(prompt){ |
13 | 30 | try { |
14 | 31 | navigator.clipboard.writeText(prompt); |
@@ -90,6 +107,10 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
90 | 107 | //margin-right: 1rem; |
91 | 108 | } |
92 | 109 |
|
| 110 | +.my-profile{ |
| 111 | + float: right; |
| 112 | +} |
| 113 | + |
93 | 114 | .date{ |
94 | 115 | text-align: right; |
95 | 116 | } |
@@ -152,14 +173,16 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
152 | 173 | .engagement{ |
153 | 174 | //font-size: 1rem; |
154 | 175 | } |
| 176 | + |
155 | 177 | .engagement-button, .home-button{ |
156 | 178 | margin-right: 1rem; |
157 | 179 | border-radius: 3px; |
158 | 180 | padding: 5px; |
159 | 181 | background-color: #F5F5F5; |
| 182 | + white-space: nowrap; |
160 | 183 | } |
161 | 184 |
|
162 | | -.engagement-button:hover, .history:hover{ |
| 185 | +.engagement-button:hover, .history:hover, .prompt-info:hover{ |
163 | 186 | background-color: #DEDCDA; |
164 | 187 | } |
165 | 188 |
|
@@ -223,6 +246,7 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
223 | 246 | //configuration |
224 | 247 | data.debug = false; |
225 | 248 | data.userId = gs.getUserID(); |
| 249 | + data.thisUrl = gs.getProperty('glide.servlet.uri'); |
226 | 250 | data.promptFields = [ |
227 | 251 | 'prompt', |
228 | 252 | 'category', |
@@ -353,20 +377,23 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
353 | 377 | <sys_created_by>earl.duque</sys_created_by> |
354 | 378 | <sys_created_on>2024-06-22 06:13:36</sys_created_on> |
355 | 379 | <sys_id>902d233bc336c610c9bcbe2bb00131a6</sys_id> |
356 | | - <sys_mod_count>67</sys_mod_count> |
| 380 | + <sys_mod_count>80</sys_mod_count> |
357 | 381 | <sys_name>prompt</sys_name> |
358 | 382 | <sys_package display_value="ServiceNow GenAI Prompt Library" source="x_snc_ehd_servic_0">ff61a00ac32a8610c9bcbe2bb00131da</sys_package> |
359 | 383 | <sys_policy/> |
360 | 384 | <sys_scope display_value="ServiceNow GenAI Prompt Library">ff61a00ac32a8610c9bcbe2bb00131da</sys_scope> |
361 | 385 | <sys_update_name>sp_widget_902d233bc336c610c9bcbe2bb00131a6</sys_update_name> |
362 | 386 | <sys_updated_by>earl.duque</sys_updated_by> |
363 | | - <sys_updated_on>2024-06-22 07:49:29</sys_updated_on> |
| 387 | + <sys_updated_on>2024-06-26 06:12:01</sys_updated_on> |
364 | 388 | <template><![CDATA[<div> |
365 | 389 | <div class="page-intro"> |
366 | 390 | <div> |
367 | 391 | <span class="icon-home home-button" ng-click="c.goHome()"> Go to Library home</span> |
368 | 392 | </div> |
369 | 393 | <div class="h1"> |
| 394 | + <div class="my-profile" ng-click="c.goToProfile()"> |
| 395 | + <span class="author-block-avatar"><sn-avatar class="avatar-medium" primary="data.userId"></sn-avatar></span> |
| 396 | + </div> |
370 | 397 | {{data.number}} by {{data.author}} |
371 | 398 | </div> |
372 | 399 | <div> |
@@ -395,9 +422,9 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
395 | 422 | {{prompt.prompt}} |
396 | 423 | </div> |
397 | 424 | <div class="vote col-xs-3"> |
398 | | - <div class="prompt-info"> |
| 425 | + <div class="prompt-info" ng-click="c.goToAuthor(prompt['opened_by.name'], $event)"> |
399 | 426 | <div class="prompt-info-header"> |
400 | | - Author |
| 427 | + Author (Click to filter) |
401 | 428 | </div> |
402 | 429 | <div class="prompt-info-detail"> |
403 | 430 | {{prompt["opened_by.name"]}} |
@@ -433,7 +460,8 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
433 | 460 | </div> |
434 | 461 | <span class="icon-arrow-up engagement-button" ng-class="{'voted': prompt.voted == true}" ng-click="c.vote(prompt.sys_id)"></span> |
435 | 462 | <span class="engagement-button"><span class="comment-count">{{data.comments.length}} comment{{prompt.comments.length == 1 ? '' : 's'}}</span></span> |
436 | | - <span class="engagement-button"ng-click="c.copyToClipboard(prompt.prompt)">copy <span class="icon-document"></span></span> |
| 463 | + <span class="engagement-button"ng-click="c.copyToClipboard(prompt.prompt)">Copy Prompt <span class="icon-document"></span></span> |
| 464 | + <span class="engagement-button"ng-click="c.copyToClipboard(data.thisUrl + 'ai?id=prompt&sys_id=' + prompt.sys_id, $event)">Copy Link <span class="icon-document"></span></span> |
437 | 465 | <!--span class="icon-share engagement-button"></span--> |
438 | 466 | </div> |
439 | 467 | </div> |
@@ -493,6 +521,16 @@ For example: [INPUT YOUR NAME HERE]`;*/ |
493 | 521 | <label for="promptText">Your prompt:</label> |
494 | 522 | <textarea class="form-control" id="promptText" rows="3" ng-model="data.newPromptText"></textarea> |
495 | 523 | </div> |
| 524 | + <div> |
| 525 | + Need some guidance? The RISEN framework helps structure tasks for generative AI into actionable steps: |
| 526 | + <ul> |
| 527 | + <li>R — Role: Define the AI's role. (e.g., "Act as an agile coach.") |
| 528 | + <li>I — Instructions: Provide clear instructions. (e.g., "Write a guide on crafting a good agile development story.") |
| 529 | + <li>S — Steps: Outline specific steps. (e.g., "Start with a user persona, describe the user's goal, list the tasks to achieve the goal, and define the acceptance criteria.") |
| 530 | + <li>E — End goal: State the goal and audience. (e.g., "Help team members understand how to write clear and effective agile stories.") |
| 531 | + <li>N — Narrowing: Add constraints. (e.g., "Max 800 words, avoid technical jargon, use practical examples.") |
| 532 | + </ul> |
| 533 | + </div> |
496 | 534 | </div> |
497 | 535 | <div class="panel-footer text-right"> |
498 | 536 | <button class="btn btn-primary" ng-click="c.submitPrompt()" ng-class="{disabled: !data.newPromptText || !data.newPromptCategory || (data.oldPromptText == data.newPromptText)}">${Submit Prompt}</button> |
|
0 commit comments