Fix display issue with AccountID before Operation & other small fixes

This commit is contained in:
Jan Oberhauser 2021-04-02 18:10:22 +02:00
parent 7995bd610d
commit b406d4b60b
11 changed files with 126 additions and 125 deletions

View file

@ -199,13 +199,6 @@ export const clientFields = [
}, },
default: {}, default: {},
options: [ options: [
{
displayName: 'Is Active',
name: 'is_active',
type: 'string',
default: '',
description: 'Whether the client is active, or archived. Defaults to true.',
},
{ {
displayName: 'Address', displayName: 'Address',
name: 'address', name: 'address',
@ -220,6 +213,13 @@ export const clientFields = [
default: '', default: '',
description: 'The currency used by the estimate. If not provided, the clients currency will be used. See a list of supported currencies', description: 'The currency used by the estimate. If not provided, the clients currency will be used. See a list of supported currencies',
}, },
{
displayName: 'Is Active',
name: 'is_active',
type: 'string',
default: '',
description: 'Whether the client is active, or archived. Defaults to true.',
},
], ],
}, },

View file

@ -214,20 +214,6 @@ export const contactFields = [
}, },
default: {}, default: {},
options: [ options: [
{
displayName: 'Last Name',
name: 'last_name',
type: 'string',
default: '',
description: 'The last name of the contact.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'The title of the contact.',
},
{ {
displayName: 'Email', displayName: 'Email',
name: 'email', name: 'email',
@ -236,11 +222,18 @@ export const contactFields = [
description: 'The contacts email address.', description: 'The contacts email address.',
}, },
{ {
displayName: 'Phone Office', displayName: 'Fax',
name: 'phone_office', name: 'fax',
type: 'string', type: 'string',
default: '', default: '',
description: 'The contacts office phone number.', description: 'The contacts fax number.',
},
{
displayName: 'Last Name',
name: 'last_name',
type: 'string',
default: '',
description: 'The last name of the contact.',
}, },
{ {
displayName: 'Phone Mobile', displayName: 'Phone Mobile',
@ -250,11 +243,19 @@ export const contactFields = [
description: 'The contacts mobile phone number.', description: 'The contacts mobile phone number.',
}, },
{ {
displayName: 'Fax', displayName: 'Phone Office',
name: 'fax', name: 'phone_office',
type: 'string', type: 'string',
default: '', default: '',
description: 'The contacts fax number.', description: 'The contacts office phone number.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'The title of the contact.',
}, },
], ],
}, },
@ -300,6 +301,20 @@ export const contactFields = [
default: '', default: '',
description: 'The ID of the client associated with this contact.', description: 'The ID of the client associated with this contact.',
}, },
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
description: 'The contacts email address.',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
description: 'The contacts fax number.',
},
{ {
displayName: 'First Name', displayName: 'First Name',
name: 'first_name', name: 'first_name',
@ -315,18 +330,11 @@ export const contactFields = [
description: 'The last name of the contact.', description: 'The last name of the contact.',
}, },
{ {
displayName: 'Title', displayName: 'Phone Mobile',
name: 'title', name: 'phone_mobile',
type: 'string', type: 'string',
default: '', default: '',
description: 'The title of the contact.', description: 'The contacts mobile phone number.',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
description: 'The contacts email address.',
}, },
{ {
displayName: 'Phone Office', displayName: 'Phone Office',
@ -336,18 +344,11 @@ export const contactFields = [
description: 'The contacts office phone number.', description: 'The contacts office phone number.',
}, },
{ {
displayName: 'Phone Mobile', displayName: 'Title',
name: 'phone_mobile', name: 'title',
type: 'string', type: 'string',
default: '', default: '',
description: 'The contacts mobile phone number.', description: 'The title of the contact.',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
description: 'The contacts fax number.',
}, },
], ],
}, },

View file

@ -175,17 +175,6 @@ export class Harvest implements INodeType {
description: 'The resource to operate on.', description: 'The resource to operate on.',
}, },
{
displayName: 'Account ID',
name: 'accountId',
type: 'options',
required: true,
typeOptions: {
loadOptionsMethod: 'getAccounts',
},
default: '',
},
// operations // operations
...clientOperations, ...clientOperations,
...companyOperations, ...companyOperations,
@ -198,6 +187,17 @@ export class Harvest implements INodeType {
...timeEntryOperations, ...timeEntryOperations,
...userOperations, ...userOperations,
{
displayName: 'Account ID',
name: 'accountId',
type: 'options',
required: true,
typeOptions: {
loadOptionsMethod: 'getAccounts',
},
default: '',
},
// fields // fields
...clientFields, ...clientFields,
...contactFields, ...contactFields,

View file

@ -114,20 +114,6 @@ export const invoiceFields = [
default: '', default: '',
description: 'Only return time entries belonging to the client with the given ID.', description: 'Only return time entries belonging to the client with the given ID.',
}, },
{
displayName: 'Project ID',
name: 'project_id',
type: 'string',
default: '',
description: 'Only return time entries belonging to the client with the given ID.',
},
{
displayName: 'Updated Since',
name: 'updated_since',
type: 'dateTime',
default: '',
description: 'Only return time entries that have been updated since the given date and time.',
},
{ {
displayName: 'From', displayName: 'From',
name: 'from', name: 'from',
@ -136,11 +122,21 @@ export const invoiceFields = [
description: 'Only return time entries with a spent_date on or after the given date.', description: 'Only return time entries with a spent_date on or after the given date.',
}, },
{ {
displayName: 'To', displayName: 'Page',
name: 'to', name: 'page',
type: 'dateTime', type: 'number',
typeOptions: {
minValue: 1,
},
default: 1,
description: 'The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)',
},
{
displayName: 'Project ID',
name: 'project_id',
type: 'string',
default: '', default: '',
description: 'Only return time entries with a spent_date on or before the given date.', description: 'Only return time entries belonging to the client with the given ID.',
}, },
{ {
displayName: 'State', displayName: 'State',
@ -168,14 +164,19 @@ export const invoiceFields = [
description: 'Only return invoices with a state matching the value provided. Options: draft, open, paid, or closed.', description: 'Only return invoices with a state matching the value provided. Options: draft, open, paid, or closed.',
}, },
{ {
displayName: 'Page', displayName: 'To',
name: 'page', name: 'to',
type: 'number', type: 'dateTime',
typeOptions: { default: '',
minValue: 1, description: 'Only return time entries with a spent_date on or before the given date.',
}, },
default: 1,
description: 'The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)', {
displayName: 'Updated Since',
name: 'updated_since',
type: 'dateTime',
default: '',
description: 'Only return time entries that have been updated since the given date and time.',
}, },
], ],
}, },

