@blickwerk/n8n-nodes-microsoft-planner 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -181,6 +181,11 @@ Tested with n8n version 1.0.0 and above.
|
|
|
181
181
|
|
|
182
182
|
## Version History
|
|
183
183
|
|
|
184
|
+
### 1.2.3
|
|
185
|
+
- Improved error handling for Buckets and Tasks loading
|
|
186
|
+
- Better fallback values when data cannot be loaded
|
|
187
|
+
- Added console logging for debugging dropdown issues
|
|
188
|
+
|
|
184
189
|
### 1.2.2
|
|
185
190
|
- Removed Plan dropdown (Plans cannot be loaded via API)
|
|
186
191
|
- Plan ID is now manual input only
|
|
@@ -46,34 +46,52 @@ class MicrosoftPlanner {
|
|
|
46
46
|
this.methods = {
|
|
47
47
|
loadOptions: {
|
|
48
48
|
async getBuckets() {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
try {
|
|
50
|
+
const planId = this.getNodeParameter('planId', 0);
|
|
51
|
+
if (!planId) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const buckets = await GenericFunctions_1.microsoftApiRequestAllItems.call(this, 'value', 'GET', `/planner/plans/${planId}/buckets`);
|
|
55
|
+
if (!buckets || buckets.length === 0) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
return buckets.map((bucket) => ({
|
|
59
|
+
name: bucket.name || bucket.id,
|
|
60
|
+
value: bucket.id,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error('Error loading buckets:', error);
|
|
51
65
|
return [];
|
|
52
66
|
}
|
|
53
|
-
const buckets = await GenericFunctions_1.microsoftApiRequestAllItems.call(this, 'value', 'GET', `/planner/plans/${planId}/buckets`);
|
|
54
|
-
return buckets.map((bucket) => ({
|
|
55
|
-
name: bucket.name,
|
|
56
|
-
value: bucket.id,
|
|
57
|
-
}));
|
|
58
67
|
},
|
|
59
68
|
async getTasks() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
try {
|
|
70
|
+
const planId = this.getNodeParameter('planId', 0);
|
|
71
|
+
const bucketId = this.getNodeParameter('bucketId', 0);
|
|
72
|
+
let endpoint = '';
|
|
73
|
+
if (bucketId) {
|
|
74
|
+
endpoint = `/planner/buckets/${bucketId}/tasks`;
|
|
75
|
+
}
|
|
76
|
+
else if (planId) {
|
|
77
|
+
endpoint = `/planner/plans/${planId}/tasks`;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
const tasks = await GenericFunctions_1.microsoftApiRequestAllItems.call(this, 'value', 'GET', endpoint);
|
|
83
|
+
if (!tasks || tasks.length === 0) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
return tasks.map((task) => ({
|
|
87
|
+
name: task.title || task.id,
|
|
88
|
+
value: task.id,
|
|
89
|
+
}));
|
|
68
90
|
}
|
|
69
|
-
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.error('Error loading tasks:', error);
|
|
70
93
|
return [];
|
|
71
94
|
}
|
|
72
|
-
const tasks = await GenericFunctions_1.microsoftApiRequestAllItems.call(this, 'value', 'GET', endpoint);
|
|
73
|
-
return tasks.map((task) => ({
|
|
74
|
-
name: task.title,
|
|
75
|
-
value: task.id,
|
|
76
|
-
}));
|
|
77
95
|
},
|
|
78
96
|
},
|
|
79
97
|
};
|