@app-vitals/agent-lib 1.46.0 → 1.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/toolbar.ts +3 -3
- package/web/toolbar.unit.test.ts +12 -1
package/package.json
CHANGED
package/web/toolbar.ts
CHANGED
|
@@ -28,8 +28,8 @@ export interface ShipwrightToolbarOptions {
|
|
|
28
28
|
*/
|
|
29
29
|
showAccount?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Render the
|
|
32
|
-
*
|
|
31
|
+
* Render the "Settings" nav entry (links to /admin/settings; shown to
|
|
32
|
+
* admins and account members). Defaults to false.
|
|
33
33
|
*/
|
|
34
34
|
showSettings?: boolean;
|
|
35
35
|
}
|
|
@@ -235,7 +235,7 @@ export function renderShipwrightToolbar(
|
|
|
235
235
|
<a href="${adminBase}/admin/prs" class="vos-nav-link${active("/admin/prs")}">PRs</a>
|
|
236
236
|
<a href="${adminBase}/admin/chat" class="vos-nav-link${active("/admin/chat")}">Chat</a>
|
|
237
237
|
<a href="${adminBase}/admin/queue-activity" class="vos-nav-link${isQueueActivity ? " active" : ""}">Queue & Activity</a>
|
|
238
|
-
${opts.showAccount ? `<a href="${adminBase}/admin/account" class="vos-nav-link${active("/admin/account")}">Account</a>\n ` : ""}${opts.showSettings ? `<a href="${adminBase}/admin/settings
|
|
238
|
+
${opts.showAccount ? `<a href="${adminBase}/admin/account" class="vos-nav-link${active("/admin/account")}">Account</a>\n ` : ""}${opts.showSettings ? `<a href="${adminBase}/admin/settings" class="vos-nav-link${active("/admin/settings")}">Settings</a>\n ` : ""}<a href="${metricsUrl}" class="vos-nav-link${active(metricsUrl)}">Metrics</a>
|
|
239
239
|
</div>
|
|
240
240
|
<div class="vos-user">
|
|
241
241
|
<span class="vos-username">${escapeHtml(userName)}</span>
|
package/web/toolbar.unit.test.ts
CHANGED
|
@@ -254,9 +254,20 @@ describe("renderShipwrightToolbar Settings entry (GHE-1.4)", () => {
|
|
|
254
254
|
test("rendered and active when showSettings is true", () => {
|
|
255
255
|
const html = renderShipwrightToolbar({ ...base, showSettings: true });
|
|
256
256
|
expect(html).toContain(
|
|
257
|
-
'href="/admin/settings
|
|
257
|
+
'href="/admin/settings" class="vos-nav-link active">Settings</a>',
|
|
258
258
|
);
|
|
259
259
|
});
|
|
260
|
+
test("active on any /admin/settings/* sub-page and links to /admin/settings", () => {
|
|
261
|
+
const html = renderShipwrightToolbar({
|
|
262
|
+
...base,
|
|
263
|
+
activePath: "/admin/settings/templates",
|
|
264
|
+
showSettings: true,
|
|
265
|
+
});
|
|
266
|
+
expect(html).toContain(
|
|
267
|
+
'href="/admin/settings" class="vos-nav-link active"',
|
|
268
|
+
);
|
|
269
|
+
expect(html).not.toContain('href="/admin/settings/github-enterprise"');
|
|
270
|
+
});
|
|
260
271
|
test("readOnly never renders it", () => {
|
|
261
272
|
expect(
|
|
262
273
|
renderShipwrightToolbar({ ...base, readOnly: true, showSettings: true }),
|