This repository was archived by the owner on Apr 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,33 @@ impl eframe::App for TemplateApp {
214214 }
215215 }
216216 } else {
217- ui. label ( format ! ( "{}: {}" , pr_number, pr_title) ) ;
217+ // This is a quick and dirty way to colour PR that don't have a testing labels as lighter colour to indicate no need for testing.
218+ // In the future this should be rewritten more nicely and maybe allow filtering by label
219+ // Also the hardcoded value should be a constant at the top of the source file.
220+ let labels = elem
221+ . get ( "labels" )
222+ . and_then ( |value| value. as_array ( ) )
223+ . unwrap ( ) ;
224+ let mut temp_bool = false ;
225+ for elem in labels {
226+ let label_name =
227+ elem. get ( "name" ) . and_then ( |value| value. as_str ( ) ) . unwrap ( ) ;
228+ if label_name == "needs testing" {
229+ temp_bool = true ;
230+ }
231+ // dbg!(label_name);
232+ }
233+ if temp_bool {
234+ ui. label (
235+ egui:: RichText :: new ( format ! ( "{}: {}" , pr_number, pr_title) )
236+ . strong ( ) ,
237+ ) ;
238+ } else {
239+ ui. label (
240+ egui:: RichText :: new ( format ! ( "{}: {}" , pr_number, pr_title) )
241+ . color ( egui:: Color32 :: GRAY ) ,
242+ ) ;
243+ }
218244 }
219245 } ) ;
220246 }
You can’t perform that action at this time.
0 commit comments