Skip to content

Commit

Permalink
Merge pull request #1979 from SalesforceFoundation/feature/244
Browse files Browse the repository at this point in the history
Release 244
  • Loading branch information
jcschultz authored Apr 24, 2023
2 parents e8efcfe + 76aea2a commit 6bb25a9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ Make sure `yarn` is installed on your local machine. For more information, check
The Education Data Architecture technology (“EDA”) is an open-source package licensed by Salesforce.org (“SFDO”) under the BSD-3 Clause License, found at https://opensource.org/licenses/BSD-3-Clause. ANY MASTER SUBSCRIPTION AGREEMENT YOU OR YOUR ENTITY MAY HAVE WITH SFDO DOES NOT APPLY TO YOUR USE OF EDA. EDA IS PROVIDED “AS IS” AND AS AVAILABLE, AND SFDO MAKES NO WARRANTY OF ANY KIND REGARDING EDA, WHETHER EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, FREEDOM FROM DEFECTS OR NON-INFRINGEMENT, TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
SFDO WILL HAVE NO LIABILITY ARISING OUT OF OR RELATED TO YOUR USE OF EDA FOR ANY DIRECT DAMAGES OR FOR ANY LOST PROFITS, REVENUES, GOODWILL OR INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, COVER, BUSINESS INTERRUPTION OR PUNITIVE DAMAGES, WHETHER AN ACTION IS IN CONTRACT OR TORT AND REGARDLESS OF THE THEORY OF LIABILITY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF A REMEDY OTHERWISE FAILS OF ITS ESSENTIAL PURPOSE. THE FOREGOING DISCLAIMER WILL NOT APPLY TO THE EXTENT PROHIBITED BY LAW. SFDO DISCLAIMS ALL LIABILITY AND INDEMNIFICATION OBLIGATIONS FOR ANY HARM OR DAMAGES CAUSED BY ANY THIRD-PARTY HOSTING PROVIDERS.

(Release 242)
(Release 244)
2 changes: 1 addition & 1 deletion cumulusci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ tasks:
description: "Create a user with no access to Education Cloud components"
class_path: cumulusci.tasks.sfdx.SFDXOrgTask
options:
command: "force:user:create -a no_access --definitionfile datasets/dev/users/user-def_no-access.json"
command: "force:user:create -a no_access --definitionfile datasets/dev_data/users/user-def_no-access.json"

create_tenant_secret:
group: "EDA: Shield Platform Encryption"
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions force-app/main/default/classes/STG_Base_CTRL.cls
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public with sharing class STG_Base_CTRL {
return UTIL_CustomSettingsFacade.getAutoCreateSettings();
}

@AuraEnabled
public static String getNamespace() {
return UTIL_Namespace.getNamespace();
}

/*******************************************************************************************************
* @description Saves the Hierarchy Settings passed from the client.
* @param hierarchySettings The Hierarchy_Settings__c record to upsert.
Expand Down
10 changes: 10 additions & 0 deletions force-app/main/default/classes/STG_Base_CTRL_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,14 @@ private class STG_Base_CTRL_TEST {
Id apexJobId = STG_Base_CTRL.executeRefreshAdminAccountBatch();
System.assertNotEquals(null, apexJobId);
}

/*********************************************************************************************************
* @description Tests the namespace retrieval
*/
@isTest
private static void testNamespace() {
String[] parts = String.valueOf(STG_Base_CTRL.class).split('\\.', 2);
String testNamespace = parts.size() == 2 ? parts[0] : '';
Assert.areEqual(testNamespace, STG_Base_CTRL.getNamespace());
}
}
21 changes: 6 additions & 15 deletions force-app/main/default/pages/STG_Settings.page
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
<apex:page title="{!$Label.stgTitleHEDASettings}" showHeader="true" standardStylesheets="false" applyBodyTag="false" docType="html-5.0" controller="STG_Base_CTRL">
<script src="/soap/ajax/48.0/connection.js" type="text/javascript"></script>
<script src="/soap/ajax/48.0/apex.js" type="text/javascript"></script>
<script src="/lightning/lightning.out.js" type="text/javascript"></script>

<div class="slds">
<!-- layout=block makes the outputPanel produce a DIV -->
<apex:outputPanel layout="block" id="stgContainer"></apex:outputPanel>
</div>
</div>

<script>
//Because sometimes the session ID is not set correctly
sforce.connection.sessionId = "{!$Api.Session_ID}";

// We dont know the ID (because visualforce) so were gonna use a CSS selector to get it
var stgContainerId = document.querySelector('[id$="stgContainer"]').id;

var namespace = '';
var namespace = '{!namespace}';
var namespacePrefix = '';
//This should be a class unique to EDA so the namespace comes through correctly
var gettingnamespace = sforce.connection.query("SELECT NamespacePrefix FROM ApexClass where Name = 'STG_Base_CTRL' LIMIT 1");
var getname = gettingnamespace.getArray("records");
if(getname.length > 0) {
namespace = getname[0].NamespacePrefix;
if(namespace && namespace.length > 0) {
namespacePrefix = namespace + '__';
}

if(namespace && namespace.length > 0) {
namespacePrefix = namespace + '__';
}

if(!namespace || namespace.length === 0) {
namespace = "c";
}
Expand Down

0 comments on commit 6bb25a9

Please sign in to comment.