@@ -81,10 +81,11 @@ const TemplateHelpTooltip: FC = () => {
81
81
} ;
82
82
83
83
interface TemplateRowProps {
84
+ showOrganizations : boolean ;
84
85
template : Template ;
85
86
}
86
87
87
- const TemplateRow : FC < TemplateRowProps > = ( { template } ) => {
88
+ const TemplateRow : FC < TemplateRowProps > = ( { showOrganizations , template } ) => {
88
89
const getLink = useLinks ( ) ;
89
90
const templatePageLink = getLink (
90
91
linkToTemplate ( template . organization_name , template . name ) ,
@@ -120,7 +121,23 @@ const TemplateRow: FC<TemplateRowProps> = ({ template }) => {
120
121
</ TableCell >
121
122
122
123
< TableCell css = { styles . secondary } >
123
- { Language . developerCount ( template . active_user_count ) }
124
+ { showOrganizations ? (
125
+ < Stack
126
+ spacing = { 0 }
127
+ css = { {
128
+ width : "100%" ,
129
+ } }
130
+ >
131
+ < span css = { styles . cellPrimaryLine } >
132
+ { template . organization_display_name }
133
+ </ span >
134
+ < span css = { styles . cellSecondaryLine } >
135
+ Used by { Language . developerCount ( template . active_user_count ) }
136
+ </ span >
137
+ </ Stack >
138
+ ) : (
139
+ Language . developerCount ( template . active_user_count )
140
+ ) }
124
141
</ TableCell >
125
142
126
143
< TableCell css = { styles . secondary } >
@@ -156,16 +173,18 @@ const TemplateRow: FC<TemplateRowProps> = ({ template }) => {
156
173
157
174
export interface TemplatesPageViewProps {
158
175
error ?: unknown ;
176
+ showOrganizations : boolean ;
177
+ canCreateTemplates : boolean ;
159
178
examples : TemplateExample [ ] | undefined ;
160
179
templates : Template [ ] | undefined ;
161
- canCreateTemplates : boolean ;
162
180
}
163
181
164
182
export const TemplatesPageView : FC < TemplatesPageViewProps > = ( {
165
- templates,
166
183
error,
167
- examples ,
184
+ showOrganizations ,
168
185
canCreateTemplates,
186
+ examples,
187
+ templates,
169
188
} ) => {
170
189
const isLoading = ! templates ;
171
190
const isEmpty = templates && templates . length === 0 ;
@@ -209,7 +228,9 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = ({
209
228
< TableHead >
210
229
< TableRow >
211
230
< TableCell width = "35%" > { Language . nameLabel } </ TableCell >
212
- < TableCell width = "15%" > { Language . usedByLabel } </ TableCell >
231
+ < TableCell width = "15%" >
232
+ { showOrganizations ? "Organization" : Language . usedByLabel }
233
+ </ TableCell >
213
234
< TableCell width = "10%" > { Language . buildTimeLabel } </ TableCell >
214
235
< TableCell width = "15%" > { Language . lastUpdatedLabel } </ TableCell >
215
236
< TableCell width = "1%" > </ TableCell >
@@ -225,7 +246,11 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = ({
225
246
/>
226
247
) : (
227
248
templates ?. map ( ( template ) => (
228
- < TemplateRow key = { template . id } template = { template } />
249
+ < TemplateRow
250
+ key = { template . id }
251
+ showOrganizations = { showOrganizations }
252
+ template = { template }
253
+ />
229
254
) )
230
255
) }
231
256
</ TableBody >
@@ -276,6 +301,15 @@ const styles = {
276
301
actionCell : {
277
302
whiteSpace : "nowrap" ,
278
303
} ,
304
+ cellPrimaryLine : ( theme ) => ( {
305
+ color : theme . palette . text . primary ,
306
+ fontWeight : 600 ,
307
+ } ) ,
308
+ cellSecondaryLine : ( theme ) => ( {
309
+ fontSize : 13 ,
310
+ color : theme . palette . text . secondary ,
311
+ lineHeight : "150%" ,
312
+ } ) ,
279
313
secondary : ( theme ) => ( {
280
314
color : theme . palette . text . secondary ,
281
315
} ) ,
0 commit comments