@@ -104,7 +104,8 @@ See the LICENSE and NOTICES files in the project root for more information.
104
104
@Html.HiddenFor(m => m .ApiVersionId )
105
105
@Html.Display(m => m .ApiVersion )
106
106
@Html.Display(m => m .ResourceName )
107
- @Html.HiddenFor(m => m .ResourcePath )
107
+ @Html.HiddenFor(m => m .ResourcePath )
108
+ @Html.HiddenFor(m => m .IsDeleteOperation )
108
109
}
109
110
110
111
<div class =" form-group" >
@@ -127,7 +128,18 @@ See the LICENSE and NOTICES files in the project root for more information.
127
128
</div >
128
129
</div >
129
130
130
- @Html.Input(m => m .IsDeleteOperation )
131
+ if (ControllerAction (Context .Request .RouteValues ) == " Add" || Model .IsDeleteOperation )
132
+ {
133
+ @Html .Input (m => m .IsDeleteOperation , ControllerAction (Context .Request .RouteValues ) == " Edit" )
134
+ }
135
+ else
136
+ {
137
+ <div class = " form-group" >
138
+ <div class =" col-sm-offset-2 col-sm-10" >
139
+ <label >This is an INSERT /UPDATE map </label >
140
+ </div >
141
+ </div >
142
+ }
131
143
132
144
<fieldset >
133
145
<div id =" attributeContainer" style =" display :none ;" >
@@ -293,7 +305,7 @@ See the LICENSE and NOTICES files in the project root for more information.
293
305
294
306
var $apiVersionIdElem = $ (' #@Html.IdFor(m => m.ApiVersionId)' );
295
307
var $resourcePathElem = $ (' #@Html.IdFor(m => m.ResourcePath)' );
296
- var $isDeleteOperationElem = $ (' #@Html.IdFor(m => m.IsDeleteOperation)' );
308
+ var $isDeleteOperationElem = $ (' input:checkbox, #@Html.IdFor(m => m.IsDeleteOperation)' );
297
309
298
310
refreshResourcePathVisibility ();
299
311
refreshAllControlVisibility ();
@@ -373,7 +385,7 @@ See the LICENSE and NOTICES files in the project root for more information.
373
385
{
374
386
@: var resourcePath = emptyToNull ($ (" #ResourcePath" ).val ());
375
387
}
376
-
388
+
377
389
var dataObject = {
378
390
apiVersionId: $apiVersionIdElem .val (),
379
391
dataMapId: $ (' #@Html.IdFor(m => m.DataMapId)' ).val (),
@@ -382,7 +394,7 @@ See the LICENSE and NOTICES files in the project root for more information.
382
394
mappings: mappingJson,
383
395
preprocessorId: $ (' #@Html.IdFor(m => m.PreprocessorId)' ).val (),
384
396
attribute: $ (' #@Html.IdFor(m => m.Attribute)' ).val (),
385
- isDeleteOperation: $ (' #@Html.IdFor(m => m.IsDeleteOperation)' ).is (" :checked" ),
397
+ isDeleteOperation: $ (' input:checkbox, #@Html.IdFor(m => m.IsDeleteOperation)' ).is (" :checked" ),
386
398
columnHeaders: JSON .parse ($ (' #@Html.IdFor(m => m.ColumnHeaders)' ).val ())
387
399
};
388
400
$ .ajax ({
@@ -410,6 +422,10 @@ See the LICENSE and NOTICES files in the project root for more information.
410
422
411
423
$isDeleteOperationElem .change (function () {
412
424
$ (' #delete-operation-warning' ).toggleClass (' hidden' , $isDeleteOperationElem .is (" :checked" )=== false )
425
+ clearColumnsMetadata ();
426
+ clearDataMapping ();
427
+ invalidateAPIConnectionVisibility ();
428
+ refreshAttributeVisibility ();
413
429
});
414
430
415
431
$apiVersionIdElem .change (function () {
@@ -606,6 +622,7 @@ See the LICENSE and NOTICES files in the project root for more information.
606
622
607
623
function clearDataMapping () {
608
624
$ (' #divModelFields' ).html (' ' );
625
+ $ (' #divCSVFields' ).html (' ' );
609
626
refreshAllControlVisibility ();
610
627
$ (' #btnSubmit' ).hide ();
611
628
}
0 commit comments