Skip to content

Commit

Permalink
Merge pull request #297 from dreamfactorysoftware/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
daniilly committed Mar 3, 2023
2 parents 9569502 + e458765 commit b8065bf
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 31 deletions.
38 changes: 25 additions & 13 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,42 +140,54 @@
<script>
setTimeout(function(){

var _updateIntercom = function(userData) {
var host = $body.injector().get("$location").host();
const _updateIntercom = function (userData) {
const host = $body.injector().get("$location").host();

var intercomData = {
const intercomData = {
email: userData.email,
name: userData.name,
firstName: userData.first_name,
lastName: userData.last_name,
host: host,
}
};

window.Intercom('update', intercomData);
}
};

var $body = angular.element(document.body),
es = $body.injector().get("UserEventsService").login,
$rootScope = $body.scope().$root
const $body = angular.element(document.body);
const userEventsService = $body.injector().get("UserEventsService");
const $rootScope = $body.scope().$root;

// Handle a case when user has logged in and so update the widget with user data
$rootScope.$on(es.loginSuccess, function (e, userData) {
$rootScope.$on(userEventsService.login.loginSuccess, function (e, userData) {
_updateIntercom(userData);
});

// Handle a case when user is not logged in. Just show the widget
window.Intercom('boot', {
app_id: "ymvqkyiw",
// Handle a case when user has logged in and so update the widget with user data
$rootScope.$on(userEventsService.logout.logoutSuccess, function (e, userData) {
shutdownIntercom();
startIntercom();
});

// Handle a case when user is not logged in. Just show the widget
startIntercom();

// Handle a case when user is logged in and reloads the page
var currentUser = $body.injector().get("UserDataService").getCurrentUser();
const currentUser = $body.injector().get("UserDataService").getCurrentUser();
if (currentUser) {
_updateIntercom(currentUser);
}
}, 1000)

function shutdownIntercom() {
window.Intercom('shutdown');
}

function startIntercom() {
window.Intercom('boot', {
app_id: "ymvqkyiw",
});
}
</script>

<script>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ angular
})

// Set application version number
.constant('APP_VERSION', '4.14.1')
.constant('APP_VERSION', '5.0.0')

// Set global url for this application
.constant('INSTANCE_BASE_URL', '')
Expand Down
44 changes: 29 additions & 15 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,53 @@
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]--> <!-- Add your site or application content here --> <div id="dreamfactoryApp" data-ng-controller="MainCtrl" df-popup-login> <div id="popup-login-container"></div> <!-- Top level Nav --> <df-top-level-nav-std data-ng-if="showHeader" data-options="topLevelNavOptions"></df-top-level-nav-std> <df-license-expired-banner data-ng-if="showLicenseExpiredBanner"></df-license-expired-banner> <div data-ng-if="showAdminComponentNav" style="margin: 10px auto;" class="df-menu"> <!-- Component nav and title --> <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <div class="col-md-2 df-menu-container df-menu-icon"> <df-component-title></df-component-title> </div> <div class="col-md-10 df-menu-container second-nav-menu-items"> <df-component-nav data-options="componentNavOptions"></df-component-nav> </div> </div> </div> </div> </div> <!-- Rendering Context --> <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <div data-ng-view=""></div> </div> </div> </div> <!--<df-main-loading></df-main-loading>--> <div id="mask"></div> </div> <!--[if lt IE 9]>
<script src="scripts/oldieshim.d41d8cd9.js"></script>
<![endif]--> <script src="scripts/vendor.9e01592e.js"></script> <script src="scripts/app.a969cdda.js"></script> <!-- other deps --> <script src="vendor/ace/ace.js"></script> <script src="vendor/ace/mode-javascript.js"></script> <script src="vendor/ace/mode-json.js"></script> <script src="vendor/ace/mode-yaml.js"></script> <script> setTimeout(function(){
<![endif]--> <script src="scripts/vendor.b658ddac.js"></script> <script src="scripts/app.b36db56e.js"></script> <!-- other deps --> <script src="vendor/ace/ace.js"></script> <script src="vendor/ace/mode-javascript.js"></script> <script src="vendor/ace/mode-json.js"></script> <script src="vendor/ace/mode-yaml.js"></script> <script> setTimeout(function(){

var _updateIntercom = function(userData) {
var host = $body.injector().get("$location").host();
const _updateIntercom = function (userData) {
const host = $body.injector().get("$location").host();

var intercomData = {
const intercomData = {
email: userData.email,
name: userData.name,
firstName: userData.first_name,
lastName: userData.last_name,
host: host,
}
};

window.Intercom('update', intercomData);
}
};

var $body = angular.element(document.body),
es = $body.injector().get("UserEventsService").login,
$rootScope = $body.scope().$root
const $body = angular.element(document.body);
const userEventsService = $body.injector().get("UserEventsService");
const $rootScope = $body.scope().$root;

// Handle a case when user has logged in and so update the widget with user data
$rootScope.$on(es.loginSuccess, function (e, userData) {
$rootScope.$on(userEventsService.login.loginSuccess, function (e, userData) {
_updateIntercom(userData);
});

// Handle a case when user is not logged in. Just show the widget
window.Intercom('boot', {
app_id: "ymvqkyiw",
// Handle a case when user has logged in and so update the widget with user data
$rootScope.$on(userEventsService.logout.logoutSuccess, function (e, userData) {
shutdownIntercom();
startIntercom();
});

// Handle a case when user is not logged in. Just show the widget
startIntercom();

// Handle a case when user is logged in and reloads the page
var currentUser = $body.injector().get("UserDataService").getCurrentUser();
const currentUser = $body.injector().get("UserDataService").getCurrentUser();
if (currentUser) {
_updateIntercom(currentUser);
}
}, 1000) </script> <script> (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/ymvqkyiw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); </script> <script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
}, 1000)

function shutdownIntercom() {
window.Intercom('shutdown');
}

function startIntercom() {
window.Intercom('boot', {
app_id: "ymvqkyiw",
});
} </script> <script> (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/ymvqkyiw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); </script> <script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/scripts/vendor.9e01592e.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/scripts/vendor.b658ddac.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b8065bf

Please sign in to comment.