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 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 @@ +
+ + +
+ <%= image_tag("content/icon_alert.png", :height => '24', :width => '24', :class => "content-icon") %>

alert

+
+ +
+ +
+

+ Now that you've installed the JamKazam app, the next thing you should do is set up your audio gear and your Ethernet connection. +

+
+

+ If you already have an audio interface and the ability to connect your computer to your home router using an Ethernet cable, you are ready to set up your gear. + You can find all of our gear setup articles here. We recommend you use our articles on setting up your audio interface for Mac or for Windows to make sure you get this critical step done properly, and that you use our article on connecting your computer via Ethernet, which is the other critical setup step. +

+
+

+ If you're not sure what gear you need, we recommend you start by reading this article that explains this topic in general terms. Next, check this list of articles to find the one that best describes you. You need to use an audio interface rather than relying on the built-in mic on your computer, and you need to connect your computer to your internet router using an Ethernet cable rather than using WiFi. See this list of articles for recommendations on gear. If you're worried about spending money on gear without knowing how well JamKazam will work for you, you can buy gear on Amazon, try it for a week, and return it for a refund if you're not happy for a risk-free trail experience. +

+
+

+ If you have any trouble or feel confused about gear setup, you can email us for help at support@jamkazam.com. You can also visit with a JamKazam support team member in our weekly Zoom office hours, which is offered every Wedsnesday from 11am to 12pm US Central Time. +

+
+

+ If you're ready know to set up your audio gear, click the Set Up Gear button below. If you want to skip this step for now, click the Not Now button. +

+
+
+
+ +
+ +
+ +
\ 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();