Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

appstore.min.js 14KB

1
  1. var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(i){class r extends t.Core.BaseComponent{constructor(){super()}cssFiles(){return[]}jsFiles(){return["platform/apps/managers/appmanager.js","platform/integrations/components/createprovider.js","platform/integrations/managers/integrationmanager.js","platform/appstore/components/appstore.js","tenants/themes/default/components/details/details.js","tenants/themes/compact/components/details/details.js"]}load(t,i){$("#btnClose").click(function(){$("#"+i).modal("hide");$("#"+i).remove()});$("#btn_integrator").click(function(){n.Platform.Integrations.Components.CreateProvider.Instance().ProviderStatus($("#hf_providerId").val(),$("#hf_statusId").val())})}html(){return'<div class="hidden card" id="div_upgradeApp"><div class="card-header">App Upgrade<\/div><div class="card-body"><div class="row"><strong class="col-sm-1">Version<\/strong><input type="hidden" id="hf_versionno" value="0"/><span class="col-sm-1" id="spn_versionno"><\/span><div class="col-sm-2"><a class="btn btn-primary btn-center btn-sm text-white" id="btnUpgrade" href="javascript:;" onclick="Unibase.Platform.AppStore.Components.AppStore.Instance().upgradeApp()">Upgrade<\/a><\/div><\/div><\/div><\/div><div class="hidden card" id="div_currentVersion"><div class="card-header">Current Version<\/div><div class="card-body"><div class="row"><strong class="col-sm-2">Current Version<\/strong><input type="hidden" id="hf_Currentversionno"value="0" /><span class="col-sm-1" id="span_curversionno"><\/span><div class="col-sm-4"><\/div><\/div><\/div><\/div> <div class="hidden card" id="div_updateVersions"><div class="card-header">Latest Version<\/div><div class="card-body"><div class="row"><strong class="col-sm-2">Latest Version<\/strong><input type="hidden" id="hf_updateversionno"value="0" /><span class="col-sm-1" id="span_updateversionno"><\/span><\/div><\/div><\/div><\/div><div class="hidden card" id="div_descriptioncard"><div class="card-header">Description<\/div><div class="card-body" id="div_description"><\/div><\/div><div class="hidden card" id="div_Versionupgrade"><div class="card-header">App Upgrade Available<\/div><div class="card-body"><div class="row"><strong class="col-sm-2">Version<\/strong><input type="hidden" id="hf_versionno"value="0" /><span class="col-sm-1" id="span_versionno"><\/span><div class="col-sm-4"><a class="btn btn-primary btn-center btn-sm text-white" id="btnVersionUpgrade"href="javascript:;"onclick="Unibase.Platform.AppStore.Components.AppStore.Instance().upgradeAvailableApp()">Update<\/a><\/div><\/div><\/div><\/div><\/div>'}init(t){var i=this;i.fileCacheHelper.loadJsFiles(["platform/appstore/components/appstore.js","platform/integrations/components/createprovider.js"],function(){var u,r,f;i.navigationHelper.loadSection(0,t,n.Platform.AppStore.Components.AppStore.Instance(),null,null);u="";r=n.Themes.Providers.DetailHelper.installedAppId;for(let n of n.Themes.Providers.Detail_Settings.Instance().InputParameters)n.Key==="hf_"+r+"_providertype"&&(u=n.Value);f=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_appid").Value);n.Platform.Apps.Managers.AppManager.Instance().getInstallApp(f).then(function(t){n.Platform.Apps.Managers.AppManager.Instance().getApp(f).then(function(i){var o,s,f,e;u=="app"&&(o=t.result.IsUpdateAvailable,o==!0?($("#DetailSetting_"+r+"_Update").show(),$("#div_updateVersions").removeClass("hidden"),$("#span_updateversionno").text(i.result.VersionNo),$("#hf_updateversionno").val(i.result.VersionNo),$("#div_descriptioncard").removeClass("hidden"),$("#div_description").text(i.result.Description)):($("#DetailSetting_"+r+"_Update").hide(),$("#div_descriptioncard").removeClass("hidden"),$("#div_description").text(t.result.Description)),$("#span_curversionno").text(t.result.AppVersion),$("#hf_Currentversionno").val(t.result.AppVersion),$("#div_currentVersion").removeClass("hidden"),s=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_statusid").Value),s==1?$(".setting_status").text("UnInstall"):$(".setting_status").text("Install"));u=="widget"&&(f=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_widgetid").Value),n.Platform.Apps.Managers.AppManager.Instance().getWidgetVersion(f).then(function(n){var t=n.result.IsUpgrade;t==!1?($("#DetailSetting_"+r+"_Update").show(),$("#div_updateVersions").removeClass("hidden"),$("#span_updateversionno").text(n.result.VersionNo),$("#hf_updateversionno").val(n.result.VersionNo),$("#div_descriptioncard").removeClass("hidden"),$("#div_description").text(n.result.Description)):($("#div_descriptioncard").addClass("hidden"),$("#DetailSetting_"+r+"_Update").hide())}),n.Platform.Widgets.Managers.WidgetManager.Instance().getWidget(f).then(function(n){$(".setting_status").hide();$("#span_curversionno").text(n.result.VersionNo);$("#hf_Currentversionno").val(n.result.VersionNo);$("#div_currentVersion").removeClass("hidden")}));u=="report"&&(e=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_reportid").Value),n.Platform.Apps.Managers.AppManager.Instance().getReportVersion(e).then(function(t){var i=t.result.IsUpgrade;i==!1?($("#DetailSetting_"+r+"_Update").show(),$("#div_updateVersions").removeClass("hidden"),$("#span_updateversionno").text(t.result.VersionNo),$("#hf_updateversionno").val(t.result.VersionNo),$("#div_descriptioncard").removeClass("hidden"),$("#div_description").text(t.result.Description)):($("#DetailSetting_"+r+"_Update").hide(),$("#div_updateVersions").addClass("hidden"),$("#div_descriptioncard").addClass("hidden"));n.Platform.Analytics.Managers.ReportManager.Instance().getReportById(e).then(function(n){$(".setting_status").hide();$("#span_curversionno").text(n.result.VersionNo);$("#hf_Currentversionno").val(n.result.VersionNo);$("#div_currentVersion").removeClass("hidden")})}))})})})}updateactionBtn(){var t=n.Themes.Providers.DetailHelper.installedAppId;$("#DetailSetting_"+t+"_Update").on("click",function(){n.Platform.AppStore.Components.AppStore.Instance().upgradeAvailableApp();$(this).fadeOut(100,function(){$(this).text($(this).text()=="Update"?"Installing...":"Open").fadeIn(100)})})}downloadFile(){var i=n.Themes.Providers.DetailHelper.installedAppId,t=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+i+"_documentid").Value);t!=0?n.Platform.Apps.Managers.AppManager.Instance().getDocumentFileId(t).then(function(t){var i=t.result.DocumentFileId;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/controls/filedragndrop/w_documentfiles.js",function(){n.Platform.Forms.Components.DocumentFiles.Instance().downloadDocument(i)})}):MessageHelper.Instance().showError("401","File Doesnot Exits")}previewFile(){var r=n.Themes.Providers.DetailHelper.installedAppId,t=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_documentid").Value),i;t!=0?n.Platform.Apps.Managers.AppManager.Instance().getDocumentFileId(t).then(function(){n.Platform.Apps.Managers.AppManager.Instance().getDocumentFileId(t).then(function(t){var i=t.result.DocumentFileId;n.Platform.Apps.Managers.AppManager.Instance().previewDocument(i)})}):(i="File Doesnot Exits",MessageHelper.Instance().showError(i,""))}upgradeApp_Description(){var t=this,i=n.Themes.Providers.DetailHelper.installedAppId,r=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+i+"_appid").Value);n.Platform.Apps.Managers.AppManager.Instance().getApp(r).then(function(i){i.status==n.Data.Status.Success?MessageHelper.Instance().showSuccess(i.message,""):(t.navigationHelper.hideLoading(),alert(i.message))})}upgradeApp_popoup(t){var i=this;i.navigationHelper.showLoading();n.Platform.Apps.Managers.AppManager.Instance().upgradeAvailableApp(t).then(function(t){t.status==n.Data.Status.Success?(i.navigationHelper.hideLoading(),MessageHelper.Instance().showSuccess(t.message,"")):(i.navigationHelper.hideLoading(),MessageHelper.Instance().showError(t.message,""))})}upgradeAvailableApp(){var t=this,i="",r=n.Themes.Providers.DetailHelper.installedAppId,u,f,e;for(let n of n.Themes.Providers.Detail_Settings.Instance().InputParameters)n.Key==="hf_"+r+"_providertype"&&(i=n.Value.toString());u=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_appid").Value);i=="app"?(t.navigationHelper.showLoading(),n.Platform.Apps.Managers.AppManager.Instance().upgradeAvailableApp(u).then(function(i){var r,u;i.status==n.Data.Status.Success?(t.navigationHelper.hideLoading(),MessageHelper.Instance().showSuccess(i.message,""),r=n.Themes.Compact.Components.Details.Instance(),r._recordId=n.Themes.Providers.DetailHelper.recordId,r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId,r._containerId=$("._bizgaze_detail_container:visible").attr("id"),u=r,r.loadPortlets(u)):(t.navigationHelper.hideLoading(),MessageHelper.Instance().showError(i.message,""),r=n.Themes.Compact.Components.Details.Instance(),r._recordId=n.Themes.Providers.DetailHelper.recordId,r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId,r._containerId=$("._bizgaze_detail_container:visible").attr("id"),u=r,r.loadPortlets(u))})):i=="widget"?(f=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_widgetid").Value),t.navigationHelper.showLoading(),n.Platform.Apps.Managers.AppManager.Instance().upgradeWidgetVersionAvailable(f).then(function(i){var r,u;i.status==n.Data.Status.Success?(t.navigationHelper.hideLoading(),MessageHelper.Instance().showSuccess(i.message,""),r=n.Themes.Compact.Components.Details.Instance(),r._recordId=n.Themes.Providers.DetailHelper.recordId,r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId,r._containerId=$("._bizgaze_detail_container:visible").attr("id"),u=r,r.loadPortlets(u)):(t.navigationHelper.hideLoading(),MessageHelper.Instance().showError(i.message,""),r=n.Themes.Compact.Components.Details.Instance(),r._recordId=n.Themes.Providers.DetailHelper.recordId,r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId,r._containerId=$("._bizgaze_detail_container:visible").attr("id"),u=r,r.loadPortlets(u))})):i=="report"&&(t.navigationHelper.showLoading(),e=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_reportid").Value),n.Platform.Apps.Managers.AppManager.Instance().upgradeReportVersionAvailable(e).then(function(i){var r,u;i.status==n.Data.Status.Success?(t.navigationHelper.hideLoading(),MessageHelper.Instance().showSuccess(i.message,""),r=n.Themes.Compact.Components.Details.Instance(),r._recordId=n.Themes.Providers.DetailHelper.recordId,r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId,r._containerId=$("._bizgaze_detail_container:visible").attr("id"),u=r,r.loadPortlets(u)):(t.navigationHelper.hideLoading(),MessageHelper.Instance().showError(i.message,""),r=n.Themes.Compact.Components.Details.Instance(),r._recordId=n.Themes.Providers.DetailHelper.recordId,r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId,r._containerId=$("._bizgaze_detail_container:visible").attr("id"),u=r,r.loadPortlets(u))}))}appStatus(){var r=n.Themes.Providers.DetailHelper.installedAppId,u=this,i,t;u.fileCacheHelper.loadJsFile("platform/analytics/components/menuuserdesign/userdesignmenu.js",function(){n.Platform.Analytics.Components.UserDesignMenu.Instance().IsAppRefresh=!0});i=$(".setting_status").text()=="Install"?1:2;t=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_appid").Value);n.Platform.Apps.Managers.AppManager.Instance().updateAppStatus(t,i).then(function(i){return __awaiter(this,void 0,void 0,function*(){n.Platform.Apps.Managers.AppManager.Instance().getdependentApps(t).then(function(r){return __awaiter(this,void 0,void 0,function*(){function u(){var u="",r,f;u=i.result.StatusId==1?"App Installed Succesfully":"App Uninstalled Succesfully";r=n.Themes.Compact.Components.Details.Instance();r._recordId=t;r._installedAppId=n.Themes.Providers.DetailHelper.installedAppId;r._containerId=$("._bizgaze_detail_container:visible").attr("id");f=r;r.loadAppConfigurations(f,r._containerId);MessageHelper.Instance().showSuccess(u,"")}r.result.length>0?confirm("This app contain "+r.result.length+" dependent apps. Are you sure you want to continue")&&u():u()})})})})}addToWishListBtn(){var i,t;i=!1;t=n.Themes.Providers.DetailHelper.installedAppId;$("#DetailSetting_"+t+"_Addtowhishlist").on("click",function(){n.Platform.AppStore.Components.AppStore.Instance().changeWhishList(i);$("#DetailSetting_"+t+"_Addtowhishlist").show();$("#DetailSetting_"+t+"_Removefromwhishlist").hide()})}removeFromWishListBtn(){var i,t;i=!0;t=n.Themes.Providers.DetailHelper.installedAppId;$("#DetailSetting_"+t+"_Removefromwhishlist").on("click",function(){n.Platform.AppStore.Components.AppStore.Instance().changeWhishList(i);$("#DetailSetting_"+t+"_Addtowhishlist").hide();$("#DetailSetting_"+t+"_Removefromwhishlist").show()})}changeWhishList(t){status?($("#btn_WishlistTrue").parent().removeClass("hidden"),$("#btn_WishlistFalse").parent().addClass("hidden")):($("#btn_WishlistTrue").parent().addClass("hidden"),$("#btn_WishlistFalse").parent().removeClass("hidden"));var i=n.Themes.Providers.DetailHelper.installedAppId,r=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+i+"_appid").Value);n.Platform.Apps.Managers.AppManager.Instance().updateWishList(r,t).then(function(t){t.status==n.Data.Status.Success?MessageHelper.Instance().showSuccess(t.message,""):alert(t.message)})}static Instance(){return this.instance===undefined&&(this.instance=new r),this.instance}}i.AppStore=r})(r=i.Components||(i.Components={}))})(i=t.AppStore||(t.AppStore={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));