mirror of
				https://github.com/chartdb/chartdb.git
				synced 2025-11-04 05:53:15 +00:00 
			
		
		
		
	@@ -5,13 +5,14 @@ import type {
 | 
			
		||||
    DiffEvent,
 | 
			
		||||
} from './diff-context';
 | 
			
		||||
import { diffContext } from './diff-context';
 | 
			
		||||
import type { ChartDBDiff, DiffMap } from './types';
 | 
			
		||||
 | 
			
		||||
import { generateDiff, getDiffMapKey } from './diff-check/diff-check';
 | 
			
		||||
import type { Diagram } from '@/lib/domain/diagram';
 | 
			
		||||
import { useEventEmitter } from 'ahooks';
 | 
			
		||||
import type { DBField } from '@/lib/domain/db-field';
 | 
			
		||||
import type { DataType } from '@/lib/data/data-types/data-types';
 | 
			
		||||
import type { DBRelationship } from '@/lib/domain/db-relationship';
 | 
			
		||||
import type { ChartDBDiff, DiffMap } from '@/lib/domain/diff/diff';
 | 
			
		||||
 | 
			
		||||
export const DiffProvider: React.FC<React.PropsWithChildren> = ({
 | 
			
		||||
    children,
 | 
			
		||||
@@ -45,7 +46,7 @@ export const DiffProvider: React.FC<React.PropsWithChildren> = ({
 | 
			
		||||
                if (diff.object === 'field' && diff.type === 'added') {
 | 
			
		||||
                    const field = newDiagram?.tables
 | 
			
		||||
                        ?.find((table) => table.id === diff.tableId)
 | 
			
		||||
                        ?.fields.find((f) => f.id === diff.fieldId);
 | 
			
		||||
                        ?.fields.find((f) => f.id === diff.newField.id);
 | 
			
		||||
 | 
			
		||||
                    if (field) {
 | 
			
		||||
                        newFieldsMap.set(diff.tableId, [
 | 
			
		||||
@@ -73,7 +74,7 @@ export const DiffProvider: React.FC<React.PropsWithChildren> = ({
 | 
			
		||||
            diffMap.forEach((diff) => {
 | 
			
		||||
                if (diff.object === 'relationship' && diff.type === 'added') {
 | 
			
		||||
                    const relationship = newDiagram?.relationships?.find(
 | 
			
		||||
                        (rel) => rel.id === diff.relationshipId
 | 
			
		||||
                        (rel) => rel.id === diff.newRelationship.id
 | 
			
		||||
                    );
 | 
			
		||||
 | 
			
		||||
                    if (relationship) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user