File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed
actions/get-items-by-column-value Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default {
2727 boardId : + this . boardId ,
2828 } ) ;
2929
30- const options = getColumnOptions ( columnData , this . columnId ) ;
30+ const options = getColumnOptions ( columnData , this . columnId , true ) ;
3131
3232 return {
3333 value : {
Original file line number Diff line number Diff line change @@ -27,31 +27,35 @@ export function capitalizeWord(str) {
2727 return str . slice ( 0 , 1 ) . toUpperCase ( ) + str . slice ( 1 ) ;
2828}
2929
30- export function getColumnOptions ( allColumnData , columnId ) {
30+ export function getColumnOptions ( allColumnData , columnId , useLabels = false ) {
3131 const columnOptions = allColumnData . find (
3232 ( { id } ) => id === columnId ,
3333 ) ?. settings_str ;
3434 if ( columnOptions ) {
3535 try {
3636 const labels = JSON . parse ( columnOptions ) . labels ;
37- return Array . isArray ( labels )
37+ return ( Array . isArray ( labels )
3838 ? labels . map ( ( {
3939 id, name,
40- } ) => ( {
41- label : name ,
42- value : id . toString ( ) ,
43- } ) )
40+ } ) => useLabels
41+ ? name
42+ : ( {
43+ label : name ,
44+ value : id . toString ( ) ,
45+ } ) )
4446 : Object . entries ( labels ) . map (
4547 ( [
4648 value ,
4749 label ,
48- ] ) => ( {
49- label : label !== ""
50- ? label
51- : value ,
52- value,
53- } ) ,
54- ) ;
50+ ] ) => useLabels
51+ ? label
52+ : ( {
53+ label : label !== ""
54+ ? label
55+ : value ,
56+ value,
57+ } ) ,
58+ ) ) . filter ( ( str ) => str ) ;
5559 } catch ( err ) {
5660 console . log ( `Error parsing options for column "${ columnId } ": ${ err } ` ) ;
5761 }
You can’t perform that action at this time.
0 commit comments