Skip to content

Commit 2ffe389

Browse files
committed
fix: channel url overlapping with server url
1 parent 9ddb6c9 commit 2ffe389

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

src/ApiUrl.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ export class ApiUrl extends AmfHelperMixin(LitElement) {
172172
</style>
173173
<section class="url-area">
174174
${this._getMethodTemplate()}
175-
${this._getPathTemplate()}
176-
<div class="url-value">${url}</div>
175+
<div class="url-value">
176+
${this._getPathTemplate()}
177+
${this.getUrlTemplate()}
178+
</div>
177179
</section>
178180
<clipboard-copy id="urlCopy" .content="${url}"></clipboard-copy>
179181
`;
@@ -189,13 +191,19 @@ export class ApiUrl extends AmfHelperMixin(LitElement) {
189191

190192
_getPathTemplate() {
191193
if (this.isNotHttp) {
192-
return html`
193-
${this.path}
194-
`;
194+
return html`<div class="url-channel-value"><span class="channel-url">Channel</span>${this.path}</div>`;
195195
}
196196
return undefined;
197197
}
198198

199+
getUrlTemplate() {
200+
const { url, isNotHttp } = this;
201+
if (isNotHttp) {
202+
return html`<div class="url-server-value"><span class="server-url">Server</span>${url}</div>`
203+
}
204+
return html`${url}`
205+
}
206+
199207
_updateMethod() {
200208
this._method = this._computeMethod(this._operation);
201209
this._dispatchChangeEvent();

src/Styles.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ export default css`
104104
word-break: break-all;
105105
}
106106
107+
.channel-url, .server-url {
108+
display: block;
109+
font-size: var(--api-method-documentation-url-font-size, 0.70rem);
110+
font-weight: bolder;
111+
}
112+
113+
.url-server-value {
114+
margin-top: 8px;
115+
}
116+
107117
.method-value {
108118
text-transform: uppercase;
109119
white-space: nowrap;

0 commit comments

Comments
 (0)