diff --git a/manywho_flow.zip b/manywho_flow.zip index b8fd2b1..37d4ce0 100644 Binary files a/manywho_flow.zip and b/manywho_flow.zip differ diff --git a/manywho_flow/js/manywho/init.js b/manywho_flow/js/manywho/init.js index d1c3668..59cf130 100644 --- a/manywho_flow/js/manywho/init.js +++ b/manywho_flow/js/manywho/init.js @@ -14,34 +14,68 @@ var manywho = { } }); + // Pass input values into the page if they have been provided + var inputValues = null; + + if ($('#manywho-lightning-settings').data('object-id') != null && + $('#manywho-lightning-settings').data('object-id').trim().length > 0) { + inputValues = []; + inputValues.push({ + 'developerName': 'SalesforceNotificationRecordId', + 'contentType': 'ContentString', + 'contentValue': $('#manywho-lightning-settings').data('object-id'), + }); + } + + if ($('#manywho-lightning-settings').data('object-name') != null && + $('#manywho-lightning-settings').data('object-name').trim().length > 0) { + if (inputValues == null) { + inputValues = []; + } + inputValues.push({ + 'developerName': 'SalesforceNotificationObjectName', + 'contentType': 'ContentString', + 'contentValue': $('#manywho-lightning-settings').data('object-name'), + }); + } + + var salesforceSessionId = null; + var salesforceSessionUrl = null; + + // Only send the session information if configured to do so + if (manywho.utils.isEqual('true', $('#manywho-lightning-settings').data('provide-session-info'), true)) { + salesforceSessionId = $('#manywho-lightning-settings').data('session-token'); + salesforceSessionUrl = $('#manywho-lightning-settings').data('session-url'); + } + var options = { authentication: { - sessionId: $('#manywho-lightning-settings').data('session-token'), - sessionUrl: $('#manywho-lightning-settings').data('session-url') + sessionId: salesforceSessionId, + sessionUrl: salesforceSessionUrl }, - navigationElementId: queryParameters['navigation-element-id'], + navigationElementId: $('#manywho-lightning-settings').data('navigation-element-id'), mode: $('#manywho-lightning-settings').data('mode'), reportingMode: $('#manywho-lightning-settings').data('reporting-mode'), replaceUrl: false, collaboration: { - isEnabled: true + isEnabled: manywho.utils.isEqual('true', $('#manywho-lightning-settings').data('collaboration-is-enabled'), true) }, - inputs: null, + inputs: inputValues, annotations: null, navigation: { - isFixed: false, - isWizard: false + isFixed: manywho.utils.isEqual('true', $('#manywho-lightning-settings').data('navigation-is-fixed'), true), + isWizard: manywho.utils.isEqual('true', $('#manywho-lightning-settings').data('navigation-is-wizard'), true) }, callbacks: [], - collapsible: false + collapsible: manywho.utils.isEqual('true', $('#manywho-lightning-settings').data('collapsible'), true) }; manywho.engine.initialize( $('#manywho-lightning-settings').data('tenant-id'), $('#manywho-lightning-settings').data('flow-id'), - queryParameters['flow-version-id'], + $('#manywho-lightning-settings').data('flow-version-id'), 'main', - queryParameters['join'], + $('#manywho-lightning-settings').data('join'), queryParameters['authorization'], options, queryParameters['initialization'] diff --git a/src/aura/ManyWhoFlow/ManyWhoFlow.cmp b/src/aura/ManyWhoFlow/ManyWhoFlow.cmp index 812c646..ba530a7 100644 --- a/src/aura/ManyWhoFlow/ManyWhoFlow.cmp +++ b/src/aura/ManyWhoFlow/ManyWhoFlow.cmp @@ -1,12 +1,60 @@ - - + - + + + + + + + + + + + + + +
+
+
+

+ +

