@@ -54,6 +54,7 @@ public AdaptiveCard Convert(BotAndMessagingExtensionJiraIssue model, AdaptiveCar
54
54
55
55
var watchOrUnwatchActionColumn = GetWatchOrUnwatchAdaptiveColumn ( model ) ;
56
56
var assignActionColumn = GetAssignAdaptiveColumn ( model ) ;
57
+ var priorityColumn = GetPriorityColumn ( model ) ;
57
58
58
59
card . Body = new List < AdaptiveElement >
59
60
{
@@ -173,78 +174,7 @@ public AdaptiveCard Convert(BotAndMessagingExtensionJiraIssue model, AdaptiveCar
173
174
}
174
175
}
175
176
} ,
176
- new AdaptiveColumn
177
- {
178
- Width = "3" ,
179
- Spacing = AdaptiveSpacing . Small ,
180
- VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
181
- Items = new List < AdaptiveElement >
182
- {
183
- new AdaptiveColumnSet
184
- {
185
- Spacing = AdaptiveSpacing . Small ,
186
- Columns = new List < AdaptiveColumn >
187
- {
188
- new AdaptiveColumn
189
- {
190
- Width = "4" ,
191
- Spacing = AdaptiveSpacing . Small ,
192
- VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
193
- Items = new List < AdaptiveElement >
194
- {
195
- new AdaptiveTextBlock
196
- {
197
- Text = "Priority" ,
198
- Wrap = true ,
199
- Spacing = AdaptiveSpacing . None ,
200
- Size = AdaptiveTextSize . Small
201
- } ,
202
- new AdaptiveColumnSet
203
- {
204
- Spacing = AdaptiveSpacing . Small ,
205
- Columns = new List < AdaptiveColumn >
206
- {
207
- new AdaptiveColumn
208
- {
209
- Width = "16px" ,
210
- VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
211
- Items = new List < AdaptiveElement >
212
- {
213
- new AdaptiveImage
214
- {
215
- UrlString = PrepareIconUrl ( model . JiraIssue ? . Fields ? . Priority ? . IconUrl ) ,
216
- Size = AdaptiveImageSize . Small ,
217
- PixelWidth = 16 ,
218
- PixelHeight = 16 ,
219
- Spacing = AdaptiveSpacing . None
220
- }
221
- }
222
- } ,
223
- new AdaptiveColumn
224
- {
225
- VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
226
- Width = "6" ,
227
- Spacing = AdaptiveSpacing . Small ,
228
- Items = new List < AdaptiveElement >
229
- {
230
- new AdaptiveTextBlock
231
- {
232
- Text = model . JiraIssue ? . Fields ? . Priority ? . Name ,
233
- Spacing = AdaptiveSpacing . None ,
234
- Wrap = true ,
235
- HorizontalAlignment = AdaptiveHorizontalAlignment . Left ,
236
- Weight = AdaptiveTextWeight . Bolder
237
- }
238
- }
239
- }
240
- }
241
- }
242
- }
243
- }
244
- }
245
- }
246
- }
247
- } ,
177
+ priorityColumn ,
248
178
new AdaptiveColumn
249
179
{
250
180
Width = "3" ,
@@ -425,6 +355,91 @@ public AdaptiveCard Convert(BotAndMessagingExtensionJiraIssue model, AdaptiveCar
425
355
return card ;
426
356
}
427
357
358
+ private static AdaptiveColumn GetPriorityColumn ( BotAndMessagingExtensionJiraIssue model )
359
+ {
360
+ if ( model . JiraIssue ? . Fields ? . Priority == null )
361
+ {
362
+ return new AdaptiveColumn ( )
363
+ {
364
+ Width = "3" ,
365
+ } ;
366
+ }
367
+
368
+ return new AdaptiveColumn
369
+ {
370
+ Width = "3" ,
371
+ Spacing = AdaptiveSpacing . Small ,
372
+ VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
373
+ Items = new List < AdaptiveElement >
374
+ {
375
+ new AdaptiveColumnSet
376
+ {
377
+ Spacing = AdaptiveSpacing . Small ,
378
+ Columns = new List < AdaptiveColumn >
379
+ {
380
+ new AdaptiveColumn
381
+ {
382
+ Width = "4" ,
383
+ Spacing = AdaptiveSpacing . Small ,
384
+ VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
385
+ Items = new List < AdaptiveElement >
386
+ {
387
+ new AdaptiveTextBlock
388
+ {
389
+ Text = "Priority" ,
390
+ Wrap = true ,
391
+ Spacing = AdaptiveSpacing . None ,
392
+ Size = AdaptiveTextSize . Small
393
+ } ,
394
+ new AdaptiveColumnSet
395
+ {
396
+ Spacing = AdaptiveSpacing . Small ,
397
+ Columns = new List < AdaptiveColumn >
398
+ {
399
+ new AdaptiveColumn
400
+ {
401
+ Width = "16px" ,
402
+ VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
403
+ Items = new List < AdaptiveElement >
404
+ {
405
+ new AdaptiveImage
406
+ {
407
+ UrlString = PrepareIconUrl ( model . JiraIssue ? . Fields ? . Priority
408
+ ? . IconUrl ) ,
409
+ Size = AdaptiveImageSize . Small ,
410
+ PixelWidth = 16 ,
411
+ PixelHeight = 16 ,
412
+ Spacing = AdaptiveSpacing . None
413
+ }
414
+ }
415
+ } ,
416
+ new AdaptiveColumn
417
+ {
418
+ VerticalContentAlignment = AdaptiveVerticalContentAlignment . Top ,
419
+ Width = "6" ,
420
+ Spacing = AdaptiveSpacing . Small ,
421
+ Items = new List < AdaptiveElement >
422
+ {
423
+ new AdaptiveTextBlock
424
+ {
425
+ Text = model . JiraIssue ? . Fields ? . Priority ? . Name ,
426
+ Spacing = AdaptiveSpacing . None ,
427
+ Wrap = true ,
428
+ HorizontalAlignment = AdaptiveHorizontalAlignment . Left ,
429
+ Weight = AdaptiveTextWeight . Bolder
430
+ }
431
+ }
432
+ }
433
+ }
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
439
+ }
440
+ } ;
441
+ }
442
+
428
443
private static string PrepareIconUrl ( string iconUrl )
429
444
{
430
445
return ! string . IsNullOrEmpty ( iconUrl ) && Uri . IsWellFormedUriString ( iconUrl , UriKind . Absolute ) ? iconUrl
0 commit comments