diff --git a/Artifacts/clientdist/_githash_client.txt b/Artifacts/clientdist/_githash_client.txt index 12d5bafd..0a4bc8ea 100644 --- a/Artifacts/clientdist/_githash_client.txt +++ b/Artifacts/clientdist/_githash_client.txt @@ -1 +1 @@ -0e824076e1184dd9a9734cf70b23c0f84ec54fd9 +b3a397c75a352412fb341a4e7f69f2b146099a51 diff --git a/Artifacts/clientdist/clientpackage.zip b/Artifacts/clientdist/clientpackage.zip index 2e97cc94..b99281a8 100644 Binary files a/Artifacts/clientdist/clientpackage.zip and b/Artifacts/clientdist/clientpackage.zip differ diff --git a/Artifacts/clientdist/clientsourcepackage.zip b/Artifacts/clientdist/clientsourcepackage.zip index ccd8afd6..f36f0c45 100644 Binary files a/Artifacts/clientdist/clientsourcepackage.zip and b/Artifacts/clientdist/clientsourcepackage.zip differ diff --git a/Client/src/modules/AMCModule_ContentItem_Upload.js b/Client/src/modules/AMCModule_ContentItem_Upload.js index f11ff789..4d714bf5 100644 --- a/Client/src/modules/AMCModule_ContentItem_Upload.js +++ b/Client/src/modules/AMCModule_ContentItem_Upload.js @@ -53,11 +53,11 @@ export default class AMCApplicationItem_Content_Upload extends Common.AMCApplica this.acceptedtypes = ""; if (this.uploadclass == "build") { - this.acceptedtypes = ".3mf"; + this.acceptedtypes = itemJSON.acceptedtypes || ".3mf"; } if (this.uploadclass == "image") { - this.acceptedtypes = ".png,.jpg"; + this.acceptedtypes = itemJSON.acceptedtypes || ".png,.jpg"; } this.state = new AMCUploadState (this.uuid); diff --git a/Implementation/API/amc_api_constants.hpp b/Implementation/API/amc_api_constants.hpp index 400ea125..d40b8f47 100644 --- a/Implementation/API/amc_api_constants.hpp +++ b/Implementation/API/amc_api_constants.hpp @@ -242,6 +242,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AMC_API_KEY_UI_ITEMUPLOADFILENAME "uploadfilename" #define AMC_API_KEY_UI_ITEMUPLOADSUCCESSEVENT "uploadsuccessevent" #define AMC_API_KEY_UI_ITEMUPLOADFAILUREEVENT "uploadfailureevent" +#define AMC_API_KEY_UI_ITEMUPLOADACCEPTEDTYPES "acceptedtypes" #define AMC_API_KEY_UI_ITEMVALUE "value" #define AMC_API_KEY_UI_ITEMSORTABLE "sortable" #define AMC_API_KEY_UI_ITEMWIDTH "width" diff --git a/Implementation/UI/amc_ui_module_contentitem_upload.cpp b/Implementation/UI/amc_ui_module_contentitem_upload.cpp index 98ea4d72..2e292339 100644 --- a/Implementation/UI/amc_ui_module_contentitem_upload.cpp +++ b/Implementation/UI/amc_ui_module_contentitem_upload.cpp @@ -55,14 +55,15 @@ PUIModule_ContentUpload CUIModule_ContentUpload::makeFromXML(const pugi::xml_nod auto successeventAttrib = xmlNode.attribute("successevent"); auto failureeventAttrib = xmlNode.attribute("failureevent"); + auto acceptedtypesAttrib = xmlNode.attribute("acceptedtypes"); - return std::make_shared (pUIModuleEnvironment->contentRegistry(), classExpression, captionExpression, successeventAttrib.as_string (), failureeventAttrib.as_string (), sItemName, sModulePath, pUIModuleEnvironment->stateMachineData ()); + return std::make_shared (pUIModuleEnvironment->contentRegistry(), classExpression, captionExpression, successeventAttrib.as_string (), failureeventAttrib.as_string (), acceptedtypesAttrib.as_string (), sItemName, sModulePath, pUIModuleEnvironment->stateMachineData ()); } -CUIModule_ContentUpload::CUIModule_ContentUpload(CUIModule_ContentRegistry* pOwner, CUIExpression uploadClass, CUIExpression uploadCaption, const std::string& sSuccessEvent, const std::string& sFailureEvent, const std::string& sItemName, const std::string& sModulePath, PStateMachineData pStateMachineData) - : CUIModule_ContentItem(AMCCommon::CUtils::createUUID(), sItemName, sModulePath), m_UploadClass(uploadClass), m_UploadCaption (uploadCaption), m_sSuccessEvent (sSuccessEvent), m_sFailureEvent (sFailureEvent), m_pStateMachineData (pStateMachineData), m_pOwner (pOwner) +CUIModule_ContentUpload::CUIModule_ContentUpload(CUIModule_ContentRegistry* pOwner, CUIExpression uploadClass, CUIExpression uploadCaption, const std::string& sSuccessEvent, const std::string& sFailureEvent, const std::string& sAcceptedTypes, const std::string& sItemName, const std::string& sModulePath, PStateMachineData pStateMachineData) + : CUIModule_ContentItem(AMCCommon::CUtils::createUUID(), sItemName, sModulePath), m_UploadClass(uploadClass), m_UploadCaption (uploadCaption), m_sSuccessEvent (sSuccessEvent), m_sFailureEvent (sFailureEvent), m_sAcceptedTypes (sAcceptedTypes), m_pStateMachineData (pStateMachineData), m_pOwner (pOwner) { LibMCAssertNotNull(pStateMachineData); LibMCAssertNotNull(pOwner); @@ -85,6 +86,7 @@ void CUIModule_ContentUpload::addLegacyContentToJSON(CJSONWriter& writer, CJSONW object.addString(AMC_API_KEY_UI_ITEMUPLOADFILENAME, ""); object.addString(AMC_API_KEY_UI_ITEMUPLOADSUCCESSEVENT, m_sSuccessEvent); object.addString(AMC_API_KEY_UI_ITEMUPLOADFAILUREEVENT, m_sFailureEvent); + object.addString(AMC_API_KEY_UI_ITEMUPLOADACCEPTEDTYPES, m_sAcceptedTypes); } diff --git a/Implementation/UI/amc_ui_module_contentitem_upload.hpp b/Implementation/UI/amc_ui_module_contentitem_upload.hpp index 4bac04c4..7dfb47a4 100644 --- a/Implementation/UI/amc_ui_module_contentitem_upload.hpp +++ b/Implementation/UI/amc_ui_module_contentitem_upload.hpp @@ -60,13 +60,14 @@ namespace AMC { CUIExpression m_UploadCaption; std::string m_sSuccessEvent; std::string m_sFailureEvent; + std::string m_sAcceptedTypes; CUIModule_ContentRegistry* m_pOwner; public: static PUIModule_ContentUpload makeFromXML(const pugi::xml_node& xmlNode, const std::string& sItemName, const std::string& sModulePath, PUIModuleEnvironment pUIModuleEnvironment); - CUIModule_ContentUpload(CUIModule_ContentRegistry* pOwner, CUIExpression uploadClass, CUIExpression uploadCaption, const std::string & sSuccessEvent, const std::string& sFailureEvent, const std::string& sItemName, const std::string& sModulePath, PStateMachineData pStateMachineData); + CUIModule_ContentUpload(CUIModule_ContentRegistry* pOwner, CUIExpression uploadClass, CUIExpression uploadCaption, const std::string & sSuccessEvent, const std::string& sFailureEvent, const std::string& sAcceptedTypes, const std::string& sItemName, const std::string& sModulePath, PStateMachineData pStateMachineData); virtual ~CUIModule_ContentUpload();