@@ -127,11 +127,6 @@ function(accUtils, i18n, ko, project, urlCatalog, viewHelper, wktLogger, ViewMod
127
127
fileContents : this . project . wdtModel . modelContent ( )
128
128
} ;
129
129
130
- if ( ! providerOptions . fileContents ) {
131
- const modelTemplates = this . designer . getProperty ( 'modelTemplate' ) ;
132
- providerOptions . fileContents = modelTemplates . domain ;
133
- }
134
-
135
130
// A name is needed to create a WDT Model File provider.
136
131
//
137
132
providerOptions [ 'name' ] = this . project . wdtModel . getDefaultModelFile ( ) ;
@@ -174,7 +169,21 @@ function(accUtils, i18n, ko, project, urlCatalog, viewHelper, wktLogger, ViewMod
174
169
wktLogger . debug ( 'Received changesAutoDownloaded event with modelContent = %s' , event . detail . value ) ;
175
170
this . wrcBackendTriggerChange = true ;
176
171
this . project . wdtModel . modelContent ( event . detail . value ) ;
177
- if ( event . detail . properties ) this . project . wdtModel . getModelPropertiesObject ( ) . observable ( event . detail . properties ) ;
172
+ if ( event . detail . properties ) {
173
+ const existingProperties = this . project . wdtModel . getModelPropertiesObject ( ) . observable ( ) ;
174
+ event . detail . properties . forEach ( ( item ) => {
175
+ const index = existingProperties . map ( item1 => item1 . uid ) . indexOf ( item . uid ) ;
176
+ if ( index === - 1 ) {
177
+ // Must call addNewItem() in order to get remove() function added
178
+ this . project . wdtModel . getModelPropertiesObject ( ) . addNewItem ( { uid : item . uid , Name : item . Name , Value : item . Value } ) ;
179
+ }
180
+ else {
181
+ // Update existing properties with data from "Design View"
182
+ existingProperties [ index ] . Name = item . Name ;
183
+ existingProperties [ index ] . Value = item . Value ;
184
+ }
185
+ } ) ;
186
+ }
178
187
} ;
179
188
180
189
this . archiveUpdated = ( event ) => {
0 commit comments