View file

@ -580,7 +580,6 @@ export const projectFields = [
default: false, default: false,
description: 'Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false.', description: 'Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false.',
}, },
{ {
displayName: 'Starts On', displayName: 'Starts On',
name: 'starts_on', name: 'starts_on',

View file

@ -221,13 +221,6 @@ export const taskFields = [
default: 0, default: 0,
description: 'The default hourly rate to use for this task when it is added to a project. Defaults to 0.', description: 'The default hourly rate to use for this task when it is added to a project. Defaults to 0.',
}, },
{
displayName: 'Is Default',
name: 'is_default',
type: 'boolean',
default: false,
description: 'Whether this task should be automatically added to future projects. Defaults to false.',
},
{ {
displayName: 'Is Active', displayName: 'Is Active',
name: 'is_active', name: 'is_active',
@ -235,8 +228,16 @@ export const taskFields = [
default: true, default: true,
description: 'Whether this task is active or archived. Defaults to true', description: 'Whether this task is active or archived. Defaults to true',
}, },
{
displayName: 'Is Default',
name: 'is_default',
type: 'boolean',
default: false,
description: 'Whether this task should be automatically added to future projects. Defaults to false.',
},
], ],
}, },
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* task:update */ /* task:update */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */

View file

@ -153,6 +153,16 @@ export const timeEntryFields = [
default: true, default: true,
description: 'Pass true to only return running time entries and false to return non-running time entries.', description: 'Pass true to only return running time entries and false to return non-running time entries.',
}, },
{
displayName: 'Page',
name: 'page',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 1,
description: 'The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)',
},
{ {
displayName: 'To', displayName: 'To',
name: 'to', name: 'to',
@ -167,16 +177,6 @@ export const timeEntryFields = [
default: '', default: '',
description: 'Only return time entries that have been updated since the given date and time.', description: 'Only return time entries that have been updated since the given date and time.',
}, },
{
displayName: 'Page',
name: 'page',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 1,
description: 'The page number to use in pagination. For instance, if you make a list request and receive 100 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1)',
},
{ {
displayName: 'User ID', displayName: 'User ID',
name: 'user_id', name: 'user_id',

View file

@ -246,13 +246,6 @@ export const userFields = [
}, },
default: {}, default: {},
options: [ options: [
{
displayName: 'Can Create Projects',
name: 'can_create_projects',
type: 'boolean',
default: false,
description: 'Whether the user can create projects. Only applicable to Project Managers.',
},
{ {
displayName: 'Can Create Invoices', displayName: 'Can Create Invoices',
name: 'can_create_invoices', name: 'can_create_invoices',
@ -260,6 +253,13 @@ export const userFields = [
default: false, default: false,
description: 'Whether the user can create invoices. Only applicable to Project Managers.', description: 'Whether the user can create invoices. Only applicable to Project Managers.',
}, },
{
displayName: 'Can Create Projects',
name: 'can_create_projects',
type: 'boolean',
default: false,
description: 'Whether the user can create projects. Only applicable to Project Managers.',
},
{ {
displayName: 'Can See Rates', displayName: 'Can See Rates',
name: 'can_see_rates', name: 'can_see_rates',
@ -346,7 +346,6 @@ export const userFields = [
], ],
}, },
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* user:update */ /* user:update */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
@ -381,13 +380,6 @@ export const userFields = [
}, },
default: {}, default: {},
options: [ options: [
{
displayName: 'Can Create Projects',
name: 'can_create_projects',
type: 'boolean',
default: false,
description: 'Whether the user can create projects. Only applicable to Project Managers.',
},
{ {
displayName: 'Can Create Invoices', displayName: 'Can Create Invoices',
name: 'can_create_invoices', name: 'can_create_invoices',
@ -395,6 +387,13 @@ export const userFields = [
default: false, default: false,
description: 'Whether the user can create invoices. Only applicable to Project Managers.', description: 'Whether the user can create invoices. Only applicable to Project Managers.',
}, },
{
displayName: 'Can Create Projects',
name: 'can_create_projects',
type: 'boolean',
default: false,
description: 'Whether the user can create projects. Only applicable to Project Managers.',
},
{ {
displayName: 'Can See Rates', displayName: 'Can See Rates',
name: 'can_see_rates', name: 'can_see_rates',