Open nickzelei opened 2 days ago
It would be great if this ticket also surfaced the error in the validations pane.
My refactor (https://github.com/nucleuscloud/neosync/pull/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>
);
}
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