🧲 New features Custom user role permissions Employee edit form updated Employee daily task list Attendance and employee distribution charts on dashboard Improvements to company structure and company assets module Improved tables for displaying data in several modules Faster data loading (specially for employee module) Initials based profile pictures Re-designed login page Re-designed user profile page Improvements to filtering New REST endpoints for employee qualifications 🐛 Bug fixes Fixed, issue with managers being able to create performance reviews for employees who are not their direct reports Fixed, issues related to using full profile image instead of using smaller version of profile image Changing third gender to other Improvements and fixes for internal frontend data caching
172 lines
3.4 KiB
JavaScript
172 lines
3.4 KiB
JavaScript
/*
|
|
Copyright (c) 2018 [Glacies UG, Berlin, Germany] (http://glacies.de)
|
|
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
|
|
*/
|
|
|
|
import ReactModalAdapterBase from '../../../api/ReactModalAdapterBase';
|
|
|
|
/**
|
|
* JobTitleAdapter
|
|
*/
|
|
|
|
class JobTitleAdapter extends ReactModalAdapterBase {
|
|
getDataMapping() {
|
|
return [
|
|
'id',
|
|
'code',
|
|
'name',
|
|
];
|
|
}
|
|
|
|
getHeaders() {
|
|
return [
|
|
{ sTitle: 'ID', bVisible: false },
|
|
{ sTitle: 'Code' },
|
|
{ sTitle: 'Name' },
|
|
];
|
|
}
|
|
|
|
getFormFields() {
|
|
return [
|
|
['id', { label: 'ID', type: 'hidden' }],
|
|
['code', { label: 'Job Title Code', type: 'text' }],
|
|
['name', { label: 'Job Title', type: 'text' }],
|
|
['description', { label: 'Description', type: 'textarea' }],
|
|
['specification', { label: 'Specification', type: 'textarea' }],
|
|
];
|
|
}
|
|
|
|
getTableColumns() {
|
|
return [
|
|
{
|
|
title: 'Job Title Code',
|
|
dataIndex: 'code',
|
|
sorter: true,
|
|
},
|
|
{
|
|
title: 'Job Title',
|
|
dataIndex: 'name',
|
|
sorter: true,
|
|
},
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* PayGradeAdapter
|
|
*/
|
|
|
|
class PayGradeAdapter extends ReactModalAdapterBase {
|
|
getDataMapping() {
|
|
return [
|
|
'id',
|
|
'name',
|
|
'currency',
|
|
'min_salary',
|
|
'max_salary',
|
|
];
|
|
}
|
|
|
|
getHeaders() {
|
|
return [
|
|
{ sTitle: 'ID', bVisible: false },
|
|
{ sTitle: 'Name' },
|
|
{ sTitle: 'Currency' },
|
|
{ sTitle: 'Min Salary' },
|
|
{ sTitle: 'Max Salary' },
|
|
];
|
|
}
|
|
|
|
getFormFields() {
|
|
return [
|
|
['id', { label: 'ID', type: 'hidden' }],
|
|
['name', { label: 'Pay Grade Name', type: 'text' }],
|
|
['currency', { label: 'Currency', type: 'select2', 'remote-source': ['CurrencyType', 'code', 'name'] }],
|
|
['min_salary', { label: 'Min Salary', type: 'text', validation: 'float' }],
|
|
['max_salary', { label: 'Max Salary', type: 'text', validation: 'float' }],
|
|
];
|
|
}
|
|
|
|
getTableColumns() {
|
|
return [
|
|
{
|
|
title: 'Name',
|
|
dataIndex: 'name',
|
|
sorter: true,
|
|
},
|
|
{
|
|
title: 'Currency',
|
|
dataIndex: 'currency',
|
|
},
|
|
{
|
|
title: 'Min Salary',
|
|
dataIndex: 'min_salary',
|
|
},
|
|
{
|
|
title: 'Max Salary',
|
|
dataIndex: 'max_salary',
|
|
},
|
|
];
|
|
}
|
|
|
|
doCustomValidation(params) {
|
|
try {
|
|
if (parseFloat(params.min_salary) > parseFloat(params.max_salary)) {
|
|
return 'Min Salary should be smaller than Max Salary';
|
|
}
|
|
} catch (e) {
|
|
// D/N
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* EmploymentStatusAdapter
|
|
*/
|
|
|
|
class EmploymentStatusAdapter extends ReactModalAdapterBase {
|
|
getDataMapping() {
|
|
return [
|
|
'id',
|
|
'name',
|
|
'description',
|
|
];
|
|
}
|
|
|
|
getHeaders() {
|
|
return [
|
|
{ sTitle: 'ID' },
|
|
{ sTitle: 'Name' },
|
|
{ sTitle: 'Description' },
|
|
];
|
|
}
|
|
|
|
getFormFields() {
|
|
return [
|
|
['id', { label: 'ID', type: 'hidden' }],
|
|
['name', { label: 'Employment Status', type: 'text' }],
|
|
['description', { label: 'Description', type: 'textarea', validation: '' }],
|
|
];
|
|
}
|
|
|
|
getTableColumns() {
|
|
return [
|
|
{
|
|
title: 'Employment Status',
|
|
dataIndex: 'name',
|
|
sorter: true,
|
|
},
|
|
{
|
|
title: 'Description',
|
|
dataIndex: 'description',
|
|
},
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = { JobTitleAdapter, PayGradeAdapter, EmploymentStatusAdapter };
|