Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8N-2603 BambooHR Node #2471

Merged
merged 57 commits into from Jan 22, 2022
Merged

N8N-2603 BambooHR Node #2471

merged 57 commits into from Jan 22, 2022

Conversation

SchnapsterDog
Copy link
Contributor

@SchnapsterDog SchnapsterDog commented Nov 23, 2021

BambooHR Node

##Here is the list of the tasks related to BambooHR Node. The list should be expanded with new task related to the API operations present in https://documentation.bamboohr.com/docs/getting-started

Tasks:

Employees

  • Add request for all API operation // Employees
  • Get Employee
  • Update Employee
  • Add Employee
  • Get Employee Directory

Employees Files

  • Add requests for all operations / Employee Files
  • List employee files and categories
  • Add Employee File Category
  • Update Employee File
  • Delete Employee File
  • Get an Employee File

Company Files

  • Add requests for all operations // Company Files
  • List company files and categories
  • Add Company File Category
  • Update Company File
  • Delete Company File
  • Get an Company File

Reports

  • Add requests for all operations // Reports
  • Get a company Report

Tabular Data

  • Add requests for all operations // Tabular Data
  • Gets table rows for a given employee and table combination
  • Adds a table row
  • Updates a table row
  • Gets all updated employee table data

Account Information

  • Add request for all Account Information operations
  • Get a list of fields
  • Get a list of tabular fields
  • Get details for liest fields
  • Get a list of users

Time Off

  • Add requests for all operations // Time Off
  • Get Time Off Types
  • Get Time Off Policies
  • Get Time Off Requests
  • Add a Time Off Request
  • Change a Request Status
  • Add a Time Off History Item For Time Off Request
  • Adjust Time Off Balance
  • List Time Off Policies for Employee
  • Assign Time Off Policies for an Employee
  • List Time Off Policies for Employee / v.1.1
  • Assign Time Off Policies for an Employe / v1.1
  • Estimate Future Time Off Balances
  • Get a list of Who's Out

Feel free to test the Draft PR and expand the list below.

###Bugs & Improvements

  • Add Multi choice Property /Editor UI
  • Add list fields (Need for some API Calls)
  • Expand optional Fields when creating Employees
  • Add Selectable / Optional Fields
  • Code Refactor & Three shaking Code
  • Check the responses codes and return string if API is returning empty object on successful request

###TODO

  • When an employee is ‘hired’ in Bamboo, trigger creating a user account in Google admin.
  • When an employee is ‘terminated’ in Bamboo, suspend the account in Google admin.

…Create Request, Create History Item, Fixed Get Types
…Expand and Add new Optional Fields for Creating and Updating Employee, Write Comments, Fixed Employee API operations
… Comments for Employee Files & Company Files & Reports Acc Info API Operation
…employee, Refactor GetDirectoy to GetAll + update the output of the response
@ivov ivov mentioned this pull request Nov 24, 2021
49 tasks
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking this on

Comment on lines 10 to 22
properties = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string' as NodePropertyTypes,
default: '',
},
{
displayName: 'Company name',
name: 'companyName',
type: 'string' as NodePropertyTypes,
default: '',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type properties instead of asserting the type of type. Remember that type assertions override TS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 31 to 51
methods = {
loadOptions: {
async getTimeOffTypeID(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const body = {} as IDataObject;
const requestMethod = 'GET';
const endPoint = 'meta/time_off/types';

const response = await apiRequest.call(this, requestMethod, endPoint, body);
const timeOffTypeIds = response.body.timeOffTypes;

for (const item of timeOffTypeIds) {
returnData.push({
name: item.name,
value: item.id,
});
}
return returnData;
},
},
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the Mattermost node, which has loadOptions in methods as a separate dir.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Created separate dir for it.

const returnData: INodePropertyOptions[] = [];
const body = {} as IDataObject;
const requestMethod = 'GET';
const endPoint = 'meta/time_off/types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endpoint without middle cap, applicable elsewhere as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

loadOptions: {
async getTimeOffTypeID(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const body = {} as IDataObject;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type instead of asserting. Applicable elsewhere as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

packages/nodes-base/nodes/BambooHR/BambooHR.node.ts Outdated Show resolved Hide resolved
description: 'Consume BambooHR API',
defaults: {
name: 'BambooHR',
color: '#73c41d',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

color has been deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

export const versionDescription: INodeTypeDescription = {
displayName: 'BambooHR',
name: 'bambooHR',
icon: 'file:bambooHR.png',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If available, SVGs are preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the old logo was present in svg format. :/

displayName: 'Resource',
name: 'resource',
type: 'options',
options: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetize.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

},
],
default: 'employees',
description: 'The resource to operate on',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'The resource to operate on',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

*/
export async function apiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they all used by your implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed only 'HEAD' form here since we are using GET, POST, PUT and DELETE

@ivov ivov added node/new Creation of an entirely new node n8n team Authored by the n8n team labels Dec 15, 2021
@janober janober merged commit 8cefafa into master Jan 22, 2022
@janober janober deleted the feature/n8n-2603-bamboohr branch January 22, 2022 09:46
@janober
Copy link
Member

janober commented Jan 22, 2022

Great, thanks a lot. Got merged.

@janober
Copy link
Member

janober commented Jan 22, 2022

Got released with n8n@0.160.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/new Creation of an entirely new node
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants