/* 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 './AdapterBase'; /* * CustomFieldAdapter */ class CustomFieldAdapter extends AdapterBase { constructor(endPoint, tab, filter, orderBy) { super(endPoint, tab, filter, orderBy); this.tableType = ''; } getDataMapping() { return [ 'id', 'name', 'display', 'display_order', ]; } getHeaders() { return [ { sTitle: 'ID', bVisible: false }, { sTitle: 'Name' }, { sTitle: 'Display Status' }, { sTitle: 'Priority' }, ]; } getFormFields() { return [ ['id', { label: 'ID', type: 'hidden' }], ['name', { label: 'Name', type: 'text', validation: '' }], ['display', { label: 'Display Status', type: 'select', source: [['Form', 'Show'], ['Hidden', 'Hidden']] }], ['field_type', { label: 'Field Type', type: 'select', source: [['text', 'Text Field'], ['textarea', 'Text Area'], ['select', 'Select'], ['select2', 'Select2'], ['select2multi', 'Multi Select'], ['fileupload', 'File Upload'], ['date', 'Date'], ['datetime', 'Date Time'], ['time', 'Time']] }], ['field_label', { label: 'Field Label', type: 'text', validation: '' }], ['field_validation', { label: 'Validation', type: 'select2', validation: 'none', sort: 'none', 'null-label': 'Required', 'allow-null': true, source: [['none', 'None'], ['number', 'Number'], ['numberOrEmpty', 'Number or Empty'], ['float', 'Decimal'], ['email', 'Email'], ['emailOrEmpty', 'Email or Empty']], }], ['field_options', { label: 'Field Options', type: 'datagroup', form: [ ['label', { label: 'Label', type: 'text', validation: '' }], ['value', { label: 'Value', type: 'text', validation: 'none' }], ], html: '