File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
packages/compass-data-modeling/src Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
2323} from '@mongodb-js/compass-components' ;
2424import { cancelAnalysis , retryAnalysis } from '../store/analysis-process' ;
2525import type { Edit , StaticModel } from '../services/data-model-storage' ;
26+ import { UUID } from 'bson' ;
2627
2728const loadingContainerStyles = css ( {
2829 width : '100%' ,
@@ -141,7 +142,7 @@ const DiagramEditor: React.FunctionComponent<{
141142 placeholder = {
142143 type : 'AddRelationship' ,
143144 relationship : {
144- id : 'relationship1' ,
145+ id : new UUID ( ) . toString ( ) ,
145146 relationship : [
146147 {
147148 ns : 'db.sourceCollection' ,
@@ -161,7 +162,7 @@ const DiagramEditor: React.FunctionComponent<{
161162 case 'RemoveRelationship' :
162163 placeholder = {
163164 type : 'RemoveRelationship' ,
164- relationshipId : 'relationship1' ,
165+ relationshipId : new UUID ( ) . toString ( ) ,
165166 } ;
166167 break ;
167168 default :
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import type {
1212 MongoDBDataModelDescription ,
1313 StaticModel ,
1414} from '../services/data-model-storage' ;
15+ import { UUID } from 'bson' ;
1516
1617const model : StaticModel = {
1718 collections : [
@@ -32,7 +33,7 @@ const model: StaticModel = {
3233 ] ,
3334 relationships : [
3435 {
35- id : 'relationship1' ,
36+ id : new UUID ( ) . toString ( ) ,
3637 relationship : [
3738 {
3839 ns : 'db.sourceCollection' ,
@@ -106,8 +107,9 @@ describe('Data Modeling store', function () {
106107 it ( 'should apply a valid AddRelationship edit' , function ( ) {
107108 store . dispatch ( openDiagram ( loadedDiagram ) ) ;
108109
110+ const relationshipId = new UUID ( ) . toString ( ) ;
109111 const newRelationship : StaticModel [ 'relationships' ] [ number ] = {
110- id : 'relationship1' ,
112+ id : relationshipId ,
111113 relationship : [
112114 {
113115 ns : 'db.sourceCollection' ,
@@ -146,7 +148,7 @@ describe('Data Modeling store', function () {
146148 const edit = {
147149 type : 'AddRelationship' ,
148150 relationship : {
149- id : 'relationship1' ,
151+ id : new UUID ( ) . toString ( ) ,
150152 isInferred : false ,
151153 } ,
152154 } as unknown as Edit ;
You can’t perform that action at this time.
0 commit comments