FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Only display properties with values for MeasureInfo by powercode · Pull Request #7104 · PowerShell/PowerShell · GitHub

Only display properties with values for MeasureInfo - #7104

Merged
Ilya (iSazonov) merged 10 commits into
PowerShell:masterfrom
powercode:formatting_ItemSelectionConditions
Aug 28, 2018
Merged

Only display properties with values for MeasureInfo#7104
Ilya (iSazonov) merged 10 commits into
PowerShell:masterfrom
powercode:formatting_ItemSelectionConditions

Conversation

Staffan Gustafsson (powercode) commented Jun 18, 2018
edited by iSazonov
Loading

Copy link
Copy Markdown
Collaborator

PR Summary

Adding Item selection conditions to the list formatting info for MeasureInfo so that only the properties with values gets displayed

Reopening #6214

PR Checklist


This change is 

Copy link
Copy Markdown
Collaborator

From #6412 #6214 (comment)

@PowerShell/powershell-committeeTeam members are private reviewed this and is ok with the public apis

Ilya (iSazonov) added the Committee-Reviewed PS-Committee has reviewed this and made a decision label Jun 19, 2018
Ilya (iSazonov) self-assigned this Jun 19, 2018

Staffan Gustafsson (powercode) commented Jul 4, 2018
edited
Loading

Copy link
Copy Markdown
Collaborator Author

The build errors seems completely separate from my changes.
Ilya (@iSazonov) Can you restart the build?

Copy link
Copy Markdown
Collaborator

Reopen the PR to restart CIs.

Copy link
Copy Markdown
Collaborator Author

I don't intend to fix the remaining CodeFactor issues.

Copy link
Copy Markdown

James Truher (@JamesWTruher) can you please take a look? Thx.

Copy link
Copy Markdown

Jim is on a leave; + Steve Lee (@SteveL-MSFT) for review who is familiar with formatting APIs.

}

private ListEntryBuilder AddItem(string value, string label, DisplayEntryValueType kind, string format)
private ListEntryBuilder AddItem(string value, string label, DisplayEntryValueType kind, string format, DisplayEntry itemSelectionContition)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

typo: itemSelectionCondition


/// <summary></summary>
public ListEntryBuilder AddItemScriptBlock(string scriptBlock, string label = null, string format = null)
public ListEntryBuilder AddItemScriptBlock(string scriptBlock, string label = null, string format = null, DisplayEntry itemSelectionContition = null)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

typo: itemSelectionCondition


/// <summary></summary>
public ListEntryBuilder AddItemProperty(string property, string label = null, string format = null)
public ListEntryBuilder AddItemProperty(string property, string label = null, string format = null, DisplayEntry itemSelectionContition = null)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

typo: itemSelectionCondition

/// <summary></summary>
public ListEntryBuilder AddItemPropertyIfSet(string property, string label = null, string format = null)
{
var itemSelectionContition = DisplayEntry.CreatePropertyEntry(property);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

typo: itemSelectionCondition

Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

$text = 1, 2, 3 | Measure-Object -Minimum -Maximum | Format-List | Out-String
$text -match "min" | Should -BeTrue
$text -match "max" | Should -BeTrue
$text -match 'Average' | Should -BeFalse

Ilya (iSazonov) Aug 17, 2018
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems we skipped

$text -match 'Sum' | Should -BeFalse

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Staffan Gustafsson (@powercode) Please address the comment.

Copy link
Copy Markdown
Collaborator

Bruce Payette (@BrucePay) Jason Shirk (@lzybkr) Please look the PR.

Staffan Gustafsson (powercode) force-pushed the formatting_ItemSelectionConditions branch from 1b4a460 to b424329 Compare August 27, 2018 19:45
Ilya (iSazonov) changed the title MeasureInfo: Only display properties with values Only display properties with values for MeasureInfo Aug 28, 2018
Ilya (iSazonov) added the Documentation Needed in this repo Documentation is needed in this repo label Aug 28, 2018
Ilya (iSazonov) merged commit 87ccd0a into PowerShell:master Aug 28, 2018

Copy link
Copy Markdown
Collaborator

Staffan Gustafsson (@powercode) Thank you for the contribution!

I added "Documentation-Needed" label (if you can please open new issue in PowerShell-Docs repo).

/// <returns>A <see cref="DisplayEntry"/> for the <paramref name="scriptblock"/>.</returns>
public static DisplayEntry CreateScriptBlockEntry(string scriptblock)
{
return new DisplayEntry(scriptblock, DisplayEntryValueType.ScriptBlock);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Paul Higinbotham (@PaulHigin) should review this new public api for any security implications in creating script blocks that might circumvent the language mode.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Paul Higinbotham (@PaulHigin) reviewed this and told me he doesn't see a security issue. Paul Higinbotham (@PaulHigin) can you confirm?

Steve Lee (SteveL-MSFT) commented Sep 10, 2018
edited
Loading

Copy link
Copy Markdown
Member

Ilya (@iSazonov) we should revert this commit until security review of the public api has been completed

cc Travis Plunk (@TravisEz13)

Ilya (iSazonov) added a commit to iSazonov/PowerShell that referenced this pull request Sep 11, 2018
…ll#7104)"

This reverts commit 87ccd0a until
security review of the public api has been completed.

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Opened #7754.

Travis Plunk (TravisEz13) pushed a commit that referenced this pull request Oct 11, 2018
…7754)

This reverts commit 87ccd0a until
security review of the public api has been completed.
Joey Aiello (joeyaiello) removed Documentation Needed in this repo Documentation is needed in this repo labels Oct 15, 2018
Aditya Patwardhan (adityapatwardhan) pushed a commit to adityapatwardhan/PowerShell that referenced this pull request Apr 9, 2019
…ll#7104)" (PowerShell#7754)

This reverts commit 87ccd0a until
security review of the public api has been completed.
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
* Adding support for built-in List formats to include ItemSelectionCondition
* Adding ItemSelectionCondition to GenericMeasureInfo
* Adding tests for MeasureInfo format-list
* Adding positive tests
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…ll#7104)" (PowerShell#7754)

This reverts commit f657820 until
security review of the public api has been completed.
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL