Skip to content
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

bump react-router 7 #8489

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
102 changes: 57 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ test.describe('Environment Editor', async () => {
// check row has been disabled
await expect(firstRow).toHaveCSS('opacity', '0.4');
// delete all items
await page.getByRole('button', { name: 'Delete All' }).dblclick();
await page.getByRole('button', { name: 'Delete All' }).click();
await page.getByTitle('Click again to confirm').click();

firstRow = await kvTable.getByRole('option').first();
await firstRow.getByTestId('OneLineEditor').first().click();
Expand Down
12 changes: 6 additions & 6 deletions packages/insomnia-smoke-test/tests/smoke/insomnia-tab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
await page.getByLabel('Create in collection').click();
await page.getByLabel('HTTP Request').click();
await page.getByTestId('New Request').dblclick();
await page.getByRole('textbox', { name: 'GET New Request' }).fill('New Request A');
await page.getByRole('textbox', { name: 'GET New Request' }).fill('first');
await page.getByLabel('Create in collection').click();
await page.getByLabel('HTTP Request').click();
await page.getByTestId('New Request').dblclick();
await page.getByRole('textbox', { name: 'GET New Request' }).fill('New Request B');
await page.getByTestId('New Request A').click();
await page.getByRole('textbox', { name: 'GET New Request' }).fill('second');

Check failure on line 34 in packages/insomnia-smoke-test/tests/smoke/insomnia-tab.test.ts

View workflow job for this annotation

GitHub Actions / Test

[Smoke] › smoke/insomnia-tab.test.ts:26:7 › multiple-tab feature test › active tab sync with the sidebar active request

2) [Smoke] › smoke/insomnia-tab.test.ts:26:7 › multiple-tab feature test › active tab sync with the sidebar active request TimeoutError: locator.fill: Timeout 30000ms exceeded. Call log: - waiting for getByRole('textbox', { name: 'GET New Request' }) 32 | await page.getByLabel('HTTP Request').click(); 33 | await page.getByTestId('New Request').dblclick(); > 34 | await page.getByRole('textbox', { name: 'GET New Request' }).fill('second'); | ^ 35 | await page.getByTestId('first').click(); 36 | await page.waitForTimeout(1000); 37 | const tabA = await page.getByLabel('Insomnia Tabs').getByLabel('tab-first', { exact: true }); at /home/runner/work/insomnia/insomnia/packages/insomnia-smoke-test/tests/smoke/insomnia-tab.test.ts:34:66
await page.getByTestId('first').click();
await page.waitForTimeout(1000);
const tabA = await page.getByLabel('Insomnia Tabs').getByLabel('tab-New Request A', { exact: true });
const tabA = await page.getByLabel('Insomnia Tabs').getByLabel('tab-first', { exact: true });
expect(await tabA.getAttribute('data-selected')).toBe('true');
await page.getByTestId('New Request B').click();
await page.getByTestId('second').click();
await page.waitForTimeout(1000);
const tabB = await page.getByLabel('Insomnia Tabs').getByLabel('tab-New Request B', { exact: true });
const tabB = await page.getByLabel('Insomnia Tabs').getByLabel('tab-second', { exact: true });
expect(await tabB.getAttribute('data-selected')).toBe('true');
});

Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"react-aria-components": "^1.1.1",
"react-dom": "^18.2.0",
"react-resizable-panels": "^2.1.7",
"react-router-dom": "^6.26.2",
"react-router": "^7.1.1",
"react-stately": "3.30.1",
"react-use": "^17.5.0",
"tailwindcss": "^3.4.3",
Expand Down
90 changes: 45 additions & 45 deletions packages/insomnia/src/ui/components/command-palette.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { memo, useEffect, useRef } from 'react';
import { useState } from 'react';
import { Button, Collection, ComboBox, Dialog, DialogTrigger, Header, Input, Keyboard, Label, ListBox, ListBoxItem, Modal, ModalOverlay, Popover, Section, Text } from 'react-aria-components';
import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router-dom';
import { useFetcher, useNavigate, useParams, useRouteLoaderData } from 'react-router';

