You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2020/06/23 12:55:01 UTC

[ofbiz-plugins] branch trunk updated: Fixed: Error while uploading file in Ecommerce Profile's File Manager (OFBIZ-10746)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 17c42bc  Fixed: Error while uploading file in Ecommerce Profile's File Manager (OFBIZ-10746)
17c42bc is described below

commit 17c42bcddcc3c1b48900502cd55943c4388d7893
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Tue Jun 23 14:35:33 2020 +0200

    Fixed: Error while uploading file in Ecommerce Profile's File Manager (OFBIZ-10746)
    
    This is only fixing the UI where you did not see the file to upload you selected
    
    There is still an issue to upload the file
    
    Thanks: Priya Sharma for testing
---
 ecommerce/template/customer/ViewProfile.ftl | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/ecommerce/template/customer/ViewProfile.ftl b/ecommerce/template/customer/ViewProfile.ftl
index 5846d2d..72a883a 100644
--- a/ecommerce/template/customer/ViewProfile.ftl
+++ b/ecommerce/template/customer/ViewProfile.ftl
@@ -465,10 +465,20 @@ under the License.
         <input type="hidden" name="statusId" value="CTNT_PUBLISHED"/>
         <input type="hidden" name="roleTypeId" value="OWNER"/>
         <label class="mr-2">${uiLabelMap.EcommerceUploadNewFile}</label>
-        <label class="custom-file mr-2">
-          <input type="file" name="uploadedFile" class="custom-file-input"/>
+        <div class="custom-file mr-2">
+          <input type="file" class="custom-file-input" id="customFile" required/>
           <label class="custom-file-label" for="customFile">Choose file</label>
-        </label>
+          <div class="invalid-feedback">Example invalid custom file feedback</div>
+        </div>
+        <script>
+            $('#customFile').on('change',function(){
+                //get the file name
+                var fileName = $(this).val();
+                fileName = fileName.replace('C:\\fakepath\\', " ");
+                //replace the "Choose a file" label
+                $(this).next('.custom-file-label').html(fileName);
+            })
+        </script>
         <select name="partyContentTypeId" class="custom-select mr-2">
           <option value="">${uiLabelMap.PartySelectPurpose}</option>
           <#list partyContentTypes as partyContentType>