Cli-microsoft365: Enhancement: in the output, follow the order of properties as defined in `defaultProperties`

Created on 15 Dec 2020  路  3Comments  路  Source: pnp/cli-microsoft365

Description - Display Order Mentioned on the method defaultProperties() not following the order mentioned

In the code base, we recently changed the approach in which default fields are shown in Command shell using the method

  public defaultProperties(): string[] | undefined {
    return ['WorkloadDisplayName', 'StatusDisplayName'];
  }

Current Behavior

Even if we have given the list of fields to be displayed in a specific order, it does not follow the given order. It will just show the results in the same order how the fields are available in the default output.
image

Expected Behavior

It would be good if the output follows the default order given in the defaultpropertiesmethod. If it does not follow, we may have to resort our approach to old approach where check the output and show the results in the needed order which is not an optimum solution since we have refined output mechanism defined now.

_PS : Have created the issue without a template since it is not a bug in the result, but with the code base_

enhancement help wanted

Most helpful comment

Let's see if anyone wants to pick it up earlier. When you have time and if it's still available, it's all yours 馃憦

All 3 comments

Thanks for reporting @arjunumenon. defaultProperties were originally not meant to define the order in which properties are displayed, just define which properties should be included in the output if no JMESPath query has been specified. That said, there is something to say for the output to follow the order in which properties are specified in the defaultProperties property. I think it would make a good enhancement and improve the readability.

Thanks for reporting @arjunumenon. defaultProperties were originally not meant to define the order in which properties are displayed, just define which properties should be included in the output if no JMESPath query has been specified. That said, there is something to say for the output to follow the order in which properties are specified in the defaultProperties property. I think it would make a good enhancement and improve the readability.

Thanks a lot for the response @waldekmastykarz . I was in an assumption that the fields will be shown in the same order how it is mentioned in the Array. Totally understand the thought process. I did not think of the JMESPath approach. Haven't used it before. So I am kind of used to get the result in the order which is mentioned in the specs.

Thanks for initiating it as an enhancement. I would have loved to pick it up, but my current bandwidth is super squeezed. Would pick it up once the pipeline is relatively clear. 馃

Let's see if anyone wants to pick it up earlier. When you have time and if it's still available, it's all yours 馃憦

Was this page helpful?
0 / 5 - 0 ratings