Formats/PullRequest.Format.ps1xml
<Configuration> <ViewDefinitions> <View> <Name>Table</Name> <ViewSelectedBy> <TypeName>PSGitHub.Issue</TypeName> <TypeName>PSGitHub.PullRequest</TypeName> </ViewSelectedBy> <TableControl> <TableHeaders> <TableColumnHeader> <Label>Number</Label> </TableColumnHeader> <TableColumnHeader> <Label>State</Label> </TableColumnHeader> <TableColumnHeader> <Label>User</Label> </TableColumnHeader> <TableColumnHeader> <Label>CreatedAt</Label> </TableColumnHeader> <TableColumnHeader> <Label>Title</Label> </TableColumnHeader> </TableHeaders> <TableRowEntries> <TableRowEntry> <TableColumnItems> <TableColumnItem> <PropertyName>Number</PropertyName> <Alignment>Right</Alignment> </TableColumnItem> <TableColumnItem> <ScriptBlock> $_.GetVT100ForegroundColor() + $_.State + "`e[0m" </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock>$_.User.Login</ScriptBlock> </TableColumnItem> <TableColumnItem> <PropertyName>CreatedAt</PropertyName> </TableColumnItem> <TableColumnItem> <PropertyName>Title</PropertyName> </TableColumnItem> </TableColumnItems> </TableRowEntry> </TableRowEntries> </TableControl> </View> <View> <!-- Inspired by the PR page --> <Name>Compact</Name> <ViewSelectedBy> <TypeName>PSGitHub.PullRequest</TypeName> <TypeName>PSGitHub.Issue</TypeName> </ViewSelectedBy> <CustomControl> <CustomEntries> <CustomEntry> <CustomItem> <!-- State indicator --> <ExpressionBinding> <ScriptBlock> $_.GetVT100ForegroundColor() + $_.Icon + "`e[0m" </ScriptBlock> </ExpressionBinding> <!-- Title --> <ExpressionBinding> <ScriptBlock>" `e[1m$($_.Title)`e[0m "</ScriptBlock> </ExpressionBinding> <!-- Labels --> <ExpressionBinding> <ScriptBlock> ($_.Labels | ForEach-Object ToColoredString) -join " " </ScriptBlock> </ExpressionBinding> <NewLine /> <Frame> <LeftIndent>2</LeftIndent> <CustomItem> <ExpressionBinding> <ScriptBlock>" #$($_.Number) opened on $($_.CreatedAt) by $($_.User.Login)"</ScriptBlock> </ExpressionBinding> <ExpressionBinding> <ScriptBlock>" 🕗 Updated $($_.UpdatedAt)"</ScriptBlock> </ExpressionBinding> <ExpressionBinding> <ScriptBlock>" 🏁 $($_.Milestone.Title)"</ScriptBlock> <ItemSelectionCondition> <PropertyName>Milestone</PropertyName> </ItemSelectionCondition> </ExpressionBinding> </CustomItem> </Frame> <NewLine /> </CustomItem> </CustomEntry> </CustomEntries> </CustomControl> </View> <View> <!-- List displaying most properties, but not body --> <Name>List</Name> <ViewSelectedBy> <TypeName>PSGitHub.PullRequest</TypeName> <TypeName>PSGitHub.Issue</TypeName> </ViewSelectedBy> <ListControl> <ListEntries> <ListEntry> <ListItems> <ListItem> <Label>Title</Label> <ScriptBlock>"`e[1m$($_.Title)`e[0m"</ScriptBlock> </ListItem> <ListItem> <Label>Head</Label> <ItemSelectionCondition> <PropertyName>Head</PropertyName> </ItemSelectionCondition> <ScriptBlock>$_.Head.Label</ScriptBlock> </ListItem> <ListItem> <Label>State</Label> <ScriptBlock> $_.GetVT100ForegroundColor() + $_.State + "`e[0m" </ScriptBlock> </ListItem> <ListItem> <Label>Number</Label> <PropertyName>Number</PropertyName> </ListItem> <ListItem> <Label>User</Label> <ScriptBlock>$_.User.Login</ScriptBlock> </ListItem> <ListItem> <Label>Labels</Label> <ScriptBlock> ($_.Labels | ForEach-Object ToColoredString) -join " " </ScriptBlock> </ListItem> <ListItem> <Label>Milestone</Label> <ItemSelectionCondition> <PropertyName>Milestone</PropertyName> </ItemSelectionCondition> <ScriptBlock>$_.Milestone.Title</ScriptBlock> </ListItem> <ListItem> <Label>RequestedReviewers</Label> <ItemSelectionCondition> <PropertyName>RequestedReviewers</PropertyName> </ItemSelectionCondition> <ScriptBlock>$_.RequestedReviewers | ForEach-Object { $_.Login }</ScriptBlock> </ListItem> <ListItem> <Label>CreatedAt</Label> <PropertyName>CreatedAt</PropertyName> </ListItem> <ListItem> <Label>UpdatedAt</Label> <PropertyName>UpdatedAt</PropertyName> </ListItem> <ListItem> <Label>MergedAt</Label> <ItemSelectionCondition> <PropertyName>MergedAt</PropertyName> </ItemSelectionCondition> <PropertyName>MergedAt</PropertyName> </ListItem> </ListItems> </ListEntry> </ListEntries> </ListControl> </View> <View> <!-- Same as list, but including body --> <Name>Full</Name> <ViewSelectedBy> <TypeName>PSGitHub.PullRequest</TypeName> <TypeName>PSGitHub.Issue</TypeName> </ViewSelectedBy> <ListControl> <ListEntries> <ListEntry> <ListItems> <ListItem> <Label>Title</Label> <ScriptBlock>"`e[1m$($_.Title)`e[0m"</ScriptBlock> </ListItem> <ListItem> <Label>Head</Label> <ItemSelectionCondition> <PropertyName>Head</PropertyName> </ItemSelectionCondition> <ScriptBlock>$_.Head.Label</ScriptBlock> </ListItem> <ListItem> <Label>State</Label> <ScriptBlock> $_.GetVT100ForegroundColor() + $_.State + "`e[0m" </ScriptBlock> </ListItem> <ListItem> <Label>Number</Label> <PropertyName>Number</PropertyName> </ListItem> <ListItem> <Label>User</Label> <ScriptBlock>$_.User.Login</ScriptBlock> </ListItem> <ListItem> <Label>Labels</Label> <ScriptBlock> ($_.Labels | ForEach-Object ToColoredString) -join " " </ScriptBlock> </ListItem> <ListItem> <Label>Milestone</Label> <ItemSelectionCondition> <PropertyName>Milestone</PropertyName> </ItemSelectionCondition> <ScriptBlock>$_.Milestone.Title</ScriptBlock> </ListItem> <ListItem> <Label>RequestedReviewers</Label> <ItemSelectionCondition> <PropertyName>RequestedReviewers</PropertyName> </ItemSelectionCondition> <ScriptBlock>$_.RequestedReviewers | ForEach-Object { $_.Login }</ScriptBlock> </ListItem> <ListItem> <Label>CreatedAt</Label> <PropertyName>CreatedAt</PropertyName> </ListItem> <ListItem> <Label>UpdatedAt</Label> <PropertyName>UpdatedAt</PropertyName> </ListItem> <ListItem> <Label>MergedAt</Label> <ItemSelectionCondition> <PropertyName>MergedAt</PropertyName> </ItemSelectionCondition> <PropertyName>MergedAt</PropertyName> </ListItem> <ListItem> <Label>Body</Label> <ScriptBlock>($_.Body | ConvertFrom-Markdown -AsVT100EncodedString).VT100EncodedString</ScriptBlock> </ListItem> </ListItems> </ListEntry> </ListEntries> </ListControl> </View> </ViewDefinitions> </Configuration> |