Skip to content

Commit 2c461ff

Browse files
authored
Merge pull request #52 from advanced-rest-client/fix-icon
[W-19307418] Enhance ApiSummary component by replacing the agent pill with a metho…
2 parents bc722f9 + a8f9a9c commit 2c461ff

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@api-components/api-summary",
33
"description": "A summary view for an API base on AMF data model",
4-
"version": "4.6.11",
4+
"version": "4.6.12",
55
"license": "Apache-2.0",
66
"main": "index.js",
77
"module": "index.js",

src/ApiSummary.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import labelStyles from "@api-components/http-method-label/http-method-label-com
99
import sanitizer from "dompurify";
1010
import "@advanced-rest-client/arc-marked/arc-marked.js";
1111
import "@api-components/api-method-documentation/api-url.js";
12-
import '@advanced-rest-client/icons/arc-icon.js';
12+
import { codegenie } from '@advanced-rest-client/icons/ArcIcons.js';
13+
1314
import styles from "./Styles.js";
1415

1516
/** @typedef {import('lit-element').TemplateResult} TemplateResult */
@@ -633,17 +634,13 @@ export class ApiSummary extends AmfHelperMixin(LitElement) {
633634
data-id="${item.id}"
634635
data-shape-type="method"
635636
title="Open method documentation"
636-
>${item.method}</a
637-
>
638-
639-
${item.hasAgent
640-
? html`
641-
<span class="agent-pill" title="Enabled for Agent">
642-
Enabled for Agent
643-
<arc-icon icon="infoOutline" class="info-icon"></arc-icon>
644-
</span>
645-
`
646-
: ''}
637+
>${item.method}
638+
${
639+
item.hasAgent
640+
? html`<span class="method-icon">${codegenie}</span>`
641+
: ""
642+
}
643+
</a>
647644
`;
648645
}
649646

src/Styles.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ export default css`
5656
white-space: nowrap;
5757
}
5858
59+
.method-icon {
60+
display: inline-flex;
61+
width: 13px;
62+
height: 13px;
63+
padding-left: 7px;
64+
fill: var(--http-method-label-post-color, #fff);
65+
}
66+
5967
label.section {
6068
color: var(--arc-font-subhead-color);
6169
font-weight: var(--arc-font-subhead-font-weight);

test/api-summary.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ describe('ApiSummary', () => {
371371
});
372372

373373
it('renders the agent pill', async () => {
374-
const node = element.shadowRoot.querySelector('.agent-pill');
374+
const node = element.shadowRoot.querySelector('.method-icon');
375375
assert.ok(node);
376376
});
377377
});

0 commit comments

Comments
 (0)