Repository: VolkovLabs/volkovlabs-dynamictext-panel (ts)

Issue:
Using  {{statusColor}} does the ID have to be last?
I have a simple query

SELECT
   
     line_name
     , 1 as color_id
     , line_status_name 
    
FROM
    line_status
    ORDER BY line_name
    
    This doesn't do a threshold match.

But as soon as I make the ID be last, it starts working.....

SELECT
   
     line_name
     , line_status_name 
     , 1 as color_id
    
FROM
    line_status
    ORDER BY line_name

Pull request:
Fix statusColor for Row
Resolves [#260 ](https://github.com/VolkovLabs/volkovlabs-dynamictext-panel/issues/260)
Resolves #282 

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a36ea3..56b3fa5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,11 @@
 - Update dependencies and Actions (#271)
 - Replace custom code parameters with Code Parameters Builder (#285)
 - Update CSS class for the Panel instead of a Row (#272)
+- Update Editor auto height from fixed value (#278)
+
+### Bug fixes
+
+- Fix statusColor for Row (#280)
 
 ## 4.3.0 (2023-12-25)
 
diff --git a/src/components/Text/Text.tsx b/src/components/Text/Text.tsx
index c547909..ac4b60f 100644
--- a/src/components/Text/Text.tsx
+++ b/src/components/Text/Text.tsx
@@ -185,7 +185,7 @@ export const Text: React.FC<Props> = ({
                 /**
                  * Status Color
                  */
-                const statusColor = options.status === name ? display?.(value).color : undefined;
+                const statusColor = options.status === name ? display?.(value).color : acc[i]?.statusColor;
 
                 /**
                  * Set Value and Status Color


Test patch:
diff --git a/src/components/Text/Text.test.tsx b/src/components/Text/Text.test.tsx
index 1861a37..a37d6e0 100644
--- a/src/components/Text/Text.test.tsx
+++ b/src/components/Text/Text.test.tsx
@@ -215,6 +215,7 @@ describe('Text', () => {
         },
       ],
     });
+
     const props: Props = {
       data: {} as any,
       frame: dataFrame,
@@ -238,6 +239,54 @@ describe('Text', () => {
     expect(statuses[1]).toHaveStyle({ backgroundColor: 'red' });
   });
 
+  it('Should apply status in row', async () => {
+    const replaceVariables = jest.fn((str: string) => str);
+    const dataFrame = toDataFrame({
+      fields: [
+        {
+          name: 'number',
+          type: FieldType.number,
+          display: (value: number) => ({ color: value > 80 ? 'red' : 'green' }),
+          values: [90],
+        },
+        {
+          name: 'test',
+          type: FieldType.number,
+          display: (value: number) => ({ color: value > 80 ? 'red' : 'green' }),
+          values: [70],
+        },
+        {
+          name: 'value',
+          type: FieldType.number,
+          display: (value: number) => ({ color: value > 80 ? 'red' : 'green' }),
+          values: [60],
+        },
+      ],
+    });
+
+    const props: Props = {
+      data: {} as any,
+      frame: dataFrame,
+      options: {
+        ...DEFAULT_OPTIONS,
+        status: 'number',
+        content: '<div style="background-color: {{statusColor}};" data-testid="status">{{test}}{{number}}</div>',
+        defaultContent: 'Test default content',
+        renderMode: RenderMode.EVERY_ROW,
+      },
+      timeRange: {} as any,
+      timeZone: '',
+      replaceVariables,
+      eventBus: {} as any,
+    };
+
+    render(<Text {...props} />);
+
+    const statuses = screen.getAllByTestId('status');
+
+    expect(statuses[0]).toHaveStyle({ backgroundColor: 'red' });
+  });
+
   /**
    * Render every row
    */
@@ -437,6 +486,7 @@ describe('Text', () => {
         length: 2,
       }),
     ];
+
     const props: Props = {
       data: {
         series: frames,