mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-22 16:48:30 +02:00
Fix no-base-to-string
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
/* oxlint-disable no-base-to-string */
|
||||||
import { DOMParser } from '@xmldom/xmldom';
|
import { DOMParser } from '@xmldom/xmldom';
|
||||||
import type { PluginDefinition } from '@yaakapp/api';
|
import type { PluginDefinition } from '@yaakapp/api';
|
||||||
import xpath from 'xpath';
|
import xpath from 'xpath';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* oxlint-disable no-base-to-string */
|
||||||
import type {
|
import type {
|
||||||
Context,
|
Context,
|
||||||
Environment,
|
Environment,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* oxlint-disable no-base-to-string */
|
||||||
import type {
|
import type {
|
||||||
Context,
|
Context,
|
||||||
Environment,
|
Environment,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* oxlint-disable no-base-to-string */
|
||||||
import { DOMParser } from '@xmldom/xmldom';
|
import { DOMParser } from '@xmldom/xmldom';
|
||||||
import type { CallTemplateFunctionArgs, Context, PluginDefinition } from '@yaakapp/api';
|
import type { CallTemplateFunctionArgs, Context, PluginDefinition } from '@yaakapp/api';
|
||||||
import xpath from 'xpath';
|
import xpath from 'xpath';
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function GrpcProtoSelectionDialogWithRequest({ request }: Props & { request: Grp
|
|||||||
Found services{' '}
|
Found services{' '}
|
||||||
{services?.slice(0, 5).map((s, i) => {
|
{services?.slice(0, 5).map((s, i) => {
|
||||||
return (
|
return (
|
||||||
<span key={s.name + s.methods.join(',')}>
|
<span key={s.name + s.methods.map((m) => m.name).join(',')}>
|
||||||
<InlineCode>{s.name}</InlineCode>
|
<InlineCode>{s.name}</InlineCode>
|
||||||
{i === services.length - 1 ? '' : i === services.length - 2 ? ' and ' : ', '}
|
{i === services.length - 1 ? '' : i === services.length - 2 ? ' and ' : ', '}
|
||||||
</span>
|
</span>
|
||||||
@@ -119,7 +119,7 @@ function GrpcProtoSelectionDialogWithRequest({ request }: Props & { request: Grp
|
|||||||
Server reflection found services
|
Server reflection found services
|
||||||
{services?.map((s, i) => {
|
{services?.map((s, i) => {
|
||||||
return (
|
return (
|
||||||
<span key={s.name + s.methods.join(',')}>
|
<span key={s.name + s.methods.map((m) => m.name).join(',')}>
|
||||||
<InlineCode>{s.name}</InlineCode>
|
<InlineCode>{s.name}</InlineCode>
|
||||||
{i === services.length - 1 ? '' : i === services.length - 2 ? ' and ' : ', '}
|
{i === services.length - 1 ? '' : i === services.length - 2 ? ' and ' : ', '}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const markdownComponents: Partial<Components> = {
|
|||||||
language={match[1]}
|
language={match[1]}
|
||||||
style={prismTheme}
|
style={prismTheme}
|
||||||
>
|
>
|
||||||
{String(children).replace(/\n$/, '')}
|
{String(children as string).replace(/\n$/, '')}
|
||||||
</SyntaxHighlighter>
|
</SyntaxHighlighter>
|
||||||
) : (
|
) : (
|
||||||
<code {...extraProps} ref={ref} className={className}>
|
<code {...extraProps} ref={ref} className={className}>
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ function BaseInput({
|
|||||||
</HStack>
|
</HStack>
|
||||||
{type === 'password' && !disableObscureToggle && (
|
{type === 'password' && !disableObscureToggle && (
|
||||||
<IconButton
|
<IconButton
|
||||||
title={obscured ? `Show ${label}` : `Obscure ${label}`}
|
title={obscured ? `Show ${typeof label === 'string' ? label : 'field'}` : `Obscure ${typeof label === 'string' ? label : 'field'}`}
|
||||||
size="xs"
|
size="xs"
|
||||||
className={classNames('mr-0.5 !h-auto my-0.5', disabled && 'opacity-disabled')}
|
className={classNames('mr-0.5 !h-auto my-0.5', disabled && 'opacity-disabled')}
|
||||||
color={tint}
|
color={tint}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export const PlainInput = forwardRef<{ focus: () => void }, PlainInputProps>(fun
|
|||||||
</HStack>
|
</HStack>
|
||||||
{type === 'password' && !hideObscureToggle && (
|
{type === 'password' && !hideObscureToggle && (
|
||||||
<IconButton
|
<IconButton
|
||||||
title={obscured ? `Show ${label}` : `Obscure ${label}`}
|
title={obscured ? `Show ${typeof label === 'string' ? label : 'field'}` : `Obscure ${typeof label === 'string' ? label : 'field'}`}
|
||||||
size="xs"
|
size="xs"
|
||||||
className="mr-0.5 group/obscure !h-auto my-0.5"
|
className="mr-0.5 group/obscure !h-auto my-0.5"
|
||||||
iconClassName="group-hover/obscure:text"
|
iconClassName="group-hover/obscure:text"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export function HistoryDialog({ log }: Props) {
|
|||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{log.map((l) => (
|
{log.map((l) => (
|
||||||
<TableRow key={l.author + (l.message ?? 'n/a') + l.when}>
|
<TableRow key={(l.author.name ?? '') + (l.author.email ?? '') + (l.message ?? 'n/a') + l.when}>
|
||||||
<TruncatedWideTableCell>
|
<TruncatedWideTableCell>
|
||||||
{l.message || <em className="text-text-subtle">No message</em>}
|
{l.message || <em className="text-text-subtle">No message</em>}
|
||||||
</TruncatedWideTableCell>
|
</TruncatedWideTableCell>
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ export const GraphQLDocsExplorer = memo(function GraphQLDocsExplorer({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
key={activeItem.type.toString()} // Reset scroll position to top
|
key={activeItem.type.name} // Reset scroll position to top
|
||||||
className="overflow-y-auto h-full w-full p-3 grid grid-cols-[minmax(0,1fr)]"
|
className="overflow-y-auto h-full w-full p-3 grid grid-cols-[minmax(0,1fr)]"
|
||||||
>
|
>
|
||||||
<GqlTypeInfo item={activeItem} setItem={setActiveItem} schema={schema} />
|
<GqlTypeInfo item={activeItem} setItem={setActiveItem} schema={schema} />
|
||||||
@@ -202,7 +202,7 @@ function GraphQLExplorerHeader({
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<GqlSchemaSearch
|
<GqlSchemaSearch
|
||||||
key={item?.type.toString()} // Force reset when changing items
|
key={item?.type.name} // Force reset when changing items
|
||||||
maxHeight={containerHeight}
|
maxHeight={containerHeight}
|
||||||
currentItem={item}
|
currentItem={item}
|
||||||
schema={schema}
|
schema={schema}
|
||||||
@@ -798,7 +798,7 @@ function GqlSchemaSearch({
|
|||||||
label="search"
|
label="search"
|
||||||
hideLabel
|
hideLabel
|
||||||
defaultValue={value}
|
defaultValue={value}
|
||||||
placeholder={focused ? `Search ${currentItem?.type.toString() ?? 'Schema'}` : 'Search'}
|
placeholder={focused ? `Search ${currentItem != null ? currentItem.type.name : 'Schema'}` : 'Search'}
|
||||||
leftSlot={
|
leftSlot={
|
||||||
<div className="w-10 flex justify-center items-center">
|
<div className="w-10 flex justify-center items-center">
|
||||||
<Icon size="sm" icon="search" color="secondary" />
|
<Icon size="sm" icon="search" color="secondary" />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { ReactNode } from 'react';
|
|||||||
* https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react
|
* https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react
|
||||||
*/
|
*/
|
||||||
export function getNodeText(node: ReactNode): string {
|
export function getNodeText(node: ReactNode): string {
|
||||||
if (['string', 'number'].includes(typeof node)) {
|
if (typeof node === 'string' || typeof node === 'number') {
|
||||||
return String(node);
|
return String(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user