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

Aaron/react 18 #729

Merged
merged 7 commits into from
Jul 27, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import React from 'react';
import { getActionText, RmfAction } from '../../permissions';
import { PermissionsCard } from '../permissions-card';

// TODO(AA): To remove after
// https://github.com/testing-library/react-testing-library/issues/1216
// has been resolved.
// Workaround for "Warning: An update to ComponentName inside a test was not
// wrapped in act(...)."
const originalError = console.error;
beforeAll(() => {
// this is just a little hack to silence
// Warning: An update to ComponentName inside a test was not wrapped in act(...).
console.error = (...args) => {
if (/Warning.*not wrapped in act/.test(args[0])) {
return;
Expand Down
3 changes: 2 additions & 1 deletion packages/dashboard/src/components/appbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export type TabValue = 'infrastructure' | 'robots' | 'tasks' | 'custom1' | 'cust

const locationToTabValue = (pathname: string): TabValue | undefined => {
const routes: { prefix: string; tabValue: TabValue }[] = [
{ prefix: DashboardRoute, tabValue: 'infrastructure' },
{ prefix: RobotsRoute, tabValue: 'robots' },
{ prefix: TasksRoute, tabValue: 'tasks' },
{ prefix: CustomRoute1, tabValue: 'custom1' },
Expand All @@ -79,7 +80,7 @@ const locationToTabValue = (pathname: string): TabValue | undefined => {

// `DashboardRoute` being the root, it is a prefix to all routes, so we need to check exactly.
const matchingRoute = routes.find((route) => pathname.startsWith(route.prefix));
return pathname === DashboardRoute ? 'infrastructure' : matchingRoute?.tabValue;
return matchingRoute?.tabValue;
};

function AppSettings() {
Expand Down
26 changes: 0 additions & 26 deletions packages/react-components/lib/commands/command-forms.stories.tsx

This file was deleted.

165 changes: 0 additions & 165 deletions packages/react-components/lib/commands/delivery-request-form.spec.tsx

This file was deleted.

Loading
Loading