Skip to content

Commit 41de3ad

Browse files
authored
GitHubRepositories: Add Output Type Views (#205)
* Adds formatting for all of the types exposed in GitHubRepositories.ps1. * Fixes the `OutputType` for RepositoryCollaborator and RepositoryContributor.
1 parent a1f5e93 commit 41de3ad

File tree

4 files changed

+383
-8
lines changed

4 files changed

+383
-8
lines changed

Diff for: Formatters/GitHubRepositories.Format.ps1xml

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<!--================== GitHub.Repository Type View =================-->
5+
<View>
6+
<Name>GitHub.Repository</Name>
7+
<ViewSelectedBy>
8+
<TypeName>GitHub.Repository</TypeName>
9+
</ViewSelectedBy>
10+
<TableControl>
11+
<TableRowEntries>
12+
<TableRowEntry>
13+
<TableColumnItems>
14+
<TableColumnItem>
15+
<PropertyName>full_name</PropertyName>
16+
</TableColumnItem>
17+
<TableColumnItem>
18+
<PropertyName>visibility</PropertyName>
19+
</TableColumnItem>
20+
<TableColumnItem>
21+
<PropertyName>description</PropertyName>
22+
</TableColumnItem>
23+
</TableColumnItems>
24+
</TableRowEntry>
25+
</TableRowEntries>
26+
</TableControl>
27+
</View>
28+
<!--=============== GitHub.RepositoryTopic Type View ===============-->
29+
<View>
30+
<Name>GitHub.RepositoryTopic</Name>
31+
<ViewSelectedBy>
32+
<TypeName>GitHub.RepositoryTopic</TypeName>
33+
</ViewSelectedBy>
34+
<ListControl>
35+
<ListEntries>
36+
<ListEntry>
37+
<ListItems>
38+
<ListItem>
39+
<PropertyName>names</PropertyName>
40+
</ListItem>
41+
<ListItem>
42+
<PropertyName>RepositoryUrl</PropertyName>
43+
</ListItem>
44+
</ListItems>
45+
</ListEntry>
46+
</ListEntries>
47+
</ListControl>
48+
</View>
49+
<!--=============== GitHub.RepositoryContributor Type View ===============-->
50+
<View>
51+
<Name>GitHub.RepositoryContributor</Name>
52+
<ViewSelectedBy>
53+
<TypeName>GitHub.RepositoryContributor</TypeName>
54+
</ViewSelectedBy>
55+
<TableControl>
56+
<TableRowEntries>
57+
<TableRowEntry>
58+
<TableColumnItems>
59+
<TableColumnItem>
60+
<PropertyName>UserName</PropertyName>
61+
</TableColumnItem>
62+
<TableColumnItem>
63+
<PropertyName>type</PropertyName>
64+
</TableColumnItem>
65+
<TableColumnItem>
66+
<PropertyName>contributions</PropertyName>
67+
</TableColumnItem>
68+
</TableColumnItems>
69+
</TableRowEntry>
70+
</TableRowEntries>
71+
</TableControl>
72+
</View>
73+
<!--========== GitHub.RepositoryContributorStatistics Type View ==========-->
74+
<View>
75+
<Name>GitHub.RepositoryContributorStatistics</Name>
76+
<ViewSelectedBy>
77+
<TypeName>GitHub.RepositoryContributorStatistics</TypeName>
78+
</ViewSelectedBy>
79+
<TableControl>
80+
<TableHeaders>
81+
<TableColumnHeader>
82+
<Label>author.UserName</Label>
83+
</TableColumnHeader>
84+
<TableColumnHeader />
85+
<TableColumnHeader />
86+
</TableHeaders>
87+
<TableRowEntries>
88+
<TableRowEntry>
89+
<TableColumnItems>
90+
<TableColumnItem>
91+
<ScriptBlock>
92+
$_.author.UserName
93+
</ScriptBlock>
94+
</TableColumnItem>
95+
<TableColumnItem>
96+
<PropertyName>total</PropertyName>
97+
</TableColumnItem>
98+
<TableColumnItem>
99+
<PropertyName>weeks</PropertyName>
100+
</TableColumnItem>
101+
</TableColumnItems>
102+
</TableRowEntry>
103+
</TableRowEntries>
104+
</TableControl>
105+
</View>
106+
<!--=============== GitHub.RepositoryCollaborator Type View ===============-->
107+
<View>
108+
<Name>GitHub.RepositoryCollaborator</Name>
109+
<ViewSelectedBy>
110+
<TypeName>GitHub.RepositoryCollaborator</TypeName>
111+
</ViewSelectedBy>
112+
<TableControl>
113+
<TableHeaders>
114+
<TableColumnHeader />
115+
<TableColumnHeader>
116+
<Label>permissions.admin</Label>
117+
</TableColumnHeader>
118+
<TableColumnHeader>
119+
<Label>permissions.push</Label>
120+
</TableColumnHeader>
121+
<TableColumnHeader>
122+
<Label>permissions.pull</Label>
123+
</TableColumnHeader>
124+
</TableHeaders>
125+
<TableRowEntries>
126+
<TableRowEntry>
127+
<TableColumnItems>
128+
<TableColumnItem>
129+
<PropertyName>UserName</PropertyName>
130+
</TableColumnItem>
131+
<TableColumnItem>
132+
<ScriptBlock>
133+
$_.permissions.admin
134+
</ScriptBlock>
135+
</TableColumnItem>
136+
<TableColumnItem>
137+
<ScriptBlock>
138+
$_.permissions.push
139+
</ScriptBlock>
140+
</TableColumnItem>
141+
<TableColumnItem>
142+
<ScriptBlock>
143+
$_.permissions.pull
144+
</ScriptBlock>
145+
</TableColumnItem>
146+
</TableColumnItems>
147+
</TableRowEntry>
148+
</TableRowEntries>
149+
</TableControl>
150+
</View>
151+
<!--=============== GitHub.RepositoryTag Type View ===============-->
152+
<View>
153+
<Name>GitHub.RepositoryTag</Name>
154+
<ViewSelectedBy>
155+
<TypeName>GitHub.RepositoryTag</TypeName>
156+
</ViewSelectedBy>
157+
<TableControl>
158+
<TableHeaders>
159+
<TableColumnHeader />
160+
<TableColumnHeader>
161+
<Label>commit.sha</Label>
162+
</TableColumnHeader>
163+
</TableHeaders>
164+
<TableRowEntries>
165+
<TableRowEntry>
166+
<TableColumnItems>
167+
<TableColumnItem>
168+
<PropertyName>name</PropertyName>
169+
</TableColumnItem>
170+
<TableColumnItem>
171+
<ScriptBlock>
172+
$_.commit.sha
173+
</ScriptBlock>
174+
</TableColumnItem>
175+
</TableColumnItems>
176+
</TableRowEntry>
177+
</TableRowEntries>
178+
</TableControl>
179+
</View>
180+
</ViewDefinitions>
181+
</Configuration>

0 commit comments

Comments
 (0)