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

[NEOS-1583] Remove invalid column button is broken #2966

Open
nickzelei opened this issue Nov 20, 2024 · 2 comments
Open

[NEOS-1583] Remove invalid column button is broken #2966

nickzelei opened this issue Nov 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nickzelei
Copy link
Member

image.png

The warning is a button and when you click it, it's supposed to remove it from the job mappings. This worked at some point…

It no longer does. May be fixed when we start refactoring out the form from nested components.

From SyncLinear.com | NEOS-1583

@nickzelei nickzelei added the bug Something isn't working label Nov 20, 2024
@nickzelei
Copy link
Member Author

It would be great if this ticket also surfaced the error in the validations pane.

@nickzelei
Copy link
Member Author

My refactor (#2960) has removed this feature. This ticket should re-add it.

import {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger,
} from '@/components/ui/tooltip';
import { ExclamationTriangleIcon } from '@radix-ui/react-icons';
import { ReactElement } from 'react';
import {
  ColumnKey,
  SchemaConstraintHandler,
} from './schema-constraint-handler';

interface Props {
  rowKey: ColumnKey;
  handler: SchemaConstraintHandler;
  onRemoveClick(): void;
}

export default function SchemaRowAlert(props: Props): ReactElement {
  const { rowKey, handler, onRemoveClick } = props;
  const isInSchema = handler.getIsInSchema(rowKey);

  const messages: string[] = [];

  if (!isInSchema) {
    messages.push('This column was not found in the backing source schema');
  }

  if (messages.length === 0) {
    return <div className="hidden" />;
  }

  return (
    <TooltipProvider delayDuration={100}>
      <Tooltip>
        <TooltipTrigger asChild>
          <div className="cursor-default">
            <ExclamationTriangleIcon
              className="text-yellow-600 dark:text-yellow-300 cursor-pointer"
              onClick={() => onRemoveClick()}
            />
          </div>
        </TooltipTrigger>
        <TooltipContent>
          <p>{messages.join('\n')}</p>
        </TooltipContent>
      </Tooltip>
    </TooltipProvider>
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant