mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Renamed Additional Field to Update Fields
Removed Workspace from Update Fields Renamed Update Project to Update Changed Project Type options under update to string for name Added Workspace as a requirement to update projects and as a load dependency Removed Workspace from actual updating
This commit is contained in:
parent
3afacff564
commit
71c3b91b45
|
@ -1494,7 +1494,7 @@ export class Asana implements INodeType {
|
||||||
description: 'Get all projects',
|
description: 'Get all projects',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Update Project',
|
name: 'Update',
|
||||||
value: 'update',
|
value: 'update',
|
||||||
description: 'Update a project',
|
description: 'Update a project',
|
||||||
},
|
},
|
||||||
|
@ -1766,39 +1766,43 @@ export class Asana implements INodeType {
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getWorkspaces',
|
loadOptionsMethod: 'getWorkspaces',
|
||||||
},
|
},
|
||||||
|
options: [],
|
||||||
|
default: '',
|
||||||
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
|
||||||
'project',
|
|
||||||
],
|
|
||||||
operation: [
|
operation: [
|
||||||
'update',
|
'update',
|
||||||
],
|
],
|
||||||
|
resource: [
|
||||||
|
'project',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
description: 'The workspace in which to get users.',
|
||||||
description: 'The workspace to create the project in',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Project',
|
displayName: 'Project',
|
||||||
name: 'projectId',
|
name: 'projectId',
|
||||||
type: 'options',
|
type: 'string',
|
||||||
|
options: [],
|
||||||
|
default: '',
|
||||||
|
required: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
|
||||||
'project',
|
|
||||||
],
|
|
||||||
operation: [
|
operation: [
|
||||||
'update',
|
'update',
|
||||||
],
|
],
|
||||||
|
resource: [
|
||||||
|
'project',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
|
||||||
description: 'The project to update info on.',
|
description: 'The project to update info on.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Update Fields',
|
||||||
name: 'additionalFields',
|
name: 'updateFields',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -1826,7 +1830,7 @@ export class Asana implements INodeType {
|
||||||
name: 'due_on',
|
name: 'due_on',
|
||||||
type: 'dateTime',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The day on which this project is due. This takes a date with format YYYY-MM-DD.\n',
|
description: 'The day on which this project is due. This takes a date with format YYYY-MM-DD.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Name',
|
displayName: 'Name',
|
||||||
|
@ -1854,6 +1858,9 @@ export class Asana implements INodeType {
|
||||||
name: 'team',
|
name: 'team',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'workspace',
|
||||||
|
],
|
||||||
loadOptionsMethod: 'getTeams',
|
loadOptionsMethod: 'getTeams',
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -2531,33 +2538,30 @@ export class Asana implements INodeType {
|
||||||
// project:update
|
// project:update
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
const projectId = this.getNodeParameter('projectId', i) as string;
|
const projectId = this.getNodeParameter('projectId', i) as string;
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||||
|
|
||||||
// request parameters
|
// request parameters
|
||||||
requestMethod = 'PUT';
|
requestMethod = 'PUT';
|
||||||
endpoint = `/projects/${projectId}`;
|
endpoint = `/projects/${projectId}`;
|
||||||
|
|
||||||
// optional parameters
|
// optional parameters
|
||||||
if (additionalFields.color) {
|
if (updateFields.color) {
|
||||||
qs.color = additionalFields.color;
|
qs.color = updateFields.color;
|
||||||
}
|
}
|
||||||
if (additionalFields.due_on) {
|
if (updateFields.due_on) {
|
||||||
qs.due_on = additionalFields.due_on;
|
qs.due_on = updateFields.due_on;
|
||||||
}
|
}
|
||||||
if (additionalFields.name) {
|
if (updateFields.name) {
|
||||||
body.name = additionalFields.name;
|
body.name = updateFields.name;
|
||||||
}
|
}
|
||||||
if (additionalFields.notes) {
|
if (updateFields.notes) {
|
||||||
qs.notes = additionalFields.notes;
|
qs.notes = updateFields.notes;
|
||||||
}
|
}
|
||||||
if (additionalFields.owner) {
|
if (updateFields.owner) {
|
||||||
body.owner = additionalFields.owner;
|
body.owner = updateFields.owner;
|
||||||
}
|
}
|
||||||
if (additionalFields.team) {
|
if (updateFields.team) {
|
||||||
body.team = additionalFields.team;
|
body.team = updateFields.team;
|
||||||
}
|
|
||||||
if (additionalFields.workspace) {
|
|
||||||
body.workspace = additionalFields.workspace;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
responseData = await asanaApiRequest.call(this, requestMethod, endpoint, body, qs);
|
responseData = await asanaApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||||
|
|
Loading…
Reference in a new issue