Skip to content
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

Fixes anomalies for 'tenant people profilecardproperty' commands #5635

Closed
wants to merge 1 commit into from

Conversation

milanholemans
Copy link
Contributor

@milanholemans milanholemans commented Nov 5, 2023

In this PR I made the following changes for tenant people profilecardproperty commands.

  • Removed the double response from the add command docs. We only use multiple responses if the output of the command changes. In this case, an empty array is not a structural output change.
  • Added More information docs section to every page.
  • Ensured that the list command outputs an array instead of an object.
  • For the list command, removed extra response objects. We only display 1 object in the response preview.
  • Made a small refactor in the add command to use a built-in function to get unknown properties.
  • Added correct name casing check for get command.
  • Added unknown options to telemetry for add command.
  • Added tests to validate casing of property names.

@milanholemans milanholemans added pr-bugfix pr-priority Process this PR asap labels Nov 5, 2023
@milanholemans milanholemans added this to the v7.2 milestone Nov 5, 2023
@milanholemans milanholemans force-pushed the pcp-fix branch 2 times, most recently from 7df61d3 to 18d7ab4 Compare November 5, 2023 02:29
Comment on lines +59 to +63
// Get the right casing for the profile card property name
const profileCardProperty = profileCardPropertyNames.find(p => p.toLowerCase() === args.options.name.toLowerCase());

const requestOptions: CliRequestOptions = {
url: `${this.resource}/v1.0/admin/people/profileCardProperties/${args.options.name}`,
url: `${this.resource}/v1.0/admin/people/profileCardProperties/${profileCardProperty}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really enforce the casing for the get command? Folks could always add properties straight to the graph API with their own casing. If they then want to get the property through the CLI they'll get an empty result while it exists with different casing.

The same goes for the remove and set commands.

Copy link
Contributor Author

@milanholemans milanholemans Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but on the other hand if they specify for example FAX in the add command and use the same value for the remove or get command, they will receive an error that the property doesn't exist, which is weird.

In my opinion we do it everywhere or nowhere at all, the commands should work seamlessly together. It's a mess that we have to deal with this indeed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to keep consistent behavior across the commands.

@Adam-it Adam-it self-assigned this Nov 5, 2023
Copy link
Member

@Adam-it Adam-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work 👏
Checked locally ✅

@Adam-it
Copy link
Member

Adam-it commented Nov 5, 2023

Ready to merge 🚀

@Adam-it
Copy link
Member

Adam-it commented Nov 5, 2023

merged manually. Thank you for your awesome work👏
You Rock 🤩

@Adam-it Adam-it closed this Nov 5, 2023
@milanholemans milanholemans deleted the pcp-fix branch November 5, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants