-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds 'todo list set' command. Closes #1612 #1615
Conversation
091a042
to
2137f25
Compare
👏 Cool! We'll review it shortly |
This pull request has been converted to More Information |
The To Do APIs have now been officially released to the Graph Beta endpoint with documentation, so this PR can now be progressed. https://docs.microsoft.com/en-us/graph/api/resources/todo-overview?view=graph-rest-beta |
@waldekmastykarz For this, the API endpoint and payload are still identical, this can be refactored to align the CLI v3 changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done with a few adjustments I did when merging the PR 👍
|
||
request | ||
.patch(requestOptions) | ||
.then((res: any): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not using the response for anything, we don't need to specify it here
|
||
public getTelemetryProperties(args: CommandArgs): any { | ||
const telemetryProps: any = super.getTelemetryProperties(args); | ||
telemetryProps.name = typeof args.options.name !== 'undefined'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both properties are required, so there is no point in including them in the telemetry because they would always have value of true
description: `The ID of the list to update` | ||
}, | ||
{ | ||
option: '-n, --name <name>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update this property to newName
. In the future we want to allow users to retrieve resources by their name, so to avoid breaking changes in the future, let's pick a neutral name for this option.
` | ||
Examples: | ||
|
||
Rename the list with Id "AAMkAGI3NDhlZmQzLWQxYjAtNGJjNy04NmYwLWQ0M2IzZTNlMDUwNAAuAAAAAACQ1l2jfH6VSZraktP8Z7auAQCbV93BagWITZhL3J6BMqhjAAD9pHIhAAA=" to "My updated task list" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be indented further
assert.notEqual(command.description, null); | ||
}); | ||
|
||
it('updates a To Do task', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates a list, not a task
}); | ||
}); | ||
|
||
it('updates a To Do task (verbose)', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates To Do list, not a task
options: { | ||
debug: false, | ||
id: "AAMkAGI3NDhlZmQzLWQxYjAtNGJjNy04NmYwLWQ0M2IzZTNlMDUwNAAuAAAAAACQ1l2jfH6VSZraktP8Z7auAQCbV93BagWITZhL3J6BMqhjAAD9pHIjAAA=", | ||
name: null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In JS not set means undefined
, not null
const actual = (command.validate() as CommandValidate)({ | ||
options: { | ||
debug: false, | ||
id: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In JS not set means undefined
, not null
Merged manually. Thank you! 🚀 👏 |
Closes #1612