Skip to content

Commit

Permalink
GitHubRepositories: Add Output Type Views (#205)
Browse files Browse the repository at this point in the history
* Adds formatting for all of the types exposed in GitHubRepositories.ps1.
* Fixes the `OutputType` for RepositoryCollaborator and RepositoryContributor.
  • Loading branch information
X-Guardian authored Jun 27, 2020
1 parent a1f5e93 commit 41de3ad
Show file tree
Hide file tree
Showing 4 changed files with 383 additions and 8 deletions.
181 changes: 181 additions & 0 deletions Formatters/GitHubRepositories.Format.ps1xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<!--================== GitHub.Repository Type View =================-->
<View>
<Name>GitHub.Repository</Name>
<ViewSelectedBy>
<TypeName>GitHub.Repository</TypeName>
</ViewSelectedBy>
<TableControl>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>full_name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>visibility</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>description</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!--=============== GitHub.RepositoryTopic Type View ===============-->
<View>
<Name>GitHub.RepositoryTopic</Name>
<ViewSelectedBy>
<TypeName>GitHub.RepositoryTopic</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<PropertyName>names</PropertyName>
</ListItem>
<ListItem>
<PropertyName>RepositoryUrl</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<!--=============== GitHub.RepositoryContributor Type View ===============-->
<View>
<Name>GitHub.RepositoryContributor</Name>
<ViewSelectedBy>
<TypeName>GitHub.RepositoryContributor</TypeName>
</ViewSelectedBy>
<TableControl>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>UserName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>type</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>contributions</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!--========== GitHub.RepositoryContributorStatistics Type View ==========-->
<View>
<Name>GitHub.RepositoryContributorStatistics</Name>
<ViewSelectedBy>
<TypeName>GitHub.RepositoryContributorStatistics</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>author.UserName</Label>
</TableColumnHeader>
<TableColumnHeader />
<TableColumnHeader />
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<ScriptBlock>
$_.author.UserName
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>total</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>weeks</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!--=============== GitHub.RepositoryCollaborator Type View ===============-->
<View>
<Name>GitHub.RepositoryCollaborator</Name>
<ViewSelectedBy>
<TypeName>GitHub.RepositoryCollaborator</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader />
<TableColumnHeader>
<Label>permissions.admin</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>permissions.push</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>permissions.pull</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>UserName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
$_.permissions.admin
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
$_.permissions.push
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
$_.permissions.pull
</ScriptBlock>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!--=============== GitHub.RepositoryTag Type View ===============-->
<View>
<Name>GitHub.RepositoryTag</Name>
<ViewSelectedBy>
<TypeName>GitHub.RepositoryTag</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader />
<TableColumnHeader>
<Label>commit.sha</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
$_.commit.sha
</ScriptBlock>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>
Loading

0 comments on commit 41de3ad

Please sign in to comment.