Files
Automata/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/sharedDescription.ts
Iván Ovejero 0448feec56 refactor: Apply eslint-plugin-n8n-nodes-base autofixable rules (#3174)
*  Initial setup

* 👕 Update `.eslintignore`

* 👕 Autofix node-param-default-missing (#3173)

* 🔥 Remove duplicate key

* 👕 Add exceptions

* 📦 Update package-lock.json

* 👕 Apply `node-class-description-inputs-wrong-trigger-node` (#3176)

* 👕 Apply `node-class-description-inputs-wrong-regular-node` (#3177)

* 👕 Apply `node-class-description-outputs-wrong` (#3178)

* 👕 Apply `node-execute-block-double-assertion-for-items` (#3179)

* 👕 Apply `node-param-default-wrong-for-collection` (#3180)

* 👕 Apply node-param-default-wrong-for-boolean (#3181)

* Autofixed default missing

* Autofixed booleans, worked well

*  Fix params

*  Undo exempted autofixes

* 📦 Update package-lock.json

* 👕 Apply node-class-description-missing-subtitle (#3182)

*  Fix missing comma

* 👕 Apply `node-param-default-wrong-for-fixed-collection` (#3184)

* 👕 Add exception for `node-class-description-missing-subtitle`

* 👕 Apply `node-param-default-wrong-for-multi-options` (#3185)

* 👕 Apply `node-param-collection-type-unsorted-items` (#3186)

* Missing coma

* 👕 Apply `node-param-default-wrong-for-simplify` (#3187)

* 👕 Apply `node-param-description-comma-separated-hyphen` (#3190)

* 👕 Apply `node-param-description-empty-string` (#3189)

* 👕 Apply `node-param-description-excess-inner-whitespace` (#3191)

* Rule looks good

* Add whitespace rule in eslint config

* :zao: fix

* 👕 Apply `node-param-description-identical-to-display-name` (#3193)

* 👕 Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195)

*  Revert ":zao: fix"

This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c.

* 👕 Apply `node-param-description-missing-for-simplify`  (#3196)

* 👕 Apply `node-param-description-missing-final-period` (#3194)

* Rule working as intended

* Add rule to eslint

* 👕 Apply node-param-description-missing-for-return-all (#3197)

*  Restore `lintfix` command

Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: agobrech <ael.gobrecht@gmail.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 18:29:51 +02:00

351 lines
5.7 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] => {
let elements = [
{
displayName: 'Address',
name: 'addasasress',
placeholder: 'Address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'value',
displayName: 'Address',
values: [
{
displayName: 'Line 1',
name: 'address1',
type: 'string',
default: '',
},
{
displayName: 'Line 2',
name: 'address2',
type: 'string',
default: '',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
placeholder: 'Florida',
description: 'The full name of the state/province',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
placeholder: 'United States',
description: 'The name of the country. Must exist in the BambooHr country list.',
},
],
},
],
},
{
displayName: 'Date of Birth',
name: 'dateOfBirth',
type: 'dateTime',
default: '',
},
{
displayName: 'Department',
name: 'department',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getDepartments',
},
default: '',
},
{
displayName: 'Division',
name: 'division',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getDivisions',
},
default: '',
},
{
displayName: 'Employee Number',
name: 'employeeNumber',
type: 'string',
default: '',
},
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
displayOptions: {
show: {
'synced': [
false,
],
},
},
default: '',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
displayOptions: {
show: {
'synced': [
false,
],
},
},
default: '',
},
{
displayName: 'FLSA Overtime Status',
name: 'exempt',
type: 'options',
options: [
{
name: 'Exempt',
value: 'exempt',
},
{
name: 'Non-exempt',
value: 'non-exempt',
},
],
default: '',
},
{
displayName: 'Gender',
name: 'gender',
type: 'options',
options: [
{
name: 'Female',
value: 'female',
},
{
name: 'Male',
value: 'male',
},
],
default: '',
},
{
displayName: 'Hire Date',
name: 'hireDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Location',
name: 'location',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getEmployeeLocations',
},
default: '',
},
{
displayName: 'Marital Status',
name: 'maritalStatus',
type: 'options',
options: [
{
name: 'Single',
value: 'single',
},
{
name: 'Married',
value: 'married',
},
{
name: 'Domestic Partnership',
value: 'domesticPartnership',
},
],
default: '',
},
{
displayName: 'Mobile Phone',
name: 'mobilePhone',
type: 'string',
default: '',
},
{
displayName: 'Pay Per',
name: 'paidPer',
type: 'options',
options: [
{
name: 'Hour',
value: 'hour',
},
{
name: 'Day',
value: 'day',
},
{
name: 'Week',
value: 'week',
},
{
name: 'Month',
value: 'month',
},
{
name: 'Quater',
value: 'quater',
},
{
name: 'Year',
value: 'year',
},
],
default: '',
},
{
displayName: 'Pay Rate',
name: 'payRate',
placeholder: 'Add Pay Rate',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
default: {},
options: [
{
name: 'value',
displayName: 'Pay Rate',
values: [
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
placeholder: '20.00',
},
{
displayName: 'Currency',
name: 'currency',
type: 'string',
default: '',
placeholder: 'USD',
},
],
},
],
},
{
displayName: 'Pay Type',
name: 'payType',
type: 'options',
options: [
{
name: 'Hourly',
value: 'hourly',
},
{
name: 'Salary',
value: 'salary',
},
{
name: 'Commission',
value: 'commission',
},
{
name: 'Exception Hourly',
value: 'exceptionHourly',
},
{
name: 'Monthly',
value: 'monthly',
},
{
name: 'Weekly',
value: 'weekly',
},
{
name: 'Piece Rate',
value: 'pieceRate',
},
{
name: 'Contract',
value: 'contract',
},
{
name: 'Daily',
value: 'daily',
},
{
name: 'Pro Rata',
value: 'proRata',
},
],
default: '',
},
{
displayName: 'Preferred Name',
name: 'preferredName',
type: 'string',
default: '',
},
{
displayName: 'Social Security Number',
name: 'ssn',
type: 'string',
default: '',
placeholder: '123-45-6789',
description: 'A standard United States Social Security number, with dashes',
},
] as INodeProperties[];
if (sync === true) {
elements = elements.map(element => {
return Object.assign(element, {
displayOptions: {
show: {
resource: [
'employee',
],
operation: [
'update',
],
synced: [
true,
],
},
},
required: true,
});
});
return elements;
} else {
elements = elements.map(element => {
return Object.assign(element, {
displayOptions: {
show: {
'/synced': [
false,
],
},
},
});
});
}
return elements;
};