-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
153 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
components/microsoft_365_planner/actions/list-user-tasks/list-user-tasks.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import app from "../../microsoft_365_planner.app.mjs"; | ||
|
||
export default { | ||
key: "microsoft_365_planner-list-user-tasks", | ||
name: "List User Tasks", | ||
description: "List all user tasks in Microsoft 365 Planner. [See the documentation](https://learn.microsoft.com/en-us/graph/api/planneruser-list-tasks?view=graph-rest-1.0&tabs=http)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.app.listUserTasks({ | ||
$, | ||
}); | ||
|
||
$.export("$summary", `Successfully retrieved \`${response?.value?.length}\` task(s).`); | ||
|
||
return response; | ||
}, | ||
}; |
91 changes: 91 additions & 0 deletions
91
components/microsoft_365_planner/actions/update-task/update-task.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import app from "../../microsoft_365_planner.app.mjs"; | ||
|
||
export default { | ||
key: "microsoft_365_planner-update-task", | ||
name: "Update Task", | ||
description: "Updates a task in Microsoft 365 Planner. [See the documentation](https://learn.microsoft.com/en-us/graph/api/plannertask-update?view=graph-rest-1.0&tabs=http)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
taskId: { | ||
propDefinition: [ | ||
app, | ||
"userTaskId", | ||
], | ||
}, | ||
title: { | ||
type: "string", | ||
label: "Title", | ||
description: "Title of the task", | ||
optional: true, | ||
}, | ||
priority: { | ||
type: "integer", | ||
label: "Priority", | ||
description: "Priority of the task. The valid range of values is between `0` and `10`, with the increasing value being lower priority (`0` has the highest priority and `10` has the lowest priority)", | ||
optional: true, | ||
min: 0, | ||
max: 10, | ||
}, | ||
percentComplete: { | ||
type: "integer", | ||
label: "Percent Complete", | ||
description: "Percentage of task completion. When set to `100`, the task is considered completed.", | ||
optional: true, | ||
}, | ||
startDateTime: { | ||
type: "string", | ||
label: "Start Date Time", | ||
description: "Date and time at which the task starts. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`.", | ||
optional: true, | ||
}, | ||
}, | ||
methods: { | ||
updateTask({ | ||
taskId, ...args | ||
} = {}) { | ||
return this.app._makeRequest({ | ||
method: "PATCH", | ||
path: `/planner/tasks/${taskId}`, | ||
...args, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
app, | ||
updateTask, | ||
taskId, | ||
title, | ||
priority, | ||
percentComplete, | ||
startDateTime, | ||
} = this; | ||
|
||
const { ["@odata.etag"]: etag } = await app.getTask({ | ||
$, | ||
taskId, | ||
}); | ||
|
||
const response = await updateTask({ | ||
$, | ||
taskId, | ||
headers: { | ||
"Content-Type": "application/json", | ||
"If-Match": etag, | ||
"Prefer": "return=representation", | ||
}, | ||
data: { | ||
title, | ||
priority, | ||
percentComplete, | ||
startDateTime, | ||
}, | ||
}); | ||
|
||
$.export("$summary", `Successfully updated task with ID \`${response.id}\`.`); | ||
|
||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.