-
Notifications
You must be signed in to change notification settings - Fork 324
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 command pa app permission list
#5166
Conversation
Thank you, will try to review it ASAP |
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.
Good start, let's change a few things before we proceed.
permissions.forEach(permission => { | ||
permission.roleName = permission.properties.roleName; | ||
permission.principalId = permission.properties.principal.id; | ||
permission.principalType = permission.properties.principal.type; | ||
}); |
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 do this only when it's really needed (when the output should be trimmed).
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.
I was wondering, what are you meaning exactly with when the output should be trimmed
.
Currently, we have the method Cli.shouldTrimOutput
, which will only trim the output when we use --output text
, but that results in the following when using --output md
or --output csv
In this case, wouldn't it be better if we do args.options.output !== json
, then the output would be like this:
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.
shouldTrimOutput
was made so we didn't have to check each command separately when we had to modify the result. And I kinda agree that the CSV and MD output for this command is ... not so ideal indeed.
@pnp/cli-for-microsoft-365-maintainers what is the way to go right now? Just use Cli.shouldTrimOutput(...)
and leave the CSV and MD output scarce as shown above?
@martinlingstuyl I know you changed some stuff about the output. Maybe you could clarify it a bit?
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.
Hi @milanholemans, @MathijsVerbeeck, we changed two things about the output:
- All columns should be shown in md and csv output. (They were trimmed before)
- Do not show nested objects in csv and md uitput, unless expressly requested using jmespath.
In this scenario, the question is what you would want to show; if the nested properties are really important to always show, and you don't want to change the api responses in json mode, you could of course flatten the object when output !== 'json'
, like Mathijs suggests.
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.
So that means that the function Cli.shouldTrimOutput(...)
has no use anymore?
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.
I'm not sure if you can say that without looking at where it's used. There may be valid use cases.
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.
But in this instance at least, you don't need it.
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.
I'm not sure if you can say that without looking at where it's used. There may be valid use cases.
At this point I think it has outlived its usefulness unless we add csv
and md
again.
Hi Milan Thanks for the review. I've changed your remarks (and left a comment at two remarks). Could you, if you have no further questions or remarks, have another look? Of we change our decision regarding the trimming of the output, I'll obviously change it 😉 |
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.
We're almost there @MathijsVerbeeck, let's do a couple more changes before we merge it.
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.
Looks good! Ready to be shipped!
Merged manually. Thank you for this awesome new command! 👏 |
Closes #4645