+
+
+
- +
+
\ No newline at end of file diff --git a/src/aura/ManyWhoFlow/ManyWhoFlow.css b/src/aura/ManyWhoFlow/ManyWhoFlow.css index ac42af9..1a2f218 100644 --- a/src/aura/ManyWhoFlow/ManyWhoFlow.css +++ b/src/aura/ManyWhoFlow/ManyWhoFlow.css @@ -24,7 +24,7 @@ .THIS .mw-bs .wait-spinner { - content: url('/resource/manywho_flow/images/manywholightningwaitgif.gif'); + content: url('/sfsites/c/resource/manywho_flow/images/manywholightningwaitgif.gif'); display: block; position: relative; left: 50%; @@ -40,12 +40,12 @@ } .THIS .mw-bs .status > .wait-spinner { - content:url('/resource/manywho_flow/images/manywhogreentick.png') !important; + content:url('/sfsites/c/resource/manywho_flow/images/manywhogreentick.png') !important; } .THIS .mw-bs .wait-spinner-small { - content: url('/resource/manywho_flow/images/manywholightningwaitgif.gif'); + content: url('/sfsites/c/resource/manywho_flow/images/manywholightningwaitgif.gif'); width: 20px; height: 20px; margin:-10px 0 0 -10px @@ -58,10 +58,6 @@ text-align: center; } -.THIS .mw-bs { - margin-top: 10px !important; -} - .THIS .mw-bs .navbar { margin-bottom: 0px !important; } diff --git a/src/aura/ManyWhoFlow/ManyWhoFlow.design b/src/aura/ManyWhoFlow/ManyWhoFlow.design index 2530ea4..6fa81c3 100644 --- a/src/aura/ManyWhoFlow/ManyWhoFlow.design +++ b/src/aura/ManyWhoFlow/ManyWhoFlow.design @@ -1,4 +1,9 @@ - - + + + + + + + \ No newline at end of file diff --git a/src/aura/ManyWhoFlow/ManyWhoFlowController.js b/src/aura/ManyWhoFlow/ManyWhoFlowController.js index 6ce06c1..25c7639 100644 --- a/src/aura/ManyWhoFlow/ManyWhoFlowController.js +++ b/src/aura/ManyWhoFlow/ManyWhoFlowController.js @@ -1,44 +1,20 @@ ({ - sendMessage : function(component, event, helper) { - //var userAction = component.get("c.getUserInfo"); + doInit: function(cmp) { + //cmp.set("v.mode", "DEBUG"); + cmp.set("v.provideSessionInfo", false); - //userAction.setCallback(this, function(response){ - // var state = response.getState(); - - // if (state === "SUCCESS") { - // var userInfo = response.getReturnValue(); - var resourceUrl = $A.get('$Resource.manywho_flow'); - - //userInfo.sessionUrl - //userInfo.sessionId - var startInfo = { - tenantId: null, - flowId: null, - sessionId: null, - sessionUrl: null, - resourceUrl: resourceUrl - }; - - component.find("ManyWhoFlowApp").message(startInfo); - // } - //}); - + var userAction = cmp.get("c.getUserInfo"); + userAction.setCallback(this, function(response){ + var state = response.getState(); + if (state === "SUCCESS") { + cmp.set("v.userInfo", response.getReturnValue()); + } + }); + $A.enqueueAction(userAction); - }, + }, - handleMessage: function(component, message, helper) { - /*var payload = message.payload; - var name = payload.name; - - if (name === "General") { - var value = payload.value; - component.set("v.messageReceived", value); - } else if (name === "Foo") { - // A different response - }*/ - }, - - handleError: function(component, error, helper) { - var e = error; - } -}) \ No newline at end of file + afterScriptsLoaded : function(cmp, event, helper) { + manywho.initialize(); + } + }) \ No newline at end of file diff --git a/src/classes/ManyWhoAPI.cls-meta.xml b/src/classes/ManyWhoAPI.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoAPI.cls-meta.xml +++ b/src/classes/ManyWhoAPI.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/classes/ManyWhoAPI_Tests.cls-meta.xml b/src/classes/ManyWhoAPI_Tests.cls-meta.xml index 4935896..8b061c8 100644 --- a/src/classes/ManyWhoAPI_Tests.cls-meta.xml +++ b/src/classes/ManyWhoAPI_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 37.0 + 39.0 Active diff --git a/src/classes/ManyWhoCurrentUserController.cls b/src/classes/ManyWhoCurrentUserController.cls index e859399..336db30 100644 --- a/src/classes/ManyWhoCurrentUserController.cls +++ b/src/classes/ManyWhoCurrentUserController.cls @@ -2,9 +2,17 @@ public with sharing class ManyWhoCurrentUserController { @AuraEnabled public static ManyWhoUserInfo getUserInfo() { + // Get the tenant id from custom settings + String manywhoTenantId = null; + ManyWho__c customSetting = ManyWho__c.getInstance('Default'); + if (customSetting != null) { + manywhoTenantId = customSetting.Tenant_Id__c; + } + ManyWhoUserInfo manywhoUserInfo = new ManyWhoUserInfo( userinfo.getSessionId(), - '/services/Soap/u/26.0/' + userInfo.getOrganizationId(), + System.URL.getSalesforceBaseURL().toExternalForm() + '/services/Soap/u/26.0/' + userInfo.getOrganizationId(), + manywhoTenantId, userinfo.getUserId() ); @@ -29,5 +37,4 @@ public with sharing class ManyWhoCurrentUserController { return stateId; } - } \ No newline at end of file diff --git a/src/classes/ManyWhoCurrentUserController.cls-meta.xml b/src/classes/ManyWhoCurrentUserController.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoCurrentUserController.cls-meta.xml +++ b/src/classes/ManyWhoCurrentUserController.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/classes/ManyWhoFlowController.cls-meta.xml b/src/classes/ManyWhoFlowController.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoFlowController.cls-meta.xml +++ b/src/classes/ManyWhoFlowController.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/classes/ManyWhoFlowController_Tests.cls-meta.xml b/src/classes/ManyWhoFlowController_Tests.cls-meta.xml index 4935896..8b061c8 100644 --- a/src/classes/ManyWhoFlowController_Tests.cls-meta.xml +++ b/src/classes/ManyWhoFlowController_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 37.0 + 39.0 Active diff --git a/src/classes/ManyWhoHttp.cls-meta.xml b/src/classes/ManyWhoHttp.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoHttp.cls-meta.xml +++ b/src/classes/ManyWhoHttp.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/classes/ManyWhoHttpMock.cls-meta.xml b/src/classes/ManyWhoHttpMock.cls-meta.xml index 4935896..8b061c8 100644 --- a/src/classes/ManyWhoHttpMock.cls-meta.xml +++ b/src/classes/ManyWhoHttpMock.cls-meta.xml @@ -1,5 +1,5 @@ - 37.0 + 39.0 Active diff --git a/src/classes/ManyWhoHttp_Tests.cls-meta.xml b/src/classes/ManyWhoHttp_Tests.cls-meta.xml index 4935896..8b061c8 100644 --- a/src/classes/ManyWhoHttp_Tests.cls-meta.xml +++ b/src/classes/ManyWhoHttp_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 37.0 + 39.0 Active diff --git a/src/classes/ManyWhoObjectUtils.cls-meta.xml b/src/classes/ManyWhoObjectUtils.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoObjectUtils.cls-meta.xml +++ b/src/classes/ManyWhoObjectUtils.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/classes/ManyWhoObjectUtils_Tests.cls-meta.xml b/src/classes/ManyWhoObjectUtils_Tests.cls-meta.xml index 4935896..8b061c8 100644 --- a/src/classes/ManyWhoObjectUtils_Tests.cls-meta.xml +++ b/src/classes/ManyWhoObjectUtils_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 37.0 + 39.0 Active diff --git a/src/classes/ManyWhoReportingService.cls-meta.xml b/src/classes/ManyWhoReportingService.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoReportingService.cls-meta.xml +++ b/src/classes/ManyWhoReportingService.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/classes/ManyWhoUserInfo.cls b/src/classes/ManyWhoUserInfo.cls index 3b99c64..059608f 100644 --- a/src/classes/ManyWhoUserInfo.cls +++ b/src/classes/ManyWhoUserInfo.cls @@ -1,7 +1,8 @@ public class ManyWhoUserInfo { - public ManyWhoUserInfo(String sessionId, String sessionUrl, String userId) { + public ManyWhoUserInfo(String sessionId, String sessionUrl, String tenantId, String userId) { this.sessionId = sessionId; this.sessionUrl = sessionUrl; + this.tenantId = tenantId; this.userId = userId; } @@ -10,6 +11,9 @@ public class ManyWhoUserInfo { @AuraEnabled public String sessionUrl { get; set; } + + @AuraEnabled + public String tenantId { get; set; } @AuraEnabled public String userId { get; set; } diff --git a/src/classes/ManyWhoUserInfo.cls-meta.xml b/src/classes/ManyWhoUserInfo.cls-meta.xml index 38aa015..8b061c8 100644 --- a/src/classes/ManyWhoUserInfo.cls-meta.xml +++ b/src/classes/ManyWhoUserInfo.cls-meta.xml @@ -1,5 +1,5 @@ - 36.0 + 39.0 Active diff --git a/src/package.xml b/src/package.xml index f0e34bb..e44614b 100644 --- a/src/package.xml +++ b/src/package.xml @@ -4,15 +4,20 @@ ManyWhoAPI ManyWhoAPI_Tests ManyWhoCurrentUserController + ManyWhoCurrentUserController_Tests ManyWhoFlowController ManyWhoFlowController_Tests ManyWhoHttp ManyWhoHttpMock + ManyWhoHttpMock_Tests ManyWhoHttp_Tests ManyWhoObjectUtils ManyWhoObjectUtils_Tests ManyWhoReportingService + ManyWhoReportingService_Tests + ManyWhoRun ManyWhoUserInfo + ManyWhoUserInfo_Tests ApexClass @@ -20,19 +25,15 @@ ApexPage - Salesforce1 - AppMenu - - - ManyWhoFlow - AuraDefinitionBundle + ManyWho + CustomApplication - * + ManyWhoFlow__c CustomObject - ManyWho_Flow + * CustomTab @@ -45,9 +46,5 @@ manywho_flow StaticResource - - Security - Settings - 36.0 diff --git a/src/pages/flow.page-meta.xml b/src/pages/flow.page-meta.xml index dfd6ae8..be46ab3 100644 --- a/src/pages/flow.page-meta.xml +++ b/src/pages/flow.page-meta.xml @@ -1,6 +1,6 @@ - 36.0 + 39.0 true false diff --git a/src/settings/Security.settings b/src/settings/Security.settings index fbbabb4..69bbcf0 100644 --- a/src/settings/Security.settings +++ b/src/settings/Security.settings @@ -17,34 +17,4 @@ 54.84.53.201 - - AlphaNumeric - NinetyDays - 3 - FifteenMinutes - TenAttempts - 8 - false - false - DoesNotContainPassword - - - false - true - true - true - true - true - false - false - true - false - false - false - false - false - true - false - true -