Upgrade to v26 (#172)

* A bunch of new updates from icehrm pro

* Push changes to frontend
This commit is contained in:
Thilina Hasantha
2019-02-03 14:00:34 +01:00
committed by GitHub
parent a75325fb52
commit 16014bb38e
734 changed files with 131230 additions and 17430 deletions

View File

@@ -0,0 +1,3 @@
import { PermissionAdapter } from './lib';
window.PermissionAdapter = PermissionAdapter;

View File

@@ -0,0 +1,73 @@
/*
Copyright (c) 2018 [Glacies UG, Berlin, Germany] (http://glacies.de)
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
import AdapterBase from '../../../api/AdapterBase';
/**
* PermissionAdapter
*/
class PermissionAdapter extends AdapterBase {
getDataMapping() {
return [
'id',
'user_level',
'module_id',
'permission',
'value',
];
}
getHeaders() {
return [
{ sTitle: 'ID', bVisible: false },
{ sTitle: 'User Level' },
{ sTitle: 'Module' },
{ sTitle: 'Permission' },
{ sTitle: 'Value' },
];
}
getFormFields() {
return [
['id', { label: 'ID', type: 'hidden' }],
['user_level', { label: 'User Level', type: 'placeholder', validation: 'none' }],
['module_id', { label: 'Module', type: 'placeholder', 'remote-source': ['Module', 'id', 'menu+name'] }],
['permission', { label: 'Permission', type: 'placeholder', validation: 'none' }],
['value', { label: 'Value', type: 'text', validation: 'none' }],
];
}
getFilters() {
return [
['module_id', {
label: 'Module', type: 'select2', 'allow-null': true, 'null-label': 'All Modules', 'remote-source': ['Module', 'id', 'menu+name'],
}],
];
}
getActionButtonsHtml(id, data) {
let html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img></div>';
html = html.replace(/_id_/g, id);
html = html.replace(/_BASE_/g, this.baseUrl);
return html;
}
getMetaFieldForRendering(fieldName) {
if (fieldName === 'value') {
return 'meta';
}
return '';
}
fillForm(object) {
super.fillForm(object);
$('#helptext').html(object.description);
}
}
module.exports = { PermissionAdapter };