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