From 0793fca9182cf7b95f819c1a6c5fce27f7dbd38e Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Wed, 10 Sep 2025 20:34:39 -0300 Subject: [PATCH 1/3] Enhance ApiSummary component by replacing the agent pill with a method icon for endpoints with agents. Update Styles.js to include new styles for the method icon, improving visual representation. --- src/ApiSummary.js | 21 +++++++++------------ src/Styles.js | 8 ++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/ApiSummary.js b/src/ApiSummary.js index 564fc27..d1e8b6e 100644 --- a/src/ApiSummary.js +++ b/src/ApiSummary.js @@ -9,7 +9,8 @@ import labelStyles from "@api-components/http-method-label/http-method-label-com import sanitizer from "dompurify"; import "@advanced-rest-client/arc-marked/arc-marked.js"; import "@api-components/api-method-documentation/api-url.js"; -import '@advanced-rest-client/icons/arc-icon.js'; +import { codegenie } from '@advanced-rest-client/icons/ArcIcons.js'; + import styles from "./Styles.js"; /** @typedef {import('lit-element').TemplateResult} TemplateResult */ @@ -633,17 +634,13 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { data-id="${item.id}" data-shape-type="method" title="Open method documentation" - >${item.method} - - ${item.hasAgent - ? html` - - Enabled for Agent - - - ` - : ''} + >${item.method} + ${ + item.hasAgent + ? html`${codegenie}` + : "" + } + `; } diff --git a/src/Styles.js b/src/Styles.js index d44ea1d..b552551 100644 --- a/src/Styles.js +++ b/src/Styles.js @@ -56,6 +56,14 @@ export default css` white-space: nowrap; } + .method-icon { + display: inline-flex; + width: 13px; + height: 13px; + padding-left: 7px; + fill: var(--http-method-label-post-color, #fff); + } + label.section { color: var(--arc-font-subhead-color); font-weight: var(--arc-font-subhead-font-weight); From 95e4a5135aa186a19b3ba148f2805b799290708a Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Wed, 10 Sep 2025 20:35:39 -0300 Subject: [PATCH 2/3] 4.6.12 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 404c071..a3cb744 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@api-components/api-summary", - "version": "4.6.11", + "version": "4.6.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@api-components/api-summary", - "version": "4.6.11", + "version": "4.6.12", "license": "Apache-2.0", "dependencies": { "@advanced-rest-client/arc-marked": "^1.1.2", diff --git a/package.json b/package.json index 1f6b557..0b980dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@api-components/api-summary", "description": "A summary view for an API base on AMF data model", - "version": "4.6.11", + "version": "4.6.12", "license": "Apache-2.0", "main": "index.js", "module": "index.js", From a8f9a9c481a865e1e94598a72702d2c8b381a2bc Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Wed, 10 Sep 2025 20:55:38 -0300 Subject: [PATCH 3/3] Update ApiSummary test to reflect the change from agent pill to method icon in rendering logic. --- test/api-summary.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/api-summary.test.js b/test/api-summary.test.js index 0c4136a..14867db 100644 --- a/test/api-summary.test.js +++ b/test/api-summary.test.js @@ -371,7 +371,7 @@ describe('ApiSummary', () => { }); it('renders the agent pill', async () => { - const node = element.shadowRoot.querySelector('.agent-pill'); + const node = element.shadowRoot.querySelector('.method-icon'); assert.ok(node); }); });