Skip to content

Small quality of life fixes #941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/templates/security-scheme-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export default function securitySchemeTemplate() {
<div class="blue-text"> ${providedApiKeys.length} API key applied </div>
<div style="flex:1"></div>
<button class="m-btn thin-border" part="btn btn-outline" @click=${() => { onClearAllApiKeys.call(this); }}>CLEAR ALL API KEYS</button>`
: html`<div class="red-text">No API key applied</div>`
: html`<div class="red-text">No API key applied - <a href="#auth">Apply one here</a></div>`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#auth wont be available always.it depends on which section the user is showing and also special care must be taken for focused view

}
</div>
${this.resolvedSpec.securitySchemes && this.resolvedSpec.securitySchemes.length > 0
Expand All @@ -411,7 +411,8 @@ export default function securitySchemeTemplate() {
<tr id="security-scheme-${v.securitySchemeId}" class="${v.type.toLowerCase()}">
<td style="max-width:500px; overflow-wrap: break-word;">
<div style="line-height:28px; margin-bottom:5px;">
<span style="font-weight:bold; font-size:var(--font-size-regular)">${v.typeDisplay}</span>
<span style="font-weight:bold; font-size:var(--font-size-regular)">${this.resolvedSpec.securitySchemes.filter((secScheme) => secScheme.typeDisplay === v.typeDisplay).length > 1 ? `-
${v.securitySchemeId}` : null}</span>
${v.finalKeyValue
? html`
<span class='blue-text'> ${v.finalKeyValue ? 'Key Applied' : ''} </span>
Expand All @@ -433,13 +434,13 @@ export default function securitySchemeTemplate() {
<div style="margin-bottom:5px">
${v.type.toLowerCase() === 'apikey'
? html`Send <code>${v.name}</code> in <code>${v.in}</code>`
: html`Send <code>Authorization</code> in <code>header</code> containing the word <code>Bearer</code> followed by a space and a Token String.`
: html`Send <code>Authorization</code> in <code>header</code> containing the word <code>Bearer</code> followed by a space and the ${e.bearerFormat ?? "Token String"}.`
}
</div>
<div style="max-height:28px;">
${v.in !== 'cookie'
? html`
<input type = "text" value = "${v.value}" class="${v.type} ${v.securitySchemeId} api-key-input" placeholder = "api-token" spellcheck = "false">
<input type = "text" value = "${v.value}" class="${v.type} ${v.securitySchemeId} api-key-input" placeholder = "${e.bearerFormat ?? "api-token"}" spellcheck = "false">
<button class="m-btn thin-border" style = "margin-left:5px;"
part = "btn btn-outline"
@click="${(e) => { onApiKeyChange.call(this, v.securitySchemeId, e); }}">
Expand Down