import { constructKeyCombinationDisplay, getPlatformKeyCombinations } from '../../common/hotkeys';
import { fuzzyMatch } from '../../common/misc';
Expand Down Expand Up @@ -69,7 +69,7 @@ const CommandPaletteCombobox = ({ close }: { close: () => void }) => {
projectId: string;
workspaceId: string;
requestId: string;
};
};

const { userSession } = useRouteLoaderData('root') as RootLoaderData;
const { presence } = useInsomniaEventStreamContext();
Expand Down Expand Up @@ -214,11 +214,11 @@ const CommandPaletteCombobox = ({ close }: { close: () => void }) => {
{getMethodShortHand(request.item)}
</span>
) : isWebSocketRequest(request.item) ? (
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-notice] bg-[rgba(var(--color-notice-rgb),0.5)]">
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-notice] bg-[rgba(var(--color-notice-rgb),0.5)]">
WS
</span>
) : isGrpcRequest(request.item) && (
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-info] bg-[rgba(var(--color-info-rgb),0.5)]">
) : isGrpcRequest(request.item) && (
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-info] bg-[rgba(var(--color-info-rgb),0.5)]">
gRPC
</span>
),
Expand Down Expand Up @@ -295,11 +295,11 @@ const CommandPaletteCombobox = ({ close }: { close: () => void }) => {
{getMethodShortHand(request.item)}
</span>
) : isWebSocketRequest(request.item) ? (
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-notice] bg-[rgba(var(--color-notice-rgb),0.5)]">
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-notice] bg-[rgba(var(--color-notice-rgb),0.5)]">
WS
</span>
) : isGrpcRequest(request.item) && (
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-info] bg-[rgba(var(--color-info-rgb),0.5)]">
<span className="w-10 flex-shrink-0 flex text-[0.65rem] rounded-sm border border-solid border-[--hl-sm] items-center justify-center text-[--color-font-info] bg-[rgba(var(--color-info-rgb),0.5)]">
gRPC
</span>
),
Expand Down Expand Up @@ -429,48 +429,48 @@ const CommandPaletteCombobox = ({ close }: { close: () => void }) => {
</>
) : (
<>
<Icon icon="search" className="text-[--color-font] absolute left-4" />
<Input
slot='input'
placeholder="Search and switch between requests, collections and documents"
className="py-3 pl-10 pr-7 w-full bg-[--color-bg] transition-none text-[--color-font] rounded-md group-data-[open]:rounded-b-none border border-solid border-[--hl-sm]"
/>
<Icon icon="search" className="text-[--color-font] absolute left-4" />
<Input
slot='input'
placeholder="Search and switch between requests, collections and documents"
className="py-3 pl-10 pr-7 w-full bg-[--color-bg] transition-none text-[--color-font] rounded-md group-data-[open]:rounded-b-none border border-solid border-[--hl-sm]"
/>
</>
)}
</Label>
<Popover offset={0} className={`outline-none rounded-b-md w-[--trigger-width] bg-[--color-bg] text-[--color-font] relative overflow-y-auto flex-1 border ${isOpen ? 'border-solid' : ''} border-[--hl-sm]`}>
<ListBox
aria-label='Commands'
className="outline-none relative overflow-y-auto flex-1"
items={comboboxSections}
>
{section => (
<Section className='flex-1 flex flex-col'>
<Header className='p-2 text-xs uppercase text-[--hl] select-none'>{section.name}</Header>
<Collection items={section.children}>
{item => (
<ListBoxItem textValue={item.textValue} className="group outline-none select-none">
<div
className={`flex select-none outline-none ${item.id === workspaceId || item.id === requestId ? 'text-[--color-font] font-bold' : 'text-[--hl]'} group-aria-selected:text-[--color-font] relative group-hover:bg-[--hl-xs] group-data-[focused]:bg-[--hl-sm] group-focus:bg-[--hl-sm] transition-colors gap-2 px-4 items-center h-[--line-height-xs] w-full overflow-hidden`}
>
{item.icon}
<Text className="flex-shrink-0 px-1 truncate" slot="label">{item.name}</Text>
{item.presence.length > 0 && (
<span className='w-[70px]'>
<AvatarGroup
size="small"
maxAvatars={3}
items={item.presence}
/>
</span>
)}
<Text className="flex-1 px-1 truncate text-sm text-[--hl-md]" slot="description">{item.description}</Text>
</div>
</ListBoxItem>
)}
</Collection>
</Section>
)}
<ListBox
aria-label='Commands'
className="outline-none relative overflow-y-auto flex-1"
items={comboboxSections}
>
{section => (
<Section className='flex-1 flex flex-col'>
<Header className='p-2 text-xs uppercase text-[--hl] select-none'>{section.name}</Header>
<Collection items={section.children}>
{item => (
<ListBoxItem textValue={item.textValue} className="group outline-none select-none">
<div
className={`flex select-none outline-none ${item.id === workspaceId || item.id === requestId ? 'text-[--color-font] font-bold' : 'text-[--hl]'} group-aria-selected:text-[--color-font] relative group-hover:bg-[--hl-xs] group-data-[focused]:bg-[--hl-sm] group-focus:bg-[--hl-sm] transition-colors gap-2 px-4 items-center h-[--line-height-xs] w-full overflow-hidden`}
>
{item.icon}
<Text className="flex-shrink-0 px-1 truncate" slot="label">{item.name}</Text>
{item.presence.length > 0 && (
<span className='w-[70px]'>
<AvatarGroup
size="small"
maxAvatars={3}
items={item.presence}
/>
</span>
)}
<Text className="flex-1 px-1 truncate text-sm text-[--hl-md]" slot="description">{item.description}</Text>
</div>
</ListBoxItem>
)}
</Collection>
</Section>
)}
</ListBox>
</Popover>
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/components/document-tab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classnames from 'classnames';
import React from 'react';
import { NavLink } from 'react-router-dom';
import { NavLink } from 'react-router';

