RedHatInsights / tower-analytics-frontend

Automation Analytics provides data analytics for Ansible Tower that provides visualization and insight into how automation is used in your organization.
https://console.redhat.com/ansible/ansible-dashboard
Apache License 2.0
9 stars 28 forks source link

Add tsc fixes for report card #1047

Closed prat98 closed 4 weeks ago

prat98 commented 4 weeks ago

Typescript fixes to bring reportcard errors to 0

app-sre-bot commented 4 weeks ago

Can one of the admins verify this patch?

ZitaNemeckova commented 4 weeks ago

Issues:

TSC errors:

ERROR in ./src/Containers/Reports/Layouts/Standard/ReportCard.tsx:292:17
TS2322: Type 'string | true | (string | boolean)[]' is not assignable to type 'ChartType | undefined'.
  Type 'string' is not assignable to type 'ChartType | undefined'.
    290 |                 y: chartParams.y,
    291 |                 xTickFormat: chartParams.xTickFormat,
  > 292 |                 chartType: chartParams.chartType,
        |                 ^^^^^^^^^
    293 |               })}
    294 |               dataComponent={'foobar'}
    295 |               data={dataApi.result as any}

ERROR in ./src/Containers/Reports/Layouts/Standard/ReportCard.tsx:344:19
TS2322: Type 'string | true | (string | boolean)[]' is not assignable to type 'ChartType | undefined'.
  Type 'string' is not assignable to type 'ChartType | undefined'.
    342 |                   y: chartParams.y,
    343 |                   xTickFormat: chartParams.xTickFormat,
  > 344 |                   chartType: chartParams.chartType,
        |                   ^^^^^^^^^
    345 |                 })}
    346 |                 dataComponent={'foobar'}
    347 |                 data={dataApi.result as any}

ERROR in ./src/Containers/Reports/Layouts/Standard/ReportCard.tsx:409:15
TS2322: Type 'string | true | (string | boolean)[]' is not assignable to type 'ChartType | undefined'.
  Type 'string' is not assignable to type 'ChartType | undefined'.
    407 |               y: chartParams.y,
    408 |               xTickFormat: chartParams.xTickFormat,
  > 409 |               chartType: chartParams.chartType,
        |               ^^^^^^^^^
    410 |             })}
    411 |             data={dataApi.result as any}
    412 |             specificFunctions={{
MilanPospisil commented 4 weeks ago

Great job Pratyush :-) Now lets focus on changes you made in source code, that broke some functionality, we must be very careful with any js changes. TS changes are generaly much more safer.

prat98 commented 4 weeks ago

Thanks for the reviews updating right now!

prat98 commented 4 weeks ago

Issues:

  • AA 2.1 Onboarding Report no longer shows the chart
  • Changes made by job template no longer shows the chart

TSC errors:

ERROR in ./src/Containers/Reports/Layouts/Standard/ReportCard.tsx:292:17
TS2322: Type 'string | true | (string | boolean)[]' is not assignable to type 'ChartType | undefined'.
  Type 'string' is not assignable to type 'ChartType | undefined'.
    290 |                 y: chartParams.y,
    291 |                 xTickFormat: chartParams.xTickFormat,
  > 292 |                 chartType: chartParams.chartType,
        |                 ^^^^^^^^^
    293 |               })}
    294 |               dataComponent={'foobar'}
    295 |               data={dataApi.result as any}

ERROR in ./src/Containers/Reports/Layouts/Standard/ReportCard.tsx:344:19
TS2322: Type 'string | true | (string | boolean)[]' is not assignable to type 'ChartType | undefined'.
  Type 'string' is not assignable to type 'ChartType | undefined'.
    342 |                   y: chartParams.y,
    343 |                   xTickFormat: chartParams.xTickFormat,
  > 344 |                   chartType: chartParams.chartType,
        |                   ^^^^^^^^^
    345 |                 })}
    346 |                 dataComponent={'foobar'}
    347 |                 data={dataApi.result as any}

ERROR in ./src/Containers/Reports/Layouts/Standard/ReportCard.tsx:409:15
TS2322: Type 'string | true | (string | boolean)[]' is not assignable to type 'ChartType | undefined'.
  Type 'string' is not assignable to type 'ChartType | undefined'.
    407 |               y: chartParams.y,
    408 |               xTickFormat: chartParams.xTickFormat,
  > 409 |               chartType: chartParams.chartType,
        |               ^^^^^^^^^
    410 |             })}
    411 |             data={dataApi.result as any}
    412 |             specificFunctions={{

Odd I didn't see these tsc error on my end. Let me look into them