|
| 1 | +<template> |
| 2 | + <section data-testid="home-custom-actions"> |
| 3 | + <div> |
| 4 | + <h2>Datadog Custom Actions</h2> |
| 5 | + <p>Use these buttons to send manual RUM custom actions from the home page.</p> |
| 6 | + </div> |
| 7 | + <div> |
| 8 | + <lightning-button |
| 9 | + label="Custom Action 1" |
| 10 | + variant="brand" |
| 11 | + data-action-name="custom action 1" |
| 12 | + data-testid="custom-action-1" |
| 13 | + onclick="{handleActionClick}" |
| 14 | + ></lightning-button> |
| 15 | + <lightning-button |
| 16 | + label="Custom Action 2" |
| 17 | + variant="neutral" |
| 18 | + data-action-name="custom action 2" |
| 19 | + onclick="{handleActionClick}" |
| 20 | + ></lightning-button> |
| 21 | + </div> |
| 22 | + <template lwc:if="{lastActionName}"> |
| 23 | + <p>Last sent: {lastActionName}</p> |
| 24 | + </template> |
| 25 | + </section> |
| 26 | + <section> |
| 27 | + <div> |
| 28 | + <h2>Datadog Custom Errors</h2> |
| 29 | + <p>Use these buttons to send manual RUM custom errors from the home page.</p> |
| 30 | + </div> |
| 31 | + <div> |
| 32 | + <lightning-button |
| 33 | + label="Custom Error 1" |
| 34 | + variant="destructive" |
| 35 | + data-error-name="custom error 1" |
| 36 | + data-testid="custom-error-1" |
| 37 | + onclick="{handleErrorClick}" |
| 38 | + ></lightning-button> |
| 39 | + <lightning-button |
| 40 | + label="Custom Error 2" |
| 41 | + variant="destructive-text" |
| 42 | + data-error-name="custom error 2" |
| 43 | + onclick="{handleErrorClick}" |
| 44 | + ></lightning-button> |
| 45 | + </div> |
| 46 | + <template lwc:if="{lastErrorName}"> |
| 47 | + <p>Last sent: {lastErrorName}</p> |
| 48 | + </template> |
| 49 | + </section> |
| 50 | + <section> |
| 51 | + <div> |
| 52 | + <h2>Datadog Runtime Errors</h2> |
| 53 | + <p>Use this button to trigger an unhandled error that should be captured via window.onerror.</p> |
| 54 | + </div> |
| 55 | + <div> |
| 56 | + <lightning-button |
| 57 | + label="Runtime Error" |
| 58 | + variant="destructive" |
| 59 | + onclick="{handleRuntimeErrorClick}" |
| 60 | + ></lightning-button> |
| 61 | + </div> |
| 62 | + </section> |
| 63 | + <section> |
| 64 | + <div> |
| 65 | + <h2>Datadog Long Tasks</h2> |
| 66 | + <p>Blocks the main thread to generate a long_task RUM event.</p> |
| 67 | + </div> |
| 68 | + <div> |
| 69 | + <lightning-button |
| 70 | + label="Long Task" |
| 71 | + variant="brand" |
| 72 | + data-testid="long-task" |
| 73 | + onclick="{handleLongTaskClick}" |
| 74 | + ></lightning-button> |
| 75 | + </div> |
| 76 | + </section> |
| 77 | + <section> |
| 78 | + <div> |
| 79 | + <h2>Datadog Vitals</h2> |
| 80 | + <p>Add Duration Vital and Start/Stop Vital use the DD_RUM vitals API directly.</p> |
| 81 | + </div> |
| 82 | + <div> |
| 83 | + <lightning-button |
| 84 | + label="Add Duration Vital" |
| 85 | + variant="brand" |
| 86 | + onclick="{handleAddDurationVitalClick}" |
| 87 | + ></lightning-button> |
| 88 | + <lightning-button |
| 89 | + label="Start/Stop Vital" |
| 90 | + variant="brand" |
| 91 | + onclick="{handleStartStopVitalClick}" |
| 92 | + ></lightning-button> |
| 93 | + </div> |
| 94 | + </section> |
| 95 | + <section> |
| 96 | + <div> |
| 97 | + <h2>Datadog Resources</h2> |
| 98 | + <p>Use these buttons to generate resource timing entries for fetch and XHR.</p> |
| 99 | + </div> |
| 100 | + <div> |
| 101 | + <lightning-button |
| 102 | + label="Fetch Resource" |
| 103 | + variant="brand" |
| 104 | + onclick="{handleFetchResourceClick}" |
| 105 | + ></lightning-button> |
| 106 | + <lightning-button |
| 107 | + label="XHR Resource" |
| 108 | + variant="brand" |
| 109 | + onclick="{handleXhrResourceClick}" |
| 110 | + ></lightning-button> |
| 111 | + </div> |
| 112 | + <template lwc:if="{lastResourceName}"> |
| 113 | + <p>Last requested: {lastResourceName}</p> |
| 114 | + </template> |
| 115 | + </section> |
| 116 | + <section> |
| 117 | + <div> |
| 118 | + <h2>Datadog Selector Probe</h2> |
| 119 | + <p>Use this button to compare the LWC internal click target with the automatic RUM click selector.</p> |
| 120 | + </div> |
| 121 | + <div> |
| 122 | + <button |
| 123 | + data-dd-action-name="inner selector probe button" |
| 124 | + data-testid="inner-selector-probe-button" |
| 125 | + onclick="{handleSelectorProbeClick}" |
| 126 | + style="margin: 0.75rem 0; padding: 0.25rem 0.75rem" |
| 127 | + > |
| 128 | + Inner Selector Probe |
| 129 | + </button> |
| 130 | + </div> |
| 131 | + <template lwc:if="{lastSelectorProbe}"> |
| 132 | + <p>Last probe: {lastSelectorProbe}</p> |
| 133 | + </template> |
| 134 | + </section> |
| 135 | +</template> |
0 commit comments