interface Props {
organizationId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IconName } from '@fortawesome/fontawesome-svg-core';
import React, { type FC, useCallback } from 'react';
import { Button, Collection, Header, ListBox, ListBoxItem, Popover, Section, Select, SelectValue } from 'react-aria-components';
import { useParams } from 'react-router-dom';
import { useParams } from 'react-router';

import {
HAWK_ALGORITHM_SHA256,
Expand Down Expand Up @@ -157,8 +157,8 @@ export const AuthDropdown: FC<Props> = ({ authentication, authTypes = defaultTyp
name: string;
}[] = [
{
id: 'apikey',
name: 'API Key',
id: 'apikey',
name: 'API Key',
},
{
id: 'basic',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IconName } from '@fortawesome/fontawesome-svg-core';
import React, { type FC } from 'react';
import { Button, Collection, Header, ListBox, ListBoxItem, Popover, Section, Select, SelectValue } from 'react-aria-components';
import { useParams, useRouteLoaderData } from 'react-router-dom';
import { useParams, useRouteLoaderData } from 'react-router';

import {
CONTENT_TYPE_EDN,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IconName, IconProp } from '@fortawesome/fontawesome-svg-core';
import React, { type FC, useEffect, useState } from 'react';
import { Button, Collection, Menu, MenuItem, MenuTrigger, Popover, Section, Tooltip, TooltipTrigger } from 'react-aria-components';
import { useFetcher, useParams, useRevalidator } from 'react-router-dom';
import { useFetcher, useParams, useRevalidator } from 'react-router';
import { useInterval } from 'react-use';

import type { GitRepository } from '../../../models/git-repository';
Expand Down
Loading
Loading