Skip to content

Commit

Permalink
Merge pull request #2861 from compucorp/staging
Browse files Browse the repository at this point in the history
Sync master with staging
  • Loading branch information
davialexandre authored Sep 18, 2018
2 parents 350bb6a + 372a341 commit a097a60
Show file tree
Hide file tree
Showing 505 changed files with 4,081 additions and 7,543 deletions.
22 changes: 8 additions & 14 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ pipeline {
thresholds: [
[
$class: 'FailedThreshold',
failureNewThreshold: '1',
failureThreshold: '1',
unstableNewThreshold: '1',
unstableThreshold: '1'
failureNewThreshold: '0',
failureThreshold: '0',
unstableNewThreshold: '0',
unstableThreshold: '0'
]
],
tools: [
Expand Down Expand Up @@ -142,10 +142,10 @@ pipeline {
thresholds: [
[
$class: 'FailedThreshold',
failureNewThreshold: '1',
failureThreshold: '1',
unstableNewThreshold: '1',
unstableThreshold: '1'
failureNewThreshold: '0',
failureThreshold: '0',
unstableNewThreshold: '0',
unstableThreshold: '0'
]
],
tools: [
Expand Down Expand Up @@ -425,12 +425,6 @@ def listCivihrExtensions() {
hasJSTests: true,
hasPHPTests: true
],
hrrecruitment: [
name: 'Recruitment',
folder: 'hrrecruitment',
hasJSTests: false,
hasPHPTests: true
],
hrreport: [
name: 'Reports',
folder: 'hrreport',
Expand Down
1 change: 0 additions & 1 deletion bin/civihr-crm-api-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ runTest hrreport org.civicrm.hrabsence,org.civicrm.hrjob,org.civicrm.hrreport CR
runTest hrjob org.civicrm.hrjob api_v3_AllTests
runTest hrjob org.civicrm.hrjob CRM_AllTests
runTest hrabsence org.civicrm.hrabsence api_v3_AllTests
runTest hrrecruitment org.civicrm.hrrecruitment CRM_AllTests

if [ -f "${SQLDUMP}" ] ; then
rm "${SQLDUMP}"
Expand Down
1 change: 0 additions & 1 deletion bin/civihr-webtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ hrjob \
hrmed \
hrqual \
hrstaffdir \
hrrecruitment \
)

CONF=`dirname $0`/setup.conf
Expand Down
1 change: 0 additions & 1 deletion bin/drush-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ org.civicrm.hrreport,\
org.civicrm.hrui,\
org.civicrm.hrcase,\
org.civicrm.hrim,\
org.civicrm.hrrecruitment,\
org.civicrm.reqangular,\
org.civicrm.contactsummary,\
org.civicrm.shoreditch,\
Expand Down
1 change: 0 additions & 1 deletion bin/git-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ hrim \
hrmed \
hrprofile \
hrqual \
hrrecruitment \
hrreport \
uk.co.compucorp.civicrm.hrsampledata \
hrstaffdir \
Expand Down
3 changes: 1 addition & 2 deletions com.civicrm.hrjobroles/CRM/Hrjobroles/Page/JobRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ function run() {

private static function registerScripts() {
CRM_Core_Resources::singleton()->addVars('hrjobroles', array(
'baseURL' => CRM_Extension_System::singleton()->getMapper()->keyToUrl('com.civicrm.hrjobroles'),
'path' => CRM_Core_Resources::singleton()->getUrl('com.civicrm.hrjobroles')
'baseURL' => CRM_Extension_System::singleton()->getMapper()->keyToUrl('com.civicrm.hrjobroles')
));

CRM_Core_Resources::singleton()->addScriptFile('com.civicrm.hrjobroles', 'js/dist/job-roles.min.js', 1010);
Expand Down
4 changes: 2 additions & 2 deletions com.civicrm.hrjobroles/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<author>Compucorp Ltd</author>
<email>[email protected]</email>
</maintainer>
<releaseDate>2018-08-20</releaseDate>
<version>1.7.10</version>
<releaseDate>2018-09-17</releaseDate>
<version>1.7.11</version>
<develStage>stable</develStage>
<compatibility>
<ver>4.7</ver>
Expand Down
4 changes: 2 additions & 2 deletions com.civicrm.hrjobroles/js/dist/job-roles.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions com.civicrm.hrjobroles/js/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function (config) {
{ pattern: extPath + 'js/test/**/*.spec.js', included: false },

// angular templates
extPath + 'views/**/*.html',
extPath + 'js/src/job-roles/**/*.html',

// the requireJS config file that bootstraps the whole test suite
extPath + 'js/test/test-main.js'
Expand All @@ -51,12 +51,12 @@ module.exports = function (config) {
],
// Used to transform angular templates in JS strings
preprocessors: (function (obj) {
obj[extPath + 'views/**/*.html'] = ['ng-html2js'];
obj[extPath + 'js/src/job-roles/**/*.html'] = ['ng-html2js'];
return obj;
})({}),
ngHtml2JsPreprocessor: {
prependPrefix: '/base/',
moduleName: 'job-roles.templates'
moduleName: 'hrjobroles.templates'
},
customLaunchers: {
ChromeHeadless: {
Expand Down
4 changes: 2 additions & 2 deletions com.civicrm.hrjobroles/js/src/job-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
}
});

require(['job-roles/modules/job-roles.module'], function (app) {
require(['job-roles/job-roles.module'], function (app) {
'use strict';

document.dispatchEvent(typeof window.CustomEvent == "function" ? new CustomEvent('hrjobrolesReady') : (function () {
document.dispatchEvent(typeof window.CustomEvent === 'function' ? new CustomEvent('hrjobrolesReady') : (function () {
var e = document.createEvent('Event');
e.initEvent('hrjobrolesReady', true, true);
return e;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define([
], function (angular, _, moment) {
'use strict';

JobRolesController.__name = 'JobRolesController';
JobRolesController.$inject = [
'$filter', '$log', '$q', '$rootElement', '$route', '$routeParams', '$scope',
'$timeout', '$uibModal', 'DOMEventTrigger', 'settings', 'HR_settings',
Expand Down Expand Up @@ -41,8 +40,8 @@ define([
vm.LocationsData = {}; // Store the location types
vm.RegionsData = {}; // Store the region types
// Define the add new role URL
vm.addNewRoleUrl = settings.pathBaseUrl + settings.pathIncludeTpl + 'add_new_role.html';
vm.jobRolePanelUrl = settings.pathBaseUrl + settings.pathIncludeTpl + 'job_role_panel.html';
vm.addNewRoleUrl = settings.baseUrl + 'controllers/add-new-role.html';
vm.jobRolePanelUrl = settings.baseUrl + 'controllers/job-role-panel.html';
// Select list for Row Types (used for Funders and Cost Centers)
vm.rowTypes = {};
vm.rowTypes[0] = { id: 0, name: 'Fixed' };
Expand Down Expand Up @@ -452,7 +451,7 @@ define([
return _(data.values).map(function (contact) {
return contact;
})
.indexBy('contact_id')
.keyBy('contact_id')
.value();
});
}
Expand Down Expand Up @@ -894,7 +893,7 @@ define([
var modalInstance = $modal.open({
appendTo: $rootElement.find('div').eq(0),
template: '',
templateUrl: settings.pathApp + 'views/modalDialog.html?v=' + (new Date()).getTime(),
templateUrl: settings.baseUrl + 'controllers/modal-dialog.html',
size: 'sm',
controller: 'ModalDialogController',
controllerAs: 'dialog',
Expand Down Expand Up @@ -1072,7 +1071,7 @@ define([
jobRoleFunders.forEach(function (funder) {
var funderData = funder.funder_id;

if (!_.contains(Object.keys(fundersContacts), funderData.id)) {
if (!_.includes(Object.keys(fundersContacts), funderData.id)) {
fundersContacts[funderData.id] = funderData;
}
});
Expand Down Expand Up @@ -1275,5 +1274,5 @@ define([
}
}

return JobRolesController;
return { JobRolesController: JobRolesController };
});
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
define(function () {
'use strict';

ModalDialogController.__name = 'ModalDialogController';
ModalDialogController.$inject = ['$uibModalInstance', '$log', '$timeout', 'content'];

function ModalDialogController ($modalInstance, $log, $timeout, content) {
Expand Down Expand Up @@ -36,5 +35,5 @@ define(function () {
}
}

return ModalDialogController;
return { ModalDialogController: ModalDialogController };
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ define([
], function (_) {
'use strict';

getActiveValues.__name = 'getActiveValues';
getActiveValues.$inject = ['$log'];

function getActiveValues ($log) {
Expand All @@ -24,5 +23,5 @@ define([
};
}

return getActiveValues;
return { getActiveValues: getActiveValues };
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ define([
}]
})
.when('/', {
templateUrl: settings.pathBaseUrl + settings.pathTpl + 'mainTemplate.html?v=1',
templateUrl: settings.baseUrl + 'controllers/job-roles.html',
resolve: {},
controller: 'JobRolesController',
controllerAs: 'jobroles'
Expand Down
18 changes: 18 additions & 0 deletions com.civicrm.hrjobroles/js/src/job-roles/job-roles.constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-env amd */
/* globals location */

(function (CRM) {
define([
'common/angular'
], function (angular) {
'use strict';

angular.module('hrjobroles.constants', [])
.constant('settings', {
classNamePrefix: 'hrjobroles-',
contactId: decodeURIComponent((new RegExp('[?|&]cid=([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null,
debug: +CRM.debug,
baseUrl: CRM.vars.hrjobroles.baseURL + '/js/src/job-roles/'
});
});
}(CRM));
31 changes: 31 additions & 0 deletions com.civicrm.hrjobroles/js/src/job-roles/job-roles.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-env amd */

define([
'common/angular',
'job-roles/controllers/job-roles.controller',
'job-roles/controllers/modal-dialog.controller',
'job-roles/filters/get-active-values.filter',
'job-roles/services/date-validation.service',
'job-roles/services/filters.service',
'job-roles/services/job-role.service',
'job-roles/job-roles.config',
'job-roles/job-roles.constants',
'job-roles/job-roles.core',
'job-roles/job-roles.run'
], function (angular, JobRolesController, ModalDialogController, getActiveValues,
dateValidation, filtersService, jobRoleService) {
'use strict';

angular.module('hrjobroles', [
'hrjobroles.core',
'hrjobroles.config',
'hrjobroles.run',
'hrjobroles.constants'
])
.controller(JobRolesController)
.controller(ModalDialogController)
.filter(getActiveValues)
.factory(dateValidation)
.factory(filtersService)
.factory(jobRoleService);
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ define([

// Pass the values from our settings
$rootScope.contactId = settings.contactId;
$rootScope.pathBaseUrl = settings.pathBaseUrl;
$rootScope.pathTpl = settings.pathTpl;
$rootScope.pathIncludeTpl = settings.pathIncludeTpl;
$rootScope.prefix = settings.classNamePrefix;
}
});

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ define([
* @constructor
*/

dateValidation.__name = 'dateValidation';
dateValidation.$inject = ['HR_settings'];

function dateValidation (hrSettings) {
Expand Down Expand Up @@ -146,5 +145,5 @@ define([
}
}

return dateValidation;
return { dateValidation: dateValidation };
});
Loading

0 comments on commit a097a60

Please sign in to comment.