Sorry, but the page you were trying to view does not exist.
142 |
It looks like this was the result of either:
143 |
144 |
a mistyped address
145 |
an out-of-date link
146 |
147 |
150 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/client/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/favicon.ico
--------------------------------------------------------------------------------
/client/app/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/favicon.ico
--------------------------------------------------------------------------------
/client/app/images/iora.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/iora.png
--------------------------------------------------------------------------------
/client/app/images/iora_lite_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/iora_lite_text.png
--------------------------------------------------------------------------------
/client/app/images/iora_lite_text_v2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/iora_lite_text_v2.png
--------------------------------------------------------------------------------
/client/app/images/iora_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/iora_logo.png
--------------------------------------------------------------------------------
/client/app/images/pie.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/pie.gif
--------------------------------------------------------------------------------
/client/app/images/yeoman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/forcedotcom/IoraLite/8c4c405f29d75a861559aedd37230dce583675d9/client/app/images/yeoman.png
--------------------------------------------------------------------------------
/client/app/js/sb-admin-2.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 |
3 | $('#side-menu').metisMenu();
4 |
5 | });
6 |
7 | //Loads the correct sidebar on window load,
8 | //collapses the sidebar on window resize.
9 | // Sets the min-height of #page-wrapper to window size
10 | $(function() {
11 | $(window).bind("load resize", function() {
12 | topOffset = 50;
13 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
14 | if (width < 768) {
15 | $('div.navbar-collapse').addClass('collapse');
16 | topOffset = 100; // 2-row-menu
17 | } else {
18 | $('div.navbar-collapse').removeClass('collapse');
19 | }
20 |
21 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
22 | height = height - topOffset;
23 | if (height < 1) height = 1;
24 | if (height > topOffset) {
25 | $("#page-wrapper").css("min-height", (height) + "px");
26 | }
27 | });
28 |
29 | var url = window.location;
30 | var element = $('ul.nav a').filter(function() {
31 | return this.href === url || url.href.indexOf(this.href) === 0;
32 | }).addClass('active').parent().parent().addClass('in').parent();
33 | if (element.is('li')) {
34 | element.addClass('active');
35 | }
36 | });
37 |
--------------------------------------------------------------------------------
/client/app/robots.txt:
--------------------------------------------------------------------------------
1 | # robotstxt.org
2 |
3 | User-agent: *
4 | Disallow:
5 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_errors.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraErrorsCtrl
37 | * @description
38 | * # IoraErrorsCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .controller('IoraErrorsCtrl', function($scope, $localStorage, $location, $timeout, ioraReportFactory, ioraDashboardFactory, userInfoFactory, ioraInitFactory) {
43 | ioraInitFactory.pageLoad($scope);
44 |
45 | $timeout(function() {
46 | updateErrorsPage($scope.ioraReportRest.reportErrors, $scope.ioraDashboardRest.dashErrors, $scope.ioraReportRest.reportPerfErrors);
47 | }, 1000);
48 | });
49 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_main.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraErrorsCtrl
37 | * @description
38 | * # IoraErrorsCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .controller('IoraMainCtrl', function($scope, $cookies,$localStorage,$timeout,ioraReportFactory, ioraDashboardFactory,userInfoFactory) {
43 |
44 | // Retrieving a cookie
45 | var favoriteCookies = $cookies.getAll();
46 |
47 | });
48 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_no_org_context.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraNoOrgContextCtrl
37 | * @description
38 | * # IoraNoOrgContextCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .controller('IoraNoOrgContextCtrl', function ($scope,$location,ioraServicesFactory) {
43 | ioraServicesFactory.defineGoButtonAction($scope,$location);
44 | });
45 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_org.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraOrgCtrl
37 | * @description
38 | * # IoraOrgCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .controller('IoraOrgCtrl', function($scope, $location,$window,$localStorage,ioraReportFactory, ioraDashboardFactory,userInfoFactory,ioraInitFactory,orgOverviewChartFactory,chartSelectionFactory) {
43 |
44 |
45 | $scope.$storage=$localStorage;
46 |
47 | ioraInitFactory.pageLoad($scope);
48 |
49 | $scope.noOfReports=$scope.ioraReportRest.reportDetails.length;
50 | $scope.noOfDashboards=$scope.ioraDashboardRest.dashDetails.length;
51 |
52 | $scope.options=orgOverviewChartFactory.defineChartOptions($scope);
53 |
54 | $scope.designOverviewdata=orgOverviewChartFactory.plotDesignChart($scope.reportStats,$scope.dashboardStats);
55 |
56 | $scope.scalabilityOverviewdata=orgOverviewChartFactory.plotScalabilityChart($scope.reportStats,$scope.dashboardStats);
57 |
58 | $scope.$on('target-redirect',function(event,chartFilter,entity){
59 | chartSelectionFactory.set(chartFilter);
60 | $scope.$storage.chartFilter=chartFilter;
61 | if('Reports' === entity){
62 | $window.location.href='./Iora_Targets?target=reports';
63 | }
64 | else if('Dashboards' === entity){
65 | $window.location.href='./Iora_Targets?target=dashboards';
66 | }
67 |
68 |
69 | });
70 |
71 |
72 | });
73 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_org_prepare.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraOrgPrepareCtrl
37 | * @description
38 | * # IoraOrgPrepareCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 |
42 | angular.module('ioraliteAngularApp')
43 | .controller('IoraOrgPrepareCtrl', function($q,$scope, $filter, $location, $localStorage, $http, $timeout, blockUI, aboutMeFactory, ioraServicesFactory, ioraReportFactory, userInfoFactory, ioraDashboardFactory, httpReqFactory, ioraGateKeeperFactory, reportAggFactory, dashboardAggFactory,ioraOrgPrepFactory) {
44 |
45 | var apiVer = '36.0';
46 |
47 |
48 | //set the session storage for caching the API results
49 | $scope.$storage = $localStorage;
50 |
51 | //set the selective flag selected by user quick scan flag in the UI.
52 | var isSelective=!($scope.$storage.quickScan);
53 |
54 | if ($scope.$storage.version !== null && $scope.$storage.version !== undefined && $scope.$storage.version.length > 0) {
55 | apiVer = $scope.$storage.version;
56 | }
57 |
58 | $scope.offset = 0;
59 | $scope.timerCurrent = 0;
60 | $scope.uploadCurrent = 0;
61 | $scope.stroke = 15;
62 | $scope.radius = 125;
63 | $scope.isSemi = false;
64 | $scope.rounded = false;
65 | $scope.responsive = false;
66 | $scope.clockwise = true;
67 | $scope.currentColor = '#45ccce';
68 | $scope.bgColor = '#eaeaea';
69 | $scope.duration = 800;
70 | $scope.currentAnimation = 'easeOutCubic';
71 | $scope.animationDelay = 0;
72 |
73 |
74 | $scope.getStyle = function() {
75 | var transform = ($scope.isSemi ? '' : 'translateY(-50%) ') + 'translateX(-50%)';
76 |
77 | return {
78 | 'top': $scope.isSemi ? 'auto' : '50%',
79 | 'bottom': $scope.isSemi ? '5%' : 'auto',
80 | 'left': '50%',
81 | 'transform': transform,
82 | '-moz-transform': transform,
83 | '-webkit-transform': transform,
84 | 'font-size': $scope.radius / 3.5 + 'px'
85 | };
86 | };
87 |
88 | $scope.getColor = function() {
89 | return $scope.gradient ? 'url(#gradient)' : $scope.currentColor;
90 | };
91 |
92 | ioraOrgPrepFactory.ioraOrgPrepare($q,$scope,$location,$localStorage,apiVer,isSelective);
93 |
94 | });
95 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_page_not_found.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraPageNotFoundCtrl
37 | * @description
38 | * # IoraPageNotFoundCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 |
42 | angular.module('ioraliteAngularApp')
43 | .controller('IoraPageNotFoundCtrl', function($scope, $filter,$location,$localStorage,ioraInitFactory,blockUI,$timeout) {
44 | var queryParams=$location.search();
45 |
46 | ioraInitFactory.pageLoad($scope);
47 |
48 | $scope.targetType=queryParams.type;
49 |
50 | var errorObj={};
51 |
52 | var errorMessage="";
53 |
54 |
55 | if(queryParams.type!==null && queryParams.type!==undefined && queryParams.type==='Report'){
56 | errorObj = $filter('filter')($scope.ioraReportRest.reportErrors, {
57 | $: queryParams.target
58 | })[0];
59 | if(errorObj!==null && errorObj!==undefined){
60 | errorMessage=errorObj.errorInfo.errorMessage;
61 | }
62 |
63 | }
64 | else{
65 |
66 | errorObj = $filter('filter')($scope.ioraDashboardRest.dashErrors, {
67 | $: queryParams.target
68 | })[0];
69 | if(errorObj!==null && errorObj!==undefined){
70 | errorMessage=errorObj.errorMessage;
71 | }
72 |
73 | }
74 |
75 |
76 | $scope.searchErrorMsgs= errorMessage;
77 | $scope.searchErrors=true;
78 | $scope.divStyle={
79 | "display" : "block",
80 | "position" : "relative"
81 | };
82 | blockUI.stop();
83 |
84 | });
85 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_unpermitted_org.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraUnpermittedOrgCtrl
37 | * @description
38 | * # IoraUnpermittedOrgCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .controller('IoraUnpermittedOrgCtrl', function ($scope,$location,ioraServicesFactory,ioraGateKeeperFactory) {
43 | $scope.unauthorizedOrgErrorMessage=ioraGateKeeperFactory.get();
44 | ioraServicesFactory.defineGoButtonAction($scope,$location);
45 | });
46 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/iora_warning.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:IoraErrorsCtrl
37 | * @description
38 | * # IoraErrorsCtrl
39 | * Controller of the ioraliteAngularApp
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .controller('IoraWarningCtrl', function($scope, _, $timeout, ioraServicesFactory, ioraInitFactory) {
43 |
44 |
45 | ioraInitFactory.pageLoad($scope);
46 | $scope.scopeGroups = {};
47 | $scope.scopeFilter = {
48 | selectedValue: ""
49 | };
50 | $scope.allScopeFilter = {
51 | selectedValue: ""
52 | };
53 | var genericScopeUpdate=function($scope,wideScopeSelection,privateScopeSelection,tableId,scopeType){
54 | ioraServicesFactory.updateTotalWarningCount($scope,wideScopeSelection,privateScopeSelection);
55 | if('private scope' === scopeType)
56 | updateScopeSection(privateScopeSelection,tableId,scopeType);
57 | else
58 | updateScopeSection(wideScopeSelection,tableId,scopeType);
59 | }
60 | $scope.updateScopeTable = function() {
61 | genericScopeUpdate($scope,$scope.scopeGroups[$scope.allScopeFilter.selectedValue],$scope.scopeGroups[$scope.scopeFilter.selectedValue],'#table-scope-warnings','private scope')
62 | };
63 | $scope.updateAllScopeTable = function() {
64 | //update warning count
65 | genericScopeUpdate($scope,$scope.scopeGroups[$scope.allScopeFilter.selectedValue],$scope.scopeGroups[$scope.scopeFilter.selectedValue],'#table-all-scope-warnings','wide scope')
66 | };
67 |
68 | $timeout(function() {
69 |
70 | updatewarningspage($scope.ioraReportRest.reportsWithZeroRecs, []);
71 | ioraServicesFactory.loadReportScopeData($scope);
72 | updateScopeSection($scope.scopeGroups[$scope.privateScopes[0]],'#table-scope-warnings','private scope');
73 | updateScopeSection($scope.scopeGroups[$scope.allScopes[0]],'#table-all-scope-warnings','wide scope');
74 | ioraServicesFactory.updateTotalWarningCount($scope);
75 | }, 1000);
76 |
77 | });
78 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/oauthRedirect.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc function
36 | * @name ioraliteAngularApp.controller:OauthredirectCtrl
37 | * @description
38 | * # OauthredirectCtrl
39 | * Controller of the ioraliteAngularApp
40 | *
41 | */
42 | angular.module('ioraliteAngularApp')
43 | .controller('OauthredirectCtrl', function( $scope, $filter,$location, $localStorage,ioraServicesFactory) {
44 |
45 | //set the session storage for caching the API results
46 | $scope.$storage=$localStorage;
47 |
48 | var url = $location.url();
49 |
50 | ioraServicesFactory.fixhashinURL(url,$location);
51 |
52 | var searchObject = $location.search();
53 |
54 | //Check the scan selection and redirect appropriately
55 | /*if($scope.$storage.quickScan===null || $scope.$storage.quickScan===undefined || $scope.$storage.quickScan){
56 | // $location.url('./Iora_Org_Quick_Prepare' + '?' + $location.hash());
57 | url='/Iora_Org_Quick_Prepare' + '?access_token=' + searchObject.access_token + '&instance_url=' + searchObject.instance_url;
58 | }
59 | else{*/
60 | // $location.url('./Iora_Org_Prepare' + '?' + $location.hash());
61 | url='/Iora_Org_Prepare?access_token=' + searchObject.access_token + '&instance_url=' + searchObject.instance_url;
62 | //}
63 |
64 | $location.url(url);
65 |
66 | $location.replace();
67 |
68 | }); // end of function call
69 |
--------------------------------------------------------------------------------
/client/app/scripts/controllers/test.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /**
4 | * @ngdoc function
5 | * @name ioraliteAngularApp.controller:TestCtrl
6 | * @description
7 | * # TestCtrl
8 | * Controller of the ioraliteAngularApp
9 | */
10 | angular.module('ioraliteAngularApp')
11 | .controller('TestCtrl', function ($scope,$http,httpReqFactory,$q,$location,$localStorage) {
12 | $scope.$storage=$localStorage;
13 |
14 | var params={};
15 |
16 | var addlnReqParamsMap=[];
17 |
18 | params.access_token= $scope.$storage.access_token;
19 | params.instance_url=$scope.$storage.instance_url;
20 | addlnReqParamsMap.apiVer=$scope.$storage.version
21 |
22 | var reportsToBeFetched = [];
23 |
24 | var rptScorePromises=[];
25 |
26 | var reportHeathScores = [];
27 |
28 | var reportHealthErrors=[];
29 |
30 | httpReqFactory.promisifyReq($http, '/fetchPossibleCandidates', params, addlnReqParamsMap).then(function(candidates) {
31 | angular.forEach(candidates,function(candidate){
32 | reportsToBeFetched.push(candidate.Id);
33 | });
34 |
35 | for (var reportIndex = 0; reportIndex < reportsToBeFetched.length; reportIndex += 25) {
36 |
37 | var reportsubset = reportsToBeFetched.slice(reportIndex, reportIndex + 25);
38 | addlnReqParamsMap = [];
39 |
40 | //construct the request data
41 | addlnReqParamsMap.reportIds = reportsubset.toString();
42 | addlnReqParamsMap.apiVer = $scope.$storage.version;
43 | addlnReqParamsMap.chunkSize = '25';
44 |
45 | rptScorePromises.push(httpReqFactory.promisifyReq($http, '/reportsPerf', params, addlnReqParamsMap));
46 |
47 |
48 | //make the api call to fetch the dashboard describe. Needed to understand the dashboard components
49 | httpReqFactory.promisifyReq($http, '/reportsPerf', params, addlnReqParamsMap).then(function(perfHealthScores) {
50 | angular.forEach(perfHealthScores,function(perfHealthScore){
51 |
52 | if(perfHealthScore.statusCode === 200){
53 | reportHeathScores.push(perfHealthScore);
54 | }
55 | else{
56 | reportHealthErrors.push(perfHealthScore);
57 | }
58 |
59 | });
60 | var totalFetched=reportHealthErrors.length + reportHeathScores.length;
61 |
62 |
63 | });
64 | }
65 |
66 | });
67 |
68 |
69 | });
70 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/bootstrap_switch/bootstrap-switch.min.css:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * bootstrap-switch - v3.3.2
3 | * http://www.bootstrap-switch.org
4 | * ========================================================================
5 | * Copyright 2012-2013 Mattia Larentis
6 | *
7 | * ========================================================================
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | * ========================================================================
20 | */
21 |
22 | .bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:4px;border:1px solid #ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:4px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:inline-block!important;height:100%;padding:6px 12px;font-size:14px;line-height:20px}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on{text-align:center;z-index:1}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary{color:#fff;background:#337ab7}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info{color:#fff;background:#5bc0de}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success{color:#fff;background:#5cb85c}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning{background:#f0ad4e;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger{color:#fff;background:#d9534f}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default{color:#000;background:#eee}.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;color:#333;background:#fff}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch input[type=radio],.bootstrap-switch input[type=checkbox]{position:absolute!important;top:0;left:0;margin:0;z-index:-1;opacity:0;filter:alpha(opacity=0)}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:5px 10px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:6px 16px;font-size:18px;line-height:1.3333333}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-indeterminate,.bootstrap-switch.bootstrap-switch-readonly{cursor:default!important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label{opacity:.5;filter:alpha(opacity=50);cursor:default!important}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left .5s;-o-transition:margin-left .5s;transition:margin-left .5s}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on{border-radius:0 3px 3px 0}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off{border-radius:3px 0 0 3px}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px}
23 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/bootstrap_switch/switch-directive.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright (c) 2017, Salesforce.com, Inc.
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
17 | * be used to endorse or promote products derived from this software without
18 | * specific prior written permission.
19 | *
20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 | * POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | 'use strict';
34 |
35 | /**
36 | * @ngdoc directive
37 | * @name ioraliteAngularApp.directive:bootstrapSwitch
38 | * @description
39 | * # bootstrapSwitch.
40 | */
41 | angular.module('ioraliteAngularApp')
42 | .directive('bootstrapSwitch', [
43 | function() {
44 | return {
45 | restrict: 'A',
46 | require: '?ngModel',
47 | link: function(scope, element, attrs, ngModel) {
48 | element.bootstrapSwitch();
49 |
50 | element.on('switchChange.bootstrapSwitch', function(event, state) {
51 | if (ngModel) {
52 | scope.$apply(function() {
53 | ngModel.$setViewValue(state);
54 | });
55 | }
56 | });
57 |
58 | scope.$watch(attrs.ngModel, function(newValue, oldValue) {
59 | if (newValue) {
60 | element.bootstrapSwitch('state', true, true);
61 | } else {
62 | element.bootstrapSwitch('state', false, true);
63 | }
64 | });
65 | }
66 | };
67 | }
68 | ]);
69 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/errors/error.html:
--------------------------------------------------------------------------------
1 |
31 |
32 |
Displays the issues or concerns in fetching the requested report entities from the org..
62 |
63 |
64 |
65 |
66 |
Salesforce ID
67 |
Error Code
68 |
Error Message
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
97 |
98 |
99 |
100 |
101 |
102 |
Dashboard Errors
103 |
Displays the issues or concerns in fetching the requested dashboard entities from the org.
104 |
105 |
106 |
107 |
108 |
Salesforce ID
109 |
Error Code
110 |
Error Message
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/errors/error.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('ioraerrors',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/errors/error.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/errors/invalidlogin.html:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
Authentication Error
37 |
38 |
39 |
{{loginErrorMsgs}}
40 |
41 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
54 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/errors/invalidlogin.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('iorainvalidlogin',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/errors/invalidlogin.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/errors/pagenotfound.html:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
Could not fetch {{targetType}}
37 |
38 |
39 |
{{searchErrorMsgs}}
40 |
41 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/errors/pagenotfound.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('iorapagenotfound',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/errors/pagenotfound.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/header/header.html:
--------------------------------------------------------------------------------
1 |
31 |
140 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/header/header.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('ioraheader',function(){
42 | return {
43 | templateUrl:'scripts/directives/header/header.html'
44 | }
45 | });
46 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/lzstring/lzstring.min.js:
--------------------------------------------------------------------------------
1 | var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;ne;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;ie;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);
2 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/progress_chart/progress.css:
--------------------------------------------------------------------------------
1 |
106 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/target/target.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('ioratargetpagewrapper',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/target/target.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/targets/targets.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('ioratargetspagewrapper',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/targets/targets.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/termsofservice/terms.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('ioratermsofservice',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/termsofservice/terms.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/directives/warnings/warning.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | /**
35 | * @ngdoc directive
36 | * @name ioraliteAngularApp.directive:navigation_template
37 | * @description
38 | * # navigation_template
39 | */
40 | angular.module('ioraliteAngularApp')
41 | .directive('iorawarnings',function(){
42 |
43 | return {
44 | templateUrl:'scripts/directives/warnings/warning.html'
45 | }
46 | });
47 |
--------------------------------------------------------------------------------
/client/app/scripts/services/ioraSessionServices.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 |
34 | angular.module('ioraSessionServices',[])
35 | .factory('ioraGateKeeperFactory',function(){
36 | var errorMessage = {};
37 |
38 | function set(data) {
39 | errorMessage = data;
40 | }
41 |
42 | function get() {
43 | return errorMessage;
44 | }
45 |
46 | return {
47 | set: set,
48 | get: get
49 | };
50 | })
51 | .factory('ioraReportFactory', function() {
52 | //placeholder interface to fetch the iora rest data and supply it to the views.
53 | var ioraRest = {};
54 |
55 | function set(data) {
56 | ioraRest = data;
57 | }
58 |
59 | function get() {
60 | return ioraRest;
61 | }
62 |
63 | return {
64 | set: set,
65 | get: get
66 | };
67 | })
68 | .factory('ioraDashboardFactory', function() {
69 | //placeholder interface to fetch the iora rest data and supply it to the views.
70 | var ioraRest = {};
71 |
72 | function set(data) {
73 | ioraRest = data;
74 | }
75 |
76 | function get() {
77 | return ioraRest;
78 | }
79 |
80 | return {
81 | set: set,
82 | get: get
83 | };
84 | })
85 | .factory('userInfoFactory', function() {
86 | //placeholder interface to fetch the iora rest data and supply it to the views.
87 | var userInfo = {};
88 |
89 | function set(data) {
90 | userInfo = data;
91 | }
92 |
93 | function get() {
94 | return userInfo;
95 | }
96 |
97 | return {
98 | set: set,
99 | get: get
100 | };
101 | }).factory('chartSelectionFactory', function() {
102 | //placeholder interface to fetch the iora rest data and supply it to the views.
103 | var chartSelection = {};
104 |
105 | function set(data) {
106 | chartSelection = data;
107 | }
108 |
109 | function get() {
110 | return chartSelection;
111 | }
112 |
113 | return {
114 | set: set,
115 | get: get
116 | };
117 | });
118 |
--------------------------------------------------------------------------------
/client/app/scripts/services/ioraTooltipServices.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /**
33 | * Iora Services to construct angular charts needed for the app.
34 | * and provide to the controller.
35 | */
36 |
37 | 'use strict';
38 |
39 | angular.module('ioraChartServices')
40 | .factory('orgToolTipServicesFactory', function() {
41 |
42 | var _createElement=function(parentDom,elementType,d){
43 | return parentDom.selectAll(elementType)
44 | .data([d])
45 | .enter().append(elementType);
46 | }
47 |
48 | var _styleCellAndRender=function(trowObj,tableObj,footerValue){
49 |
50 | trowObj.selectAll("td").each(function(p) {
51 | if (p.highlight) {
52 | var opacityScale = d3.scale.linear().domain([0, 1]).range(["#fff", p.color]);
53 | var opacity = 0.6;
54 | d3.select(this)
55 | .style("border-bottom-color", opacityScale(opacity))
56 | .style("border-top-color", opacityScale(opacity));
57 |
58 | }
59 | });
60 |
61 | var html = tableObj.node().outerHTML;
62 | if (footerValue !== undefined) {
63 | html += "";
64 | }
65 |
66 | return html;
67 |
68 | }
69 |
70 |
71 | var _appendRow=function(trowObj,value,rowType,d){
72 | if('key' === rowType){
73 | trowObj.append("td")
74 | .classed(rowType, true)
75 | .html(function() {
76 | return value;
77 | });
78 | }
79 | else{
80 | trowObj.append("td")
81 | .classed(rowType, true)
82 | .html(function() {
83 | return value;
84 | }).append("tr")
85 | .classed("highlight", function(p) {
86 | return p.highlight;
87 | });
88 | }
89 | }
90 |
91 | var _appendHeader=function(theadObj,d){
92 | theadObj.append("tr")
93 | .append("td")
94 | .attr("colspan", 3)
95 | .append("strong")
96 | .classed("x-value", true)
97 | .html('Summary');
98 | }
99 |
100 | var customizeTooltip = function(d) {
101 | if (d === null) {
102 | return '';
103 | }
104 |
105 |
106 | var table = d3.select(document.createElement("table"));
107 | //create header
108 | var theadEnter = _createElement(table,'thead',d);
109 | //append header
110 | _appendHeader(theadEnter,d);
111 |
112 | //create tbody
113 | var tbodyEnter = _createElement(table,'tbody',d);
114 |
115 | //create trow
116 | var trowEnter = _createElement(tbodyEnter,'tr',d).classed("highlight", function(p) {
117 | return p.highlight;
118 | });
119 |
120 |
121 | _appendRow(trowEnter,d.data.key + ':','key');
122 | _appendRow(trowEnter,d.value,'value');
123 |
124 | _appendRow(trowEnter,'Name','key');
125 | _appendRow(trowEnter,d.data.apiName,'value');
126 |
127 | _appendRow(trowEnter,'Last Used:','key');
128 | _appendRow(trowEnter,d.data.lastUsed,'value');
129 |
130 | _appendRow(trowEnter,'Last Modified:','key');
131 | _appendRow(trowEnter,d.data.lastModified,'value');
132 |
133 | _appendRow(trowEnter,'Last Modified By:','key');
134 | _appendRow(trowEnter,d.data.lastModifiedBy,'value');
135 |
136 | return _styleCellAndRender(trowEnter,table,d.footer);
137 |
138 | };
139 |
140 | var customizeMiniTooltip = function(d) {
141 | if (d === null) {
142 | return '';
143 | }
144 |
145 | var table = d3.select(document.createElement("table"));
146 |
147 | //create header
148 | var theadEnter = _createElement(table,'thead',d);
149 | //append header
150 | _appendHeader(theadEnter);
151 |
152 | //create tbody
153 | var tbodyEnter = _createElement(table,'tbody',d);
154 |
155 |
156 | var trowEnter = tbodyEnter.selectAll("tr")
157 | .data(function(p) {
158 | return p.series;
159 | })
160 | .enter()
161 | .append("tr")
162 | .classed("highlight", function(p) {
163 | return p.highlight;
164 | });
165 |
166 | _appendRow(trowEnter,d.data.key + ':','key');
167 | _appendRow(trowEnter,d.value,'value');
168 |
169 | _appendRow(trowEnter,'Name','key');
170 | _appendRow(trowEnter,d.data.apiName,'value');
171 |
172 | return _styleCellAndRender(trowEnter,table,d.footer);
173 |
174 | };
175 |
176 | return {
177 | customizeTooltip: customizeTooltip,
178 | customizeMiniTooltip : customizeMiniTooltip
179 | };
180 | });
181 |
--------------------------------------------------------------------------------
/client/app/scripts/services/underscore.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | 'use strict';
33 | var underscore = angular.module('underscore', []);
34 | underscore.factory('_', ['$window', function($window) {
35 | return $window._; // assumes underscore has already been loaded on the page
36 | }]);
37 |
--------------------------------------------------------------------------------
/client/app/styles/iora_styles.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | .iora-img{
33 | text-align: bottom;
34 | float:left;
35 | margin-left: 10px;
36 | margin-bottom: 10px;
37 | }
38 | .responsive-table{
39 | width:inherit !important;
40 | }
41 |
42 | /*.bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-label{
43 | padding : 6px !important;
44 | }*/
45 |
46 | .equal, .equal > div[class*='col-'] {
47 | display: -webkit-box;
48 | display: -moz-box;
49 | display: -ms-flexbox;
50 | display: -webkit-flex;
51 | display: flex;
52 | flex:1 1 auto;
53 | }
54 |
55 | h1, h2, h3, h4, th, .panel-heading {
56 | text-transform:capitalize;
57 | }
58 |
59 | .iora_code {
60 | color: black;
61 | background-color: #f8f8f8;
62 | }
63 |
--------------------------------------------------------------------------------
/client/app/styles/login.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /* Update dropdown menu to center items */
33 | .dropdown-menu {
34 | /*left: 50% !important;*/
35 | right: auto;
36 | text-align: center;
37 | /*transform: translate(-50%, 0);*/
38 | }
39 |
40 | .jumbotron .btn {
41 | font-family: "Helvetica Neue";
42 | font-size: 16px;
43 |
44 |
45 | }
46 |
47 | .ui-select-toggle {
48 | padding : 14px !important;
49 | }
50 |
--------------------------------------------------------------------------------
/client/app/styles/main.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | .browsehappy {
33 | margin: 0.2em 0;
34 | background: #ccc;
35 | color: #000;
36 | padding: 0.2em 0;
37 | }
38 |
39 | body {
40 | padding: 0;
41 | }
42 |
43 | /* Everything but the jumbotron gets side spacing for mobile first views */
44 | .header,
45 | .marketing,
46 | .footer {
47 | padding-left: 15px;
48 | padding-right: 15px;
49 | }
50 |
51 |
52 | /* Custom page header */
53 | .header {
54 | border-bottom: 1px solid #e5e5e5;
55 | margin-bottom: 10px;
56 | }
57 | /* Make the masthead heading the same height as the navigation */
58 | .header h3 {
59 | margin-top: 0;
60 | margin-bottom: 0;
61 | line-height: 40px;
62 | padding-bottom: 19px;
63 | }
64 |
65 | /*.bootstrap-switch-container span { white-space: nowrap; }*/
66 |
67 |
68 | /* Custom page footer */
69 | .footer {
70 | padding-top: 19px;
71 | color: #777;
72 | border-top: 1px solid #e5e5e5;
73 | }
74 |
75 | .container-narrow > hr {
76 | margin: 30px 0;
77 | }
78 |
79 |
80 |
81 | /* Main marketing message and sign up button */
82 | .jumbotron {
83 | text-align: center;
84 | border-bottom: 1px solid #e5e5e5;
85 | }
86 | .jumbotron .btn {
87 | font-size: 14px;
88 | padding: 14px 24px;
89 | }
90 |
91 | /* Supporting marketing content */
92 | .marketing {
93 | margin: 40px 0;
94 | }
95 | .marketing p + h4 {
96 | margin-top: 28px;
97 | }
98 |
99 | /* Responsive: Portrait tablets and up */
100 | @media screen and (min-width: 768px) {
101 | .container {
102 | max-width: 730px;
103 | }
104 |
105 | /*make sure long text doesn't wrap.*/
106 | .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-label{
107 | white-space: nowrap;
108 | }
109 |
110 |
111 |
112 | /* Remove the padding we set earlier */
113 | .header,
114 | .marketing,
115 | .footer {
116 | padding-left: 0;
117 | padding-right: 0;
118 | }
119 | /* Space out the masthead */
120 | .header {
121 | margin-bottom: 30px;
122 | }
123 | /* Remove the bottom border on the jumbotron for visual effect */
124 | .jumbotron {
125 | border-bottom: 0;
126 | font-size: 16px;
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/client/app/views/iora_errors.html:
--------------------------------------------------------------------------------
1 |
31 |
32 |
Assess and improve components in your Salesforce org
42 |
43 |
44 |
45 | {{noOfReports}} reports and {{noOfDashboards}} dashboard definitions were collected and analyzed for this data set.
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Design Assessment
60 | Click on chart legend to toggle bars
61 |
62 |
63 |
64 |
65 |
66 |
The above chart shows, of the collected data set for this session, a count of the dashboards and reports that have optimal and suboptimal designs. An optimal report executes using a selective, indexed filter condition. An optimal dashboard
67 | includes all optimal reports. You can tune slow-running optimal reports and dashboards that target large data sets by improving the selectivity of indexed filter conditions.
68 |
69 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | Scalability Assessment
80 | Click on chart legend to toggle bars
81 |
82 |
83 |
84 |
85 |
86 | The above chart shows, of the collected data set for this session, a count of the dashboards and reports that target scalable and potentially unscalable objects. Generally speaking, reports (standalone or as a dashboard component) become less scalable
87 | when the objects they target contain more records. You can tune slow-running reports and dashboards that target large data sets by improving the selectivity of indexed filter conditions or archiving historical data.
36 |
37 | Operational Business Intelligence for Salesforce Reports and Dashboards
38 |
39 |
40 |
41 |
42 |
{{ current }}/{{ max }}
43 |
58 |
59 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/client/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "generator-angular",
3 | "version": "0.0.0",
4 | "dependencies": {
5 | "octicons": "^5.0.1",
6 | "angular": "^1.5.8",
7 | "bootstrap": "^3.2.0",
8 | "angular-route": "^1.4.0",
9 | "restangular": "^1.5.1",
10 | "angular-resource": "*",
11 | "angular-block-ui": "~0.2.2",
12 | "angular-bootstrap": "~0.14.3",
13 | "angular-ui-router": "~0.2.15",
14 | "oclazyload": "~1.0.9",
15 | "angular-loading-bar": "~0.8.0",
16 | "metisMenu": "~2.2.0",
17 | "font-awesome": "~4.5.0",
18 | "angular-morris-chart": "*",
19 | "jquery": "^3.1.0",
20 | "angular-chart.js": "~0.8.8",
21 | "angular-nvd3": "^1.0.5",
22 | "angular-svg-round-progressbar": "~0.3.8",
23 | "async": "~1.5.0",
24 | "ngstorage": "*",
25 | "angular-cookies": "~1.4.8",
26 | "angular-bootstrap-show-errors": "~2.3.0",
27 | "ui-select": "angular-ui-select#*",
28 | "ngSanitize": "~0.0.2",
29 | "angular-sanitize": "~1.4.8",
30 | "angularjs-nvd3-directives": "*",
31 | "underscore": "~1.8.3",
32 | "moment": "*",
33 | "datatables.net": "^1.10.13",
34 | "datatables.net-bs": "^1.10.13",
35 | "datatables.net-responsive": "^2.1.1",
36 | "datatables.net-responsive-bs": "^2.1.1"
37 | },
38 | "devDependencies": {
39 | "angular-mocks": "^1.4.0"
40 | },
41 | "appPath": "app",
42 | "moduleName": "ioraliteAngularApp",
43 | "overrides": {
44 | "bootstrap": {
45 | "main": [
46 | "less/bootstrap.less",
47 | "dist/css/bootstrap.css",
48 | "dist/js/bootstrap.js"
49 | ]
50 | }
51 | },
52 | "resolutions": {
53 | "angular": "^1.5.8",
54 | "d3": "^3.4.4",
55 | "nvd3": "^1.7.1",
56 | "jquery": "^3.1.0"
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/coffeelint.json:
--------------------------------------------------------------------------------
1 | {
2 | "arrow_spacing": {
3 | "level": "ignore"
4 | },
5 | "braces_spacing": {
6 | "level": "ignore",
7 | "spaces": 0,
8 | "empty_object_spaces": 0
9 | },
10 | "camel_case_classes": {
11 | "level": "error"
12 | },
13 | "coffeescript_error": {
14 | "level": "error"
15 | },
16 | "colon_assignment_spacing": {
17 | "level": "ignore",
18 | "spacing": {
19 | "left": 0,
20 | "right": 0
21 | }
22 | },
23 | "cyclomatic_complexity": {
24 | "value": 10,
25 | "level": "ignore"
26 | },
27 | "duplicate_key": {
28 | "level": "error"
29 | },
30 | "empty_constructor_needs_parens": {
31 | "level": "ignore"
32 | },
33 | "ensure_comprehensions": {
34 | "level": "warn"
35 | },
36 | "eol_last": {
37 | "level": "ignore"
38 | },
39 | "indentation": {
40 | "value": 2,
41 | "level": "error"
42 | },
43 | "line_endings": {
44 | "level": "ignore",
45 | "value": "unix"
46 | },
47 | "max_line_length": {
48 | "value": 80,
49 | "level": "error",
50 | "limitComments": true
51 | },
52 | "missing_fat_arrows": {
53 | "level": "ignore",
54 | "is_strict": false
55 | },
56 | "newlines_after_classes": {
57 | "value": 3,
58 | "level": "ignore"
59 | },
60 | "no_backticks": {
61 | "level": "error"
62 | },
63 | "no_debugger": {
64 | "level": "warn",
65 | "console": false
66 | },
67 | "no_empty_functions": {
68 | "level": "ignore"
69 | },
70 | "no_empty_param_list": {
71 | "level": "ignore"
72 | },
73 | "no_implicit_braces": {
74 | "level": "ignore",
75 | "strict": true
76 | },
77 | "no_implicit_parens": {
78 | "strict": true,
79 | "level": "ignore"
80 | },
81 | "no_interpolation_in_single_quotes": {
82 | "level": "ignore"
83 | },
84 | "no_plusplus": {
85 | "level": "ignore"
86 | },
87 | "no_stand_alone_at": {
88 | "level": "ignore"
89 | },
90 | "no_tabs": {
91 | "level": "error"
92 | },
93 | "no_this": {
94 | "level": "ignore"
95 | },
96 | "no_throwing_strings": {
97 | "level": "error"
98 | },
99 | "no_trailing_semicolons": {
100 | "level": "error"
101 | },
102 | "no_trailing_whitespace": {
103 | "level": "error",
104 | "allowed_in_comments": false,
105 | "allowed_in_empty_lines": true
106 | },
107 | "no_unnecessary_double_quotes": {
108 | "level": "ignore"
109 | },
110 | "no_unnecessary_fat_arrows": {
111 | "level": "warn"
112 | },
113 | "non_empty_constructor_needs_parens": {
114 | "level": "ignore"
115 | },
116 | "prefer_english_operator": {
117 | "level": "ignore",
118 | "doubleNotLevel": "ignore"
119 | },
120 | "space_operators": {
121 | "level": "ignore"
122 | },
123 | "spacing_after_comma": {
124 | "level": "ignore"
125 | },
126 | "transform_messes_up_line_numbers": {
127 | "level": "warn"
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "IoraLiteNodeJS",
3 | "version": "1.0.0",
4 | "description": "IoraLite Node JS Server",
5 | "main": "./server/index.js",
6 | "scripts": {
7 | "test": "echo \"no test specified yet \"",
8 | "start": "node ./server/index.js",
9 | "lint": "node_modules/.bin/goodparts lib"
10 | },
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "async": "^2.0.1",
15 | "bluebird": "^3.4.1",
16 | "body-parser": "^1.13.3",
17 | "bower": "",
18 | "express": "^4.13.3",
19 | "global": "^4.3.0",
20 | "grunt": "^1.0.1",
21 | "gzippo": "^0.2.0",
22 | "helmet": "^3.4.0",
23 | "jsforce": "^1.7.0",
24 | "lodash": "^4.14.2",
25 | "method-override": "^2.3.5",
26 | "moment": "^2.14.1",
27 | "nforce": "^1.6.0",
28 | "request": "^2.61.0",
29 | "restangular": "^1.5.1"
30 | },
31 | "cacheDirectories": [
32 | "node_modules",
33 | "client/bower_components"
34 | ],
35 | "devDependencies": {
36 | "eslint": "^6.6.0",
37 | "eslint-config-airbnb-base": "^11.1.0",
38 | "eslint-config-google": "^0.7.1",
39 | "eslint-config-standard": "^6.2.1",
40 | "eslint-plugin-import": "^2.2.0",
41 | "eslint-plugin-promise": "^3.4.1",
42 | "eslint-plugin-standard": "^2.0.1",
43 | "goodparts": "^1.2.1"
44 | },
45 | "repository": {
46 | "type": "git",
47 | "url": "git://github.com/forcedotcom/IoraLite.git"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/server/controllers/aboutme.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 | //load the application middleware for the current request
34 | var app = req.app;
35 | var jsforce = require('jsforce');
36 | var queryParams = req.body;
37 |
38 | var ioraConstants=app.models.ioraConstants;
39 | var conn = ioraConstants.establishSFDCConnection(jsforce,queryParams);
40 |
41 |
42 | conn.chatter.resource('/users/me').retrieve(function(err, apires) {
43 | if (err) {
44 | return console.error(err);
45 | }
46 | var responseStr = JSON.stringify(apires);
47 | res.header('content-type', 'application/json;charset=UTF-8');
48 | res.setHeader('Content-Length', responseStr.length);
49 | res.send(responseStr);
50 | return res;
51 | });
52 |
53 |
54 |
55 | };
56 |
--------------------------------------------------------------------------------
/server/controllers/apiVersions.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 | //load the application middleware for the current request
34 | var app = req.app;
35 | var nforce = app.models.nforce;
36 | var org = nforce.createConnection({
37 | clientId: '3MVG9sG9Z3Q1Rlbf_SZ4GkXuJFnrj7skeLWqgrt0ax6EVN2wEtKVNYUKKrzYnaeCpiKptXyag_bZos_bW9ulb',
38 | clientSecret: 'DUMMY_SECRET',
39 | redirectUri: 'https://localhost:3000/oauth/_callback',
40 | environment: 'production', // optional, salesforce 'sandbox' or 'production', production default
41 | mode: 'multi' // optional, 'single' or 'multi' user mode, multi default
42 | });
43 |
44 | org.getVersions(function(err, resp) {
45 | var responseStr = JSON.stringify(resp);
46 | res.header('content-type', 'application/json;charset=UTF-8');
47 | res.setHeader('Content-Length', responseStr.length);
48 | res.send(responseStr);
49 | return res;
50 | });
51 |
52 |
53 | };
54 |
--------------------------------------------------------------------------------
/server/controllers/fetchPossibleCandidates.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 | //load the application middleware for the current request
34 | var app = req.app;
35 |
36 | var jsforce = require('jsforce');
37 |
38 | var queryParams = req.body;
39 |
40 |
41 | var ioraConstants=app.models.ioraConstants;
42 | var conn = ioraConstants.establishSFDCConnection(jsforce,queryParams);
43 |
44 | var updateResObject=function(responseObj,responseRaw){
45 | var responseStr='';
46 | responseStr = JSON.stringify(records);
47 | responseObj.header('content-type', 'application/json;charset=UTF-8');
48 | responseObj.setHeader('Content-Length', responseStr.length);
49 | responseObj.send(responseStr);
50 | }
51 |
52 |
53 |
54 | var reportsToBeFetched = [];
55 | var reportHeathScores=[];
56 | var records=[];
57 |
58 |
59 | conn.query("select Id from Report where LastRunDate=THIS_MONTH order by LastRunDate desc NULLS LAST limit 3000")
60 | .on("record",function(record){
61 | records.push(record);
62 | })
63 | .on("end", function(query) {
64 | updateResObject(res,records);
65 | return res;
66 | })
67 | .on("error", function(err) {
68 | updateResObject(res,err);
69 | return res;
70 | })
71 | .run({ autoFetch : true, maxFetch : 4000 });
72 |
73 | };
74 |
--------------------------------------------------------------------------------
/server/controllers/fetchRecent.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 | //load the application middleware for the current request
34 | var app = req.app;
35 |
36 | var jsforce = require('jsforce');
37 |
38 | var queryParams = req.body;
39 | var ioraConstants=app.models.ioraConstants;
40 | var conn = ioraConstants.establishSFDCConnection(jsforce,queryParams);
41 |
42 | var responseStr='';
43 |
44 |
45 | var records = [];
46 | conn.query("select Id,Name, LastRunDate, LastViewedDate from Report where LastRunDate=THIS_MONTH order by LastRunDate desc NULLS LAST limit 600", function(err, result) {
47 | if (err) {
48 | console.error(err);
49 | responseStr = JSON.stringify(err);
50 | }
51 | else{
52 | responseStr = JSON.stringify(result.records);
53 | }
54 |
55 | res.header('content-type', 'application/json;charset=UTF-8');
56 | res.setHeader('Content-Length', responseStr.length);
57 | res.send(responseStr);
58 | return res;
59 |
60 | });
61 |
62 | };
63 |
--------------------------------------------------------------------------------
/server/controllers/fetchRecentDashboards.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 | //load the application middleware for the current request
34 | var app = req.app;
35 |
36 | var jsforce = require('jsforce');
37 |
38 | var queryParams = req.body;
39 |
40 |
41 | var access_token = '';
42 | var endPointUrl = '';
43 | var dashboardIds='';
44 | var limitClause='limit 10';
45 | var whereClause='';
46 |
47 | if (queryParams.sessionId !== null && queryParams.sessionId !== undefined && queryParams.sessionId.length > 0) {
48 | access_token = queryParams.sessionId.trim();
49 | endPointUrl = queryParams.instanceUrl.trim();
50 | if(queryParams.dashboardIds !== null && queryParams.dashboardIds !== undefined && queryParams.dashboardIds.length > 0){
51 | dashboardIds=queryParams.dashboardIds.trim();
52 | whereClause='where Id =\'' + dashboardIds + '\' and LastReferencedDate !=null';
53 | limitClause="";
54 | }
55 | else{
56 | whereClause='';
57 | }
58 | }
59 |
60 | var conn = new jsforce.Connection({
61 | accessToken: access_token,
62 | instanceUrl: endPointUrl
63 | });
64 |
65 | var responseStr = '';
66 |
67 | var records = [];
68 | conn.query("select CreatedBy.Name ,Folder.Name, FolderId, LastModifiedById, LastModifiedBy.Name, CreatedDate, Description, DeveloperName, Id, LastModifiedDate, LastReferencedDate, LastViewedDate, NamespacePrefix, RunningUser.Name, SystemModstamp, Title, Type from dashboard " + whereClause + " order by SystemModstamp desc NULLS LAST " + limitClause, function(err, result) {
69 | if (err) {
70 | //return console.error(err);
71 | responseStr = JSON.stringify(err);
72 | }
73 | else{
74 | responseStr = JSON.stringify(result.records);
75 | }
76 |
77 |
78 | res.header('content-type', 'application/json;charset=UTF-8');
79 | res.setHeader('Content-Length', responseStr.length);
80 | res.send(responseStr);
81 | return res;
82 |
83 | });
84 |
85 | };
86 |
--------------------------------------------------------------------------------
/server/controllers/ioraDashboards.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 |
33 | /**
34 | * Controller for fetching dashboards information needed for Iora
35 | */
36 | //load the models and controller to perform salesforce API calls and fetch the response.
37 |
38 | module.exports = function(req, res) {
39 | //load the application middleware for the current request
40 | var app = req.app;
41 |
42 | //load the application constants
43 | var ioraConstants = app.models.ioraConstants;
44 |
45 | ioraConstants.dashoptimalHSCnt = 0;
46 | ioraConstants.dashOptimalUnscalable = 0;
47 | ioraConstants.dashSuboptimalUnhealthy = 0;
48 | ioraConstants.dashSuboptimalUnscalable = 0;
49 |
50 | //dash perf tags count
51 | ioraConstants.dashundeindexedHDCnt = 0;
52 | ioraConstants.dashwildcardfilterHDCnt = 0;
53 | ioraConstants.dashnonselectiveHDCnt = 0;
54 | ioraConstants.dashrecordskewHDCnt = 0;
55 | ioraConstants.dashnegativefilterHDCnt = 0;
56 | ioraConstants.dashnonoptimizableopHDCnt = 0;
57 | ioraConstants.dashlastmodifiedoptHDCnt = 0;
58 |
59 | //load the necessary models
60 | var batchRestUtilModel = app.models.batchRestUtil;
61 | var buildBatchRequestModel = app.models.buildBatchRequest;
62 | var restUtilModel = app.models.restUtil;
63 | var _lodash = app.models._;
64 | var requestModule = app.models.request;
65 | var promiseModule = app.models.promise;
66 | var ioraDashboardsTransform = app.models.ioraDashboardsTransform;
67 | var dashboardSchema = app.models.ioraSchema;
68 |
69 |
70 |
71 |
72 | var params = ioraConstants.constructRequestParams(req,'dashboardIds');
73 |
74 | var ioraDashboardRest = [];
75 | //invoke the function to perform the dashboard describe
76 | var restAPIPromises = batchRestUtilModel.genericDescribe(restUtilModel, _lodash, promiseModule, requestModule, params, 'dashboardIds');
77 |
78 |
79 | promiseModule.all(restAPIPromises).then(function(responses) {
80 | _lodash.each(responses, function(jsonResponse) {
81 | var transformResponse = ioraDashboardsTransform.transformDashboardDescribe(
82 | dashboardSchema, _lodash, jsonResponse, ioraConstants);
83 | ioraDashboardRest.push(transformResponse);
84 | });
85 |
86 |
87 | var responseStr = JSON.stringify(ioraDashboardRest);
88 | res.header('content-type', 'application/json;charset=UTF-8');
89 | res.setHeader('Content-Length', responseStr.length);
90 | res.send(responseStr);
91 | res.end();
92 | return res;
93 |
94 | });
95 |
96 | };
97 |
98 | /*_constructDashboardRequestParams = function(req) {
99 |
100 | var params = new Map();
101 | //get the necessary inputs from the params
102 | params.set('instanceURL', req.body.instanceUrl);
103 | params.set('dashboardIds', req.body.dashboardIds.split(','));
104 | params.set('apiVer', req.body.apiVer);
105 | params.set('chunkSize', req.body.chunkSize);
106 | params.set('sessionId', req.body.sessionId);
107 | return params;
108 | };*/
109 |
--------------------------------------------------------------------------------
/server/controllers/ioraGateKeeper.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 |
33 | /**
34 | * REST API service to optionally specify restricted salesforce orgs to use the app by the admin.
35 | * Customers not part of the non-empty list cannot login or use the application even with the URL.
36 | */
37 |
38 | module.exports = function(req, res) {
39 | //load the application middleware for the current request
40 | var app = req.app;
41 |
42 | var errorInfo={};
43 |
44 | var jsforce = require('jsforce');
45 |
46 | //variable to store the JSON response
47 | var responseStr='';
48 |
49 | /*
50 | variable to control, if tighter org restriction policy is enforced. By default, it is "true" and hence "strictly enforced".
51 |
52 | If "strictly enforced", only the org IDs that are added to "ioraCustomers" , are allowed to run IoraLite.
53 |
54 | If the variable is set to true, and the "ioraCustomers" list is empty, NO orgs can use IoraLite.
55 |
56 | If the variable is set to false, the behavior is dependent on "ioraCustomers" list
57 | 1. If the list is empty, then any org can run ioralite. Be CAREFUL and UNDERSTAND COMPLETELY the implications, before turning this setting ON.
58 | 2. If the list is non-empty, then only the org IDs that are added to "ioraCustomers" , are allowed to run IoraLite
59 | */
60 |
61 | var strictPolicyEnforced=true;
62 |
63 | //define the customers org IDs that can use your Iora App.
64 | var ioraCustomers=[];
65 |
66 | /* ioraCustomers.push('ALLOW_ORG_ID1'); //First ORG ID to allow access
67 | ioraCustomers.push('ALLOW_ORG_ID2'); // Second ORG ID allow access
68 | ioraCustomers.push('ALLOW_ORG_ID3'); //Third ORG ID to allow access
69 | .......
70 | .......
71 | */
72 |
73 | var queryParams = req.body;
74 |
75 |
76 | var access_token = '';
77 | var endPointUrl = '';
78 | var restEndPoint = '';
79 |
80 | if (queryParams.sessionId !== null && queryParams.sessionId.length > 0) {
81 | access_token = queryParams.sessionId.trim();
82 | endPointUrl = queryParams.instanceUrl.trim();
83 | restEndPoint = queryParams.restEndPoint.trim();
84 | }
85 |
86 | var conn = new jsforce.Connection({
87 | accessToken: access_token,
88 | instanceUrl: endPointUrl
89 | });
90 |
91 |
92 | conn.identity(function(err, identityResponse) {
93 | //trim the org id to 15 characters from the response
94 | var orgId_15Chars=identityResponse.organization_id.substring(0,15);
95 | if (err) {
96 | //return console.error(err);
97 | var errorObj=new Error(err);
98 | errorInfo={};
99 | errorInfo.errorMessage=errorObj.message;
100 | responseStr = JSON.stringify(errorInfo);
101 | }
102 | else if((!(app.models._.includes(ioraCustomers,orgId_15Chars))) && (strictPolicyEnforced || ioraCustomers.length > 0) ){
103 | errorInfo={};
104 | errorInfo.errorMessage='This Salesforce organization is not approved by your administrator to run Iora Lite. You may try logging in with different credentials, if you believe this organization is approved';
105 | responseStr = JSON.stringify(errorInfo);
106 |
107 | }
108 | else{
109 | errorInfo={};
110 | errorInfo.errorMessage='PROCEED';
111 | responseStr = JSON.stringify(errorInfo);
112 | }
113 |
114 | res.header('content-type', 'application/json;charset=UTF-8');
115 | res.setHeader('Content-Length', responseStr.length);
116 | res.send(responseStr);
117 | return res;
118 |
119 | });
120 |
121 |
122 |
123 | };
124 |
--------------------------------------------------------------------------------
/server/controllers/ioraReportPerf.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 |
34 | //load the application middleware for the current request
35 | var app = req.app;
36 |
37 | //load the application constants
38 | var ioraConstants = app.models.ioraConstants;
39 |
40 |
41 | //load the necessary models
42 | var batchRestUtilModel = app.models.batchRestUtil;
43 | var buildBatchRequestModel = app.models.buildBatchRequest;
44 | var restUtilModel = app.models.restUtil;
45 |
46 | var _lodash = app.models._;
47 | var requestModule = app.models.request;
48 | var promiseModule = app.models.promise;
49 | var ioraReportTransform = app.models.ioraReportTransform;
50 | var reportSchema = app.models.ioraSchema;
51 |
52 | var ioraPromiseAggregator = app.models.ioraPromiseAggregator;
53 | var ioraReportPerfAnalyzer = app.models.ioraReportPerfAnalyzer;
54 |
55 |
56 |
57 | var params = ioraConstants.constructRequestParams(req,'reportIds');
58 | var perfHealthScoreArr = [];
59 |
60 | //report performance promise
61 | batchRestUtilModel.genericBatchRest(buildBatchRequestModel, restUtilModel, requestModule, params, 'reportIds').then(function(batchResponse) {
62 |
63 |
64 | if (batchResponse.results !== null && batchResponse.results !== undefined) {
65 |
66 | _lodash.each(batchResponse.results, function(explainPlan) {
67 |
68 | var perfHealthScore = {};
69 | if (explainPlan.result !== null && explainPlan.result !== undefined && explainPlan.statusCode === 200 && explainPlan.result.plans !== undefined && explainPlan.result.plans.length > 0) {
70 | var healthScore = _computeHealthScore(explainPlan.result.plans[0], ioraConstants);
71 | perfHealthScore.reportId = explainPlan.result.sourceQuery;
72 | perfHealthScore.statusCode = 200;
73 | perfHealthScore.healthScore = healthScore;
74 | perfHealthScoreArr.push(perfHealthScore);
75 | }
76 |
77 | });
78 | }
79 | var responseStr = JSON.stringify(perfHealthScoreArr);
80 | res.header('content-type', 'application/json;charset=UTF-8');
81 | res.setHeader('Content-Length', responseStr.length);
82 | res.send(responseStr);
83 | res.end();
84 | return res;
85 | });
86 | };
87 |
88 | /*_constructRequestParams = function(req) {
89 | var params = new Map();
90 | //get the necessary inputs from the params
91 | params.set('instanceURL', req.body.instanceUrl);
92 | params.set('reportIds', req.body.reportIds.split(','));
93 | params.set('apiVer', req.body.apiVer);
94 | params.set('chunkSize', req.body.chunkSize);
95 | params.set('sessionId', req.body.sessionId);
96 | return params;
97 | };*/
98 |
99 | var _computeHealthScore = function(plan, ioraConstants) {
100 |
101 | var healthStatusInt = 0;
102 |
103 |
104 | if (plan.leadingOperationType === ioraConstants.tableScanOperation) {
105 | healthStatusInt = ioraConstants.designSubOptimalScore;
106 | } else {
107 | healthStatusInt = ioraConstants.designOptimalScore;
108 | }
109 |
110 | if (plan.sobjectCardinality > ioraConstants.unhealthyTableScan) {
111 | healthStatusInt *= ioraConstants.scalabilityCriticalScore;
112 | } else if (plan.sobjectCardinality > ioraConstants.unscalableTableScan) {
113 | healthStatusInt *= ioraConstants.scalabilityWarningScore;
114 | } else {
115 | healthStatusInt *= ioraConstants.scalabilityOKScore;
116 | }
117 |
118 |
119 | var healthScore = Number(Math.round((plan.relativeCost * plan.sobjectCardinality * healthStatusInt) + 'e2') + 'e-2');
120 |
121 |
122 | return healthScore;
123 |
124 | };
125 |
--------------------------------------------------------------------------------
/server/controllers/passwordAuth.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | module.exports = function(req, res) {
33 | //load the application middleware for the current request
34 | var app = req.app;
35 |
36 | var jsforce = require('jsforce');
37 |
38 | var queryParams = req.body;
39 |
40 | var username = '';
41 | var password='';
42 | var loginurl='';
43 |
44 | if (queryParams.username !== null && queryParams.password !==null && queryParams.username !== undefined && queryParams.password !==undefined) {
45 | username = queryParams.username.trim();
46 | password = queryParams.password.trim();
47 | loginurl = queryParams.loginurl.trim();
48 | }
49 |
50 | var conn = new jsforce.Connection({
51 | loginUrl : loginurl
52 | });
53 |
54 | var responseStr='';
55 |
56 | conn.login(username, password, function(err, userInfo) {
57 | if (err) {
58 | var errorObj=new Error(err);
59 | var errorInfo={};
60 | errorInfo.errorMessage=errorObj.message;
61 | responseStr = JSON.stringify(errorInfo);
62 | }
63 | else{
64 | var connection={};
65 | connection.access_token=conn.accessToken;
66 | connection.instance_url=conn.instanceUrl;
67 | responseStr = JSON.stringify(connection);
68 |
69 | }
70 |
71 |
72 | res.header('content-type', 'application/json;charset=UTF-8');
73 | res.setHeader('Content-Length', responseStr.length);
74 | res.send(responseStr);
75 | return res;
76 | // ...
77 | });
78 |
79 |
80 |
81 | };
82 |
--------------------------------------------------------------------------------
/server/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 |
33 | var helmet = require('helmet');
34 | // Load the routes.
35 | var routes = require('./routes');
36 |
37 | var fs = require('fs'),
38 | https = require('https'),
39 | express = require('express'),
40 | app = express();
41 |
42 |
43 |
44 | // Create the application.
45 | //var app = require('express').createServer(options);
46 | app.use(helmet());
47 | app.use(helmet.frameguard());
48 | app.use(helmet.noSniff());
49 |
50 | app.use(helmet.hsts({
51 | maxAge: 10886400000,
52 | includeSubdomains: true,
53 | preload: true
54 | }));
55 |
56 | /*app.use(helmet.contentSecurityPolicy({
57 | directives: {
58 | defaultSrc: ["'self'", 'salesforce.com','force.com'] ,
59 | styleSrc: ["'self'" ,'fonts.googleapis.com']
60 | }
61 | }));*/
62 |
63 | //load the application models
64 | app.models=require('./models/index');
65 |
66 |
67 | app.set('views', 'client/app');
68 | app.use(express.static('client/app'));
69 | app.use('/bower_components', express.static('client/bower_components'));
70 |
71 |
72 |
73 | // Add Middleware necessary for REST API's
74 | app.use(app.models.bodyParser.urlencoded({extended: false}));
75 | //app.use(bodyParser.json());
76 | app.use(app.models.methodOverride('X-HTTP-Method-Override'));
77 |
78 |
79 | app.post(function(req, res, next) {
80 | if("http" === req.protocol && "localhost" !== req.headers.host) {
81 | return res.redirect("https://" + req.headers.host + req.path);
82 | }
83 |
84 | res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
85 | res.header('Access-Control-Allow-Headers', 'Content-Type');
86 | res.header('content-type', 'application/json;charset=UTF-8');
87 | next();
88 | });
89 |
90 | app.models._.each(routes, function(controller,route) {
91 | app.all(route, function (req, res){
92 | controller(req,res);
93 | });
94 | });
95 |
96 | app.get('*', function(request, response) {
97 | response.sendFile('index.html',{root : 'client/app/' });
98 | });
99 |
100 |
101 | app.set('port', (process.env.PORT || 3000));
102 | //var httpsServer = https.createServer(app);
103 |
104 | //httpsServer.listen(3000);
105 |
106 | var server=app.listen(app.get('port'), function() {
107 | console.log('Node app is running on port', app.get('port'));
108 | });
109 |
--------------------------------------------------------------------------------
/server/models/buildBatchRequest.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017, Salesforce.com, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice,
12 | * this list of conditions and the following disclaimer in the documentation
13 | * and/or other materials provided with the distribution.
14 | *
15 | * 3. Neither the name of Salesforce.com nor the names of its contributors may
16 | * be used to endorse or promote products derived from this software without
17 | * specific prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | * POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /**
33 | * Node.js util function to invoke batch rest calls to salesforce
34 | */
35 | module.exports={
36 | /*
37 | * 1. Function: buildBatchReportRestReqs
38 | * Purpose: build batch report rest requests for the batch rest api call
39 | * Inputs:
40 | * @param : reportIds -> list of reportIds interested for data fetch
41 | * @param : chunkSize -> current value is 25 for max number of api calls per batch requests. This param provides the *ability to increase chunk size should the platform
42 | * support more later
43 | * Output : list of strings that denote each chunk requests
44 | */
45 |
46 | // for each report there are two api calls needed: describe and explainPlan
47 | // currently for the available chunk size (25), a maximum of 12 reports can be fetched in a single batch call.
48 | buildBatchRestReqs : function(Ids,apiVer,chunkSize,isReport){
49 | //an array to store all the restRequests
50 | var restRequests=new Array();
51 | for(var index=0;index Reference to the module to perform https request
39 | * @param : idField -> ID value that needs to be set, if the response doesn't have one.pass null or empty, if not needed
40 | * @param : sessionId -> SFDC session id needed to make the API call
41 | * @param : instanceURL -> SFDC host URL that corresponds to the session ID passed
42 | * @param : apiVer -> API version to use
43 | * @param : endPoint -> REST endPoint to be invoked at the specified host
44 | * @param : httpMethod -> The httpMethod associated with the REST call
45 | * @param : postBody -> http post content, if POST Method
46 | * Output : Promise based JSON response from salesforce
47 | */
48 |
49 | var promise = require('bluebird');
50 | var https = require('https');
51 |
52 |
53 | module.exports = {
54 | sfdcRestReq: promise.method(function(requestModule, idField, sessionId, instanceURL, apiVer, endPoint, httpMethod, postBody) {
55 | var options = {
56 | method: httpMethod,
57 | baseUrl: instanceURL.indexOf('http') === -1 ? 'https://' + instanceURL : instanceURL,
58 | url: endPoint,
59 | timeout : 28000,
60 | body: postBody,
61 | headers: {
62 | 'Content-Type': 'application/json;charset=UTF-8',
63 | 'Content-Length': postBody.length,
64 | 'Authorization': 'Bearer ' + sessionId
65 | }
66 | };
67 |
68 |
69 |
70 |
71 |
72 | return new promise(function(resolve, reject) {
73 | requestModule(options, function(error, response, body) {
74 |
75 | var bodyObj;
76 | var restErrors=[];
77 | var restErrorInstance = {};
78 |
79 | if (error !== null) {
80 |
81 |
82 | restErrorInstance.id = idField;
83 | restErrorInstance.URL=options.url;
84 | restErrorInstance.errorCode = error.code;
85 | restErrorInstance.errorMessage = (error.code === 'ETIMEDOUT'? ('The request to the below URL timed out. ' + options.url) :'') ;
86 | restErrors.push(restErrorInstance);
87 | resolve(restErrors);
88 |
89 | }
90 |
91 | //error response
92 | else if (response!==null && response!==undefined && response.statusCode !== 200) {
93 |
94 | try{
95 | bodyObj=JSON.parse(body);
96 |
97 | for(var bodyIndex=0;bodyIndex