@@ -104,7 +104,8 @@ See the LICENSE and NOTICES files in the project root for more information.
104104 @Html.HiddenFor(m => m .ApiVersionId )
105105 @Html.Display(m => m .ApiVersion )
106106 @Html.Display(m => m .ResourceName )
107- @Html.HiddenFor(m => m .ResourcePath )
107+ @Html.HiddenFor(m => m .ResourcePath )
108+ @Html.HiddenFor(m => m .IsDeleteOperation )
108109 }
109110
110111 <div class =" form-group" >
@@ -127,7 +128,18 @@ See the LICENSE and NOTICES files in the project root for more information.
127128 </div >
128129 </div >
129130
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+ }
131143
132144 <fieldset >
133145 <div id =" attributeContainer" style =" display :none ;" >
@@ -293,7 +305,7 @@ See the LICENSE and NOTICES files in the project root for more information.
293305
294306 var $apiVersionIdElem = $ (' #@Html.IdFor(m => m.ApiVersionId)' );
295307 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)' );
297309
298310 refreshResourcePathVisibility ();
299311 refreshAllControlVisibility ();
@@ -373,7 +385,7 @@ See the LICENSE and NOTICES files in the project root for more information.
373385 {
374386 @: var resourcePath = emptyToNull ($ (" #ResourcePath" ).val ());
375387 }
376-
388+
377389 var dataObject = {
378390 apiVersionId: $apiVersionIdElem .val (),
379391 dataMapId: $ (' #@Html.IdFor(m => m.DataMapId)' ).val (),
@@ -382,7 +394,7 @@ See the LICENSE and NOTICES files in the project root for more information.
382394 mappings: mappingJson,
383395 preprocessorId: $ (' #@Html.IdFor(m => m.PreprocessorId)' ).val (),
384396 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" ),
386398 columnHeaders: JSON .parse ($ (' #@Html.IdFor(m => m.ColumnHeaders)' ).val ())
387399 };
388400 $ .ajax ({
@@ -410,6 +422,10 @@ See the LICENSE and NOTICES files in the project root for more information.
410422
411423 $isDeleteOperationElem .change (function () {
412424 $ (' #delete-operation-warning' ).toggleClass (' hidden' , $isDeleteOperationElem .is (" :checked" )=== false )
425+ clearColumnsMetadata ();
426+ clearDataMapping ();
427+ invalidateAPIConnectionVisibility ();
428+ refreshAttributeVisibility ();
413429 });
414430
415431 $apiVersionIdElem .change (function () {
@@ -606,6 +622,7 @@ See the LICENSE and NOTICES files in the project root for more information.
606622
607623 function clearDataMapping () {
608624 $ (' #divModelFields' ).html (' ' );
625+ $ (' #divCSVFields' ).html (' ' );
609626 refreshAllControlVisibility ();
610627 $ (' #btnSubmit' ).hide ();
611628 }
0 commit comments