@app-vitals/agent-lib 1.47.0 → 1.49.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-lib",
3
- "version": "1.47.0",
3
+ "version": "1.49.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
package/web/toolbar.ts CHANGED
@@ -28,8 +28,8 @@ export interface ShipwrightToolbarOptions {
28
28
  */
29
29
  showAccount?: boolean;
30
30
  /**
31
- * Render the admin-only "Settings" nav entry (enterprise GitHub apps,
32
- * GHE-1.4). Defaults to false.
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 &amp; 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/github-enterprise" class="vos-nav-link${active("/admin/settings")}">Settings</a>\n ` : ""}<a href="${metricsUrl}" class="vos-nav-link${active(metricsUrl)}">Metrics</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" 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>
@@ -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/github-enterprise" class="vos-nav-link active">Settings</a>',
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 }),