Skip to content

Conversation

@powercode
Copy link
Collaborator

@powercode powercode commented Jun 18, 2018

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 Reviewable

@iSazonov
Copy link
Collaborator

From #6412 #6214 (comment)

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

@iSazonov iSazonov added the Committee-Reviewed PS-Committee has reviewed this and made a decision label Jun 19, 2018
@iSazonov iSazonov requested review from JamesWTruher and lzybkr June 19, 2018 03:49
@iSazonov iSazonov self-assigned this Jun 19, 2018
@powercode
Copy link
Collaborator Author

powercode commented Jul 4, 2018

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

@iSazonov iSazonov closed this Jul 4, 2018
@iSazonov iSazonov reopened this Jul 4, 2018
@iSazonov
Copy link
Collaborator

iSazonov commented Jul 4, 2018

Reopen the PR to restart CIs.

@powercode
Copy link
Collaborator Author

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

@anmenaga
Copy link

@JamesWTruher can you please take a look? Thx.

@anmenaga anmenaga requested a review from SteveL-MSFT August 2, 2018 21:02
@anmenaga
Copy link

anmenaga commented Aug 2, 2018

Jim is on a leave; + @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
Member

Choose a reason for hiding this comment

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

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
Member

Choose a reason for hiding this comment

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

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
Member

Choose a reason for hiding this comment

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

typo: itemSelectionCondition

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

Choose a reason for hiding this comment

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

typo: itemSelectionCondition

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@SteveL-MSFT SteveL-MSFT requested a review from BrucePay August 16, 2018 18:23
$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
Copy link
Collaborator

@iSazonov iSazonov Aug 17, 2018

Choose a reason for hiding this comment

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

Seems we skipped

$text -match 'Sum' | Should -BeFalse

Copy link
Collaborator

Choose a reason for hiding this comment

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

@powercode Please address the comment.

@iSazonov
Copy link
Collaborator

@BrucePay @lzybkr Please look the PR.

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

@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
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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

@SteveL-MSFT
Copy link
Member

SteveL-MSFT commented Sep 10, 2018

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

cc @TravisEz13

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.
@iSazonov
Copy link
Collaborator

@SteveL-MSFT Opened #7754.

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.
@joeyaiello joeyaiello removed Documentation Needed in this repo Documentation is needed in this repo labels Oct 15, 2018
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.
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