apiCalls: function(crmApi){
var reqs = {};
reqs.cxns = ['Cxn', 'get', {sequential: 1}];
- reqs.appMetas = ['CxnApp', 'get', {sequential: 1, return: ['id', 'title', 'desc', 'appId', 'appUrl', 'perm']}];
+ reqs.appMetas = ['CxnApp', 'get', {sequential: 1, return: ['id', 'title', 'desc', 'appId', 'appUrl', 'links', 'perm']}];
reqs.cfg = ['Cxn', 'getcfg', {}];
reqs.sysCheck = ['System', 'check', {}]; // FIXME: filter on checkCxnOverrides
return crmApi(reqs);
};
$scope.register = function(appMeta) {
- var reg = crmApi('Cxn', 'register', {app_guid: appMeta.appId}).then($scope.refreshCxns);
+ var reg = crmApi('Cxn', 'register', {app_guid: appMeta.appId}).then($scope.refreshCxns).then(function() {
+ if (appMeta.links.welcome) {
+ return $scope.openLink(appMeta, 'welcome', {title: ts('%1: Welcome (External)', {1: appMeta.title})});
+ }
+ });
return block(crmStatus({start: ts('Connecting...'), success: ts('Connected')}, reg));
};
$scope.reregister = function(appMeta) {
- var reg = crmApi('Cxn', 'register', {app_guid: appMeta.appId}).then($scope.refreshCxns);
+ var reg = crmApi('Cxn', 'register', {app_guid: appMeta.appId}).then($scope.refreshCxns).then(function() {
+ if (appMeta.links.welcome) {
+ return $scope.openLink(appMeta, 'welcome', {title: ts('%1: Welcome (External)', {1: appMeta.title})});
+ }
+ });
return block(crmStatus({start: ts('Reconnecting...'), success: ts('Reconnected')}, reg));
};