feat(Microsoft Teams Node): Enhancements and cleanup (#2940)

* Enhancements and cleanup for MS Teams node

- Add option to limit groups to "member of" rather than whole directory
  - Defaults to "all" for compatibility
- Add option to Get All tasks to pull from a plan instead of just a group member
  - Defaults to "member" for compatibility
- Added in auto completiong for plans, buckets, labels and members in update fields for tasks
- Update descriptions and normalize quotes for descriptions and display names

* Bump MS Teams version number

*  fixed version

* 🔨 small fixes

* 🔨 fixed nodelinter issues

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Ryan Goggin
2022-04-25 05:22:16 -04:00
committed by GitHub
parent ff26a987fe
commit d446f9e281
5 changed files with 220 additions and 57 deletions

View File

@@ -7,6 +7,7 @@ export const taskOperations: INodeProperties[] = [
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
@@ -42,15 +43,47 @@ export const taskOperations: INodeProperties[] = [
},
],
default: 'create',
description: 'The operation to perform.',
},
];
export const taskFields: INodeProperties[] = [
{
displayName: 'Group Source',
name: 'groupSource',
required: true,
type: 'options',
default: 'all',
displayOptions: {
show: {
operation: [
'getAll',
'create',
'update',
],
resource: [
'task',
],
},
},
options: [
{
name: 'All Groups',
value: 'all',
description: 'From all groups',
},
{
name: 'My Groups',
value: 'mine',
description: 'Only load groups that account is member of',
},
],
},
/* -------------------------------------------------------------------------- */
/* task:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Group ID',
name: 'groupId',
@@ -58,6 +91,9 @@ export const taskFields: INodeProperties[] = [
type: 'options',
typeOptions: {
loadOptionsMethod: 'getGroups',
loadOptionsDependsOn: [
'groupSource',
],
},
displayOptions: {
show: {
@@ -93,7 +129,7 @@ export const taskFields: INodeProperties[] = [
},
},
default: '',
description: 'The ID of the Plan.',
description: 'The plan for the task to belong to',
},
{
displayName: 'Bucket ID',
@@ -117,7 +153,7 @@ export const taskFields: INodeProperties[] = [
},
},
default: '',
description: 'The ID of the Bucket.',
description: 'The bucket for the task to belong to',
},
{
displayName: 'Title',
@@ -135,7 +171,7 @@ export const taskFields: INodeProperties[] = [
},
},
default: '',
description: 'Title of the task.',
description: 'Title of the task',
},
{
displayName: 'Additional Fields',
@@ -165,14 +201,14 @@ export const taskFields: INodeProperties[] = [
],
},
default: '',
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
description: 'Who the task should be assigned to',
},
{
displayName: 'Due Date Time',
name: 'dueDateTime',
type: 'dateTime',
default: '',
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
description: 'Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.',
},
{
displayName: 'Labels',
@@ -185,7 +221,7 @@ export const taskFields: INodeProperties[] = [
],
},
default: [],
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
description: 'Labels to assign to the task',
},
{
displayName: 'Percent Complete',
@@ -196,7 +232,7 @@ export const taskFields: INodeProperties[] = [
maxValue: 100,
},
default: 0,
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
description: 'Percentage of task completion. When set to 100, the task is considered completed.',
},
],
},
@@ -246,6 +282,36 @@ export const taskFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* task:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Tasks For',
name: 'tasksFor',
default: 'member',
required: true,
type: 'options',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'task',
],
},
},
options: [
{
name: 'Group Member',
value: 'member',
description: 'Tasks assigned to group member',
},
{
name: 'Plan',
value: 'plan',
description: 'Tasks in group plan',
},
],
},
{
displayName: 'Group ID',
name: 'groupId',
@@ -253,6 +319,9 @@ export const taskFields: INodeProperties[] = [
type: 'options',
typeOptions: {
loadOptionsMethod: 'getGroups',
loadOptionsDependsOn: [
'groupSource',
],
},
displayOptions: {
show: {
@@ -285,6 +354,35 @@ export const taskFields: INodeProperties[] = [
resource: [
'task',
],
tasksFor: [
'member',
],
},
},
default: '',
},
{
displayName: 'Plan ID',
name: 'planId',
required: false,
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPlans',
loadOptionsDependsOn: [
'groupId',
],
},
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'task',
],
tasksFor: [
'plan',
],
},
},
default: '',
@@ -304,7 +402,7 @@ export const taskFields: INodeProperties[] = [
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
@@ -327,8 +425,8 @@ export const taskFields: INodeProperties[] = [
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'How many results to return.',
default: 50,
description: 'Max number of results to return',
},
/* -------------------------------------------------------------------------- */
@@ -350,7 +448,7 @@ export const taskFields: INodeProperties[] = [
},
},
default: '',
description: 'The ID of the Task.',
description: 'The ID of the Task',
},
{
displayName: 'Update Fields',
@@ -380,26 +478,38 @@ export const taskFields: INodeProperties[] = [
],
},
default: '',
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
description: 'Who the task should be assigned to',
},
{
displayName: 'Bucket ID',
name: 'bucketId',
type: 'string',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getBuckets',
loadOptionsDependsOn: [
'updateFields.planId',
],
},
default: '',
description: 'Channel name as it will appear to the user in Microsoft Teams.',
description: 'The bucket for the task to belong to',
},
{
displayName: 'Due Date Time',
name: 'dueDateTime',
type: 'dateTime',
default: '',
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
description: 'Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.',
},
{
displayName: 'Group ID',
name: 'groupId',
type: 'string',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getGroups',
loadOptionsDependsOn: [
'groupSource',
],
},
default: '',
},
{
@@ -409,11 +519,11 @@ export const taskFields: INodeProperties[] = [
typeOptions: {
loadOptionsMethod: 'getLabels',
loadOptionsDependsOn: [
'planId',
'updateFields.planId',
],
},
default: [],
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
description: 'Labels to assign to the task',
},
{
displayName: 'Percent Complete',
@@ -424,21 +534,27 @@ export const taskFields: INodeProperties[] = [
maxValue: 100,
},
default: 0,
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
description: 'Percentage of task completion. When set to 100, the task is considered completed.',
},
{
displayName: 'Plan ID',
name: 'planId',
type: 'string',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPlans',
loadOptionsDependsOn: [
'groupId',
],
},
default: '',
description: 'Channel name as it will appear to the user in Microsoft Teams.',
description: 'The plan for the task to belong to',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Title of the task.',
description: 'Title of the task',
},
],
},