From 194c6156e0e26525dc1d2ea9b621d00cdae26d18 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Wed, 21 May 2025 12:17:06 +0530 Subject: [PATCH 1/2] chage references of beta.jamkazam to www.jamkazam --- jam-ui/.env.production | 2 +- web/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jam-ui/.env.production b/jam-ui/.env.production index 14fe4f7a1..a1a92c2b6 100644 --- a/jam-ui/.env.production +++ b/jam-ui/.env.production @@ -1,4 +1,4 @@ -HOST=beta.jamkazam.com +HOST=www.jamkazam.com PORT=4000 REACT_APP_ORIGIN=jamkazam.com REACT_APP_LEGACY_BASE_URL=https://www.jamkazam.com diff --git a/web/README.md b/web/README.md index becab832d..6984bbddd 100644 --- a/web/README.md +++ b/web/README.md @@ -12,7 +12,7 @@ URLs starting as jamkazam:// are considered custom urls that can be used to open and load a screen or call an internal function. Let's say a user clicks or submits a from which in turns call a custom URL. -For example in the new react web interface, when a session is created using the form in https://beta.jamkazam.com/sessions/new let's say it calls following custom URL +For example in the new react web interface, when a session is created using the form in https://www.jamkazam.com/sessions/new let's say it calls following custom URL jamkazam://https//www.jamkazam.com/client#/createSession/custom~yes%7Cprivacy~2%7Cdescription~Testing%20session%20creation%20from%20beta%20website%7CinviteeIds~062deeba-b917-46e2-bfa3-e829405ca602 From 2983b801f60c58cbf4ffa5deafadd58ab19c91b6 Mon Sep 17 00:00:00 2001 From: Nuwan Chaturanga Date: Fri, 23 May 2025 13:01:45 +0000 Subject: [PATCH 2/2] Merged in 5538-modal_dialog_to_remind_gear_setup (pull request #60) 5538 modal dialog to remind gear setup * Setup Gear prompt Display each time user runs app if Setup Gear step in PLG funnel not yet completed Approved-by: Seth Call --- web/app/assets/javascripts/JamServer.js | 15 ++++++ web/app/assets/javascripts/clientUpdate.js | 41 ++++++++++++++++ .../assets/javascripts/gear_setup_reminder.js | 48 +++++++++++++++++++ web/app/assets/stylesheets/client/client.css | 1 + .../stylesheets/client/gearSetupReminder.scss | 12 +++++ .../clients/_gear_setup_reminder.html.erb | 42 ++++++++++++++++ web/app/views/clients/index.html.erb | 18 +++++++ 7 files changed, 177 insertions(+) create mode 100644 web/app/assets/javascripts/gear_setup_reminder.js create mode 100644 web/app/assets/stylesheets/client/gearSetupReminder.scss create mode 100644 web/app/views/clients/_gear_setup_reminder.html.erb diff --git a/web/app/assets/javascripts/JamServer.js b/web/app/assets/javascripts/JamServer.js index f13b0abfc..500d942f0 100644 --- a/web/app/assets/javascripts/JamServer.js +++ b/web/app/assets/javascripts/JamServer.js @@ -394,6 +394,21 @@ payload.client_update.size ); } + + if(context.JK.ClientUpdateInstance) { + context.JK.ClientUpdateInstance.isUpdateAvailable().then(function(isUpdateAvailable) { + if (!isUpdateAvailable) { + // Check if the user has not set up their gear yet + context.JK.hasOneConfiguredDevice().then(function(hasOneConfiguredDevice){ + if (!hasOneConfiguredDevice) { + // Show the gear setup reminder dialog + context.JK.GearSetupReminderInstance.show(); + } + }); + } + }); + } + }, 0); } diff --git a/web/app/assets/javascripts/clientUpdate.js b/web/app/assets/javascripts/clientUpdate.js index 0fd4230c8..d6e9ce9b4 100644 --- a/web/app/assets/javascripts/clientUpdate.js +++ b/web/app/assets/javascripts/clientUpdate.js @@ -299,6 +299,46 @@ }); } + async function isUpdateAvailable(){ + //this should check if the current version is less than the server version + //if so, return true + //otherwise return false + + var os = await context.jamClient.GetDetailedOS(); + //os = 'Win32' + var product = "JamClientModern" + var currentVersion = await context.jamClient.ClientUpdateVersion(); + if (!forceShow && (currentVersion == null || currentVersion.indexOf("Compiled")) > -1) { + // this is a developer build; it doesn't make much sense to do an packaged update, so skip + console.log("skipping client update check because this is a development build ('" + currentVersion + "')") + return false; + } + // # strange client oddity: remove quotes, if found, from start and finish of version. + if (currentVersion.indexOf('"') == 0 && currentVersion.lastIndexOf('"') == currentVersion.length - 1) { + currentVersion = currentVersion.substring(1, currentVersion.length - 1); + } + return new Promise((resolve, reject) => { + $.ajax({ + type: "GET", + url: "/api/versioncheck?product=" + product + "&os=" + os, + success: function (response) { + if(!jQuery.isEmptyObject(response)){ + // runCheck(product, response.version, response.uri, response.size, currentVersion); + var result = shouldUpdate(currentVersion, response.version); + resolve(result); + } else { + resolve(false); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + logger.error("Unable to do a client update check against /api/versioncheck"); + resolve(false); + } + }); + + }); + } + async function startDownload(url) { console.log("starting client updater download from: " + url); @@ -344,6 +384,7 @@ this.initialize = initialize; this.check = check; this.runCheck = runCheck; + this.isUpdateAvailable = isUpdateAvailable; } return this; diff --git a/web/app/assets/javascripts/gear_setup_reminder.js b/web/app/assets/javascripts/gear_setup_reminder.js new file mode 100644 index 000000000..8866c219b --- /dev/null +++ b/web/app/assets/javascripts/gear_setup_reminder.js @@ -0,0 +1,48 @@ +(function (context, $) { + + "use strict"; + + context.JK = context.JK || {}; + + context.JK.GearSetupReminder = function (app) { + + function showModal(options) { + options = options || {}; + + $('#gear_setup_reminder').attr('data-mode', 'gear-setup-reminder'); + + $('body').on('keyup', cancelModal); + + $("#gear_setup_reminder a.close-modal").click(function () { + app.layout.closeDialog('gear-setup-reminder'); + $('body').off('keyup', cancelModal); + return false; + }) + + $("#gear_setup_reminder a.setup-gear").click(function () { + app.layout.closeDialog('gear-setup-reminder'); + $('body').off('keyup', cancelModal); + window.location.hash = '#/account/audio'; + return false; + }) + + if(!app.layout.isDialogShowing('gear-setup-reminder')) { + app.layout.showDialog('gear-setup-reminder') + } + + } + + function cancelModal(e) { + if ((e.ctrlKey || e.metaKey) && e.keyCode == 78) { + console.log("update canceled!"); + app.layout.closeDialog('gear-setup-reminder'); + } + } + + // Expose publics + this.show = showModal; + } + + return this; + +})(window, jQuery); diff --git a/web/app/assets/stylesheets/client/client.css b/web/app/assets/stylesheets/client/client.css index 8dd471be3..dd3706e03 100644 --- a/web/app/assets/stylesheets/client/client.css +++ b/web/app/assets/stylesheets/client/client.css @@ -78,6 +78,7 @@ *= require ./sessionList *= require ./searchResults *= require ./clientUpdate + *= require ./gearSetupReminder *= require ./musician *= require ./help *= require ./jquery-ui-overrides diff --git a/web/app/assets/stylesheets/client/gearSetupReminder.scss b/web/app/assets/stylesheets/client/gearSetupReminder.scss new file mode 100644 index 000000000..97b5c0860 --- /dev/null +++ b/web/app/assets/stylesheets/client/gearSetupReminder.scss @@ -0,0 +1,12 @@ +#gear_setup_reminder { + display:none; + + width:800px; + min-height:0; + + h2 { + font-weight:bold; + font-size:x-large; + } +} + diff --git a/web/app/views/clients/_gear_setup_reminder.html.erb b/web/app/views/clients/_gear_setup_reminder.html.erb new file mode 100644 index 000000000..7a82770aa --- /dev/null +++ b/web/app/views/clients/_gear_setup_reminder.html.erb @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index f26184ae8..ec6287308 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -99,6 +99,7 @@ <%= render "hoverSession" %> <%= render "notify" %> <%= render "client_update" %> +<%= render "gear_setup_reminder" %> <%= render "overlay_small" %> <%= render "listenBroadcast" %> <%= render "sync_viewer_templates" %> @@ -225,6 +226,23 @@ JK.ClientUpdateInstance = clientUpdate; clientUpdate.initialize(); + var gearSetupReminder = new JK.GearSetupReminder(JK.app); + JK.GearSetupReminderInstance = gearSetupReminder; + + if(clientUpdate) { + clientUpdate.isUpdateAvailable().then(function(isUpdateAvailable) { + if (!isUpdateAvailable) { + // Check if the user has not set up their gear yet + JK.hasOneConfiguredDevice().then(function(hasOneConfiguredDevice){ + if (!hasOneConfiguredDevice) { + // Show the gear setup reminder dialog + GearSetupReminderInstance.show(); + } + }); + } + }); + } + var homeScreen = new JK.HomeScreen(JK.app); homeScreen.initialize();