Skip to content

Commit

Permalink
variable name casing corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
brettedw committed Sep 18, 2023
1 parent 0a4ae9b commit 96ec1a9
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 66 deletions.
4 changes: 2 additions & 2 deletions web/src/features/moreCast2/components/DataGridColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { WeatherDeterminate, WeatherDeterminateChoices } from 'api/moreCast2API'
import {
MORECAST2_FIELDS,
MORECAST2_FORECAST_FIELDS,
MORECAST2_INDICES_FIELDS,
MORECAST2_INDEX_FIELDS,
MORECAST2_STATION_DATE_FIELDS
} from 'features/moreCast2/components/MoreCast2Column'

Expand Down Expand Up @@ -55,7 +55,7 @@ export class DataGridColumns {
public static getSummaryColumns(): GridColDef[] {
return MORECAST2_STATION_DATE_FIELDS.map(field => field.generateColDef()).concat(
MORECAST2_FORECAST_FIELDS.map(forecastField => forecastField.generateForecastColDef()).concat(
MORECAST2_INDICES_FIELDS.map(field => field.generateColDef())
MORECAST2_INDEX_FIELDS.map(field => field.generateColDef())
)
)
}
Expand Down
32 changes: 16 additions & 16 deletions web/src/features/moreCast2/components/MoreCast2Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ export class IndeterminateField implements ColDefGenerator, ForecastColDefGenera
}
}

export const TempForecastField = new IndeterminateField('temp', 'Temp', 'number', 1, true)
export const RHForecastField = new IndeterminateField('rh', 'RH', 'number', 0, true)
export const WindDirForecastField = new IndeterminateField('windDirection', 'Wind Dir', 'number', 0, false)
export const WindSpeedForecastField = new IndeterminateField('windSpeed', 'Wind Speed', 'number', 1, true)
export const PrecipForecastField = new IndeterminateField('precip', 'Precip', 'number', 1, false)
export const tempForecastField = new IndeterminateField('temp', 'Temp', 'number', 1, true)
export const rhForecastField = new IndeterminateField('rh', 'RH', 'number', 0, true)
export const windDirForecastField = new IndeterminateField('windDirection', 'Wind Dir', 'number', 0, false)
export const windSpeedForecastField = new IndeterminateField('windSpeed', 'Wind Speed', 'number', 1, true)
export const precipForecastField = new IndeterminateField('precip', 'Precip', 'number', 1, false)
export const buiField = new IndeterminateField('bui', 'BUI', 'number', 0, false)
export const isiField = new IndeterminateField('isi', 'ISI', 'number', 1, false)
export const fwiField = new IndeterminateField('fwi', 'FWI', 'number', 0, false)
Expand All @@ -128,22 +128,22 @@ export const MORECAST2_STATION_DATE_FIELDS: ColDefGenerator[] = [
export const MORECAST2_FIELDS: ColDefGenerator[] = [
StationForecastField.getInstance(),
DateForecastField.getInstance(),
TempForecastField,
RHForecastField,
WindDirForecastField,
WindSpeedForecastField,
PrecipForecastField
tempForecastField,
rhForecastField,
windDirForecastField,
windSpeedForecastField,
precipForecastField
]

export const MORECAST2_FORECAST_FIELDS: ForecastColDefGenerator[] = [
TempForecastField,
RHForecastField,
WindDirForecastField,
WindSpeedForecastField,
PrecipForecastField
tempForecastField,
rhForecastField,
windDirForecastField,
windSpeedForecastField,
precipForecastField
]

export const MORECAST2_INDICES_FIELDS: ColDefGenerator[] = [
export const MORECAST2_INDEX_FIELDS: ColDefGenerator[] = [
buiField,
isiField,
fwiField,
Expand Down
10 changes: 5 additions & 5 deletions web/src/features/moreCast2/components/applyToColumnMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { DEFAULT_MODEL_TYPE } from 'api/moreCast2API'
import ApplyToColumnMenu from 'features/moreCast2/components/ApplyToColumnMenu'
import { ColumnDefBuilder } from 'features/moreCast2/components/ColumnDefBuilder'
import { GridComponentRenderer } from 'features/moreCast2/components/GridComponentRenderer'
import { TempForecastField } from 'features/moreCast2/components/MoreCast2Column'
import { tempForecastField } from 'features/moreCast2/components/MoreCast2Column'
import React from 'react'

describe('ApplyToColumnMenu', () => {
const colDefBuilder = new ColumnDefBuilder(
TempForecastField.field,
TempForecastField.headerName,
TempForecastField.type,
TempForecastField.precision,
tempForecastField.field,
tempForecastField.headerName,
tempForecastField.type,
tempForecastField.precision,
new GridComponentRenderer()
)
it('should not render the menu when no context from a click exists', async () => {
Expand Down
26 changes: 13 additions & 13 deletions web/src/features/moreCast2/components/colDefBuilder.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
ORDERED_COLUMN_HEADERS
} from 'features/moreCast2/components/ColumnDefBuilder'
import { GridComponentRenderer } from 'features/moreCast2/components/GridComponentRenderer'
import { TempForecastField } from 'features/moreCast2/components/MoreCast2Column'
import { tempForecastField } from 'features/moreCast2/components/MoreCast2Column'

describe('ColDefBuilder', () => {
const colDefBuilder = new ColumnDefBuilder(
TempForecastField.field,
TempForecastField.headerName,
TempForecastField.type,
TempForecastField.precision,
tempForecastField.field,
tempForecastField.headerName,
tempForecastField.type,
tempForecastField.precision,
new GridComponentRenderer()
)

Expand Down Expand Up @@ -44,19 +44,19 @@ describe('ColDefBuilder', () => {

const expected = [
JSON.stringify({
field: `${TempForecastField.field}${WeatherDeterminate.FORECAST}`,
field: `${tempForecastField.field}${WeatherDeterminate.FORECAST}`,
disableColumnMenu: true,
disableReorder: true,
editable: true,
headerName: TempForecastField.headerName,
headerName: tempForecastField.headerName,
sortable: false,
type: 'number',
width: DEFAULT_FORECAST_COLUMN_WIDTH
})
].concat(
ORDERED_COLUMN_HEADERS.map(determinate =>
JSON.stringify({
field: `${TempForecastField.field}${determinate}`,
field: `${tempForecastField.field}${determinate}`,
disableColumnMenu: true,
disableReorder: true,
headerName: determinate,
Expand Down Expand Up @@ -98,13 +98,13 @@ describe('ColDefBuilder', () => {

expect(JSON.stringify(forecastColDef)).toEqual(
JSON.stringify({
field: `${TempForecastField.field}${WeatherDeterminate.FORECAST}`,
field: `${tempForecastField.field}${WeatherDeterminate.FORECAST}`,
disableColumnMenu: true,
disableReorder: true,
editable: true,
headerName: TempForecastField.headerName,
headerName: tempForecastField.headerName,
sortable: false,
type: TempForecastField.type,
type: tempForecastField.type,
width: DEFAULT_FORECAST_COLUMN_WIDTH
})
)
Expand All @@ -117,13 +117,13 @@ describe('ColDefBuilder', () => {

expect(JSON.stringify(forecastColDef)).toEqual(
JSON.stringify({
field: `${TempForecastField.field}${WeatherDeterminate.FORECAST}`,
field: `${tempForecastField.field}${WeatherDeterminate.FORECAST}`,
disableColumnMenu: true,
disableReorder: true,
editable: true,
headerName: header,
sortable: false,
type: TempForecastField.type,
type: tempForecastField.type,
width: DEFAULT_FORECAST_COLUMN_WIDTH
})
)
Expand Down
60 changes: 30 additions & 30 deletions web/src/features/moreCast2/components/moreCast2Column.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { DEFAULT_COLUMN_WIDTH } from 'features/moreCast2/components/ColumnDefBui
import {
StationForecastField,
DateForecastField,
TempForecastField,
RHForecastField,
WindDirForecastField,
WindSpeedForecastField,
PrecipForecastField
tempForecastField,
rhForecastField,
windDirForecastField,
windSpeedForecastField,
precipForecastField
} from 'features/moreCast2/components/MoreCast2Column'
import { DateTime } from 'luxon'

Expand Down Expand Up @@ -53,84 +53,84 @@ describe('MoreCast2Column', () => {
})
describe('TempForecastField', () => {
it('should have the desired configuration', () => {
const instance = TempForecastField
expect(TempForecastField.precision).toEqual(1)
const instance = tempForecastField
expect(tempForecastField.precision).toEqual(1)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: TempForecastField.field,
field: tempForecastField.field,
disableColumnMenu: true,
disableReorder: true,
headerName: TempForecastField.headerName,
headerName: tempForecastField.headerName,
sortable: false,
type: TempForecastField.type,
type: tempForecastField.type,
width: DEFAULT_COLUMN_WIDTH
})
)
})
})
describe('RHForecastField', () => {
it('should have the desired configuration', () => {
const instance = RHForecastField
expect(RHForecastField.precision).toEqual(0)
const instance = rhForecastField
expect(rhForecastField.precision).toEqual(0)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: RHForecastField.field,
field: rhForecastField.field,
disableColumnMenu: true,
disableReorder: true,
headerName: RHForecastField.headerName,
headerName: rhForecastField.headerName,
sortable: false,
type: RHForecastField.type,
type: rhForecastField.type,
width: DEFAULT_COLUMN_WIDTH
})
)
})
})
describe('WindDirForecastField', () => {
it('should have the desired configuration', () => {
const instance = WindDirForecastField
expect(WindDirForecastField.precision).toEqual(0)
const instance = windDirForecastField
expect(windDirForecastField.precision).toEqual(0)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: WindDirForecastField.field,
field: windDirForecastField.field,
disableColumnMenu: true,
disableReorder: true,
headerName: WindDirForecastField.headerName,
headerName: windDirForecastField.headerName,
sortable: false,
type: WindDirForecastField.type,
type: windDirForecastField.type,
width: DEFAULT_COLUMN_WIDTH
})
)
})
})
describe('WindSpeedForecastField', () => {
it('should have the desired configuration', () => {
const instance = WindSpeedForecastField
expect(WindSpeedForecastField.precision).toEqual(1)
const instance = windSpeedForecastField
expect(windSpeedForecastField.precision).toEqual(1)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: WindSpeedForecastField.field,
field: windSpeedForecastField.field,
disableColumnMenu: true,
disableReorder: true,
headerName: WindSpeedForecastField.headerName,
headerName: windSpeedForecastField.headerName,
sortable: false,
type: WindSpeedForecastField.type,
type: windSpeedForecastField.type,
width: DEFAULT_COLUMN_WIDTH
})
)
})
})
describe('PrecipForecastField', () => {
it('should have the desired configuration', () => {
const instance = PrecipForecastField
expect(PrecipForecastField.precision).toEqual(1)
const instance = precipForecastField
expect(precipForecastField.precision).toEqual(1)
expect(JSON.stringify(instance.generateColDef())).toEqual(
JSON.stringify({
field: PrecipForecastField.field,
field: precipForecastField.field,
disableColumnMenu: true,
disableReorder: true,
headerName: PrecipForecastField.headerName,
headerName: precipForecastField.headerName,
sortable: false,
type: PrecipForecastField.type,
type: precipForecastField.type,
width: DEFAULT_COLUMN_WIDTH
})
)
Expand Down

0 comments on commit 96ec1a9

Please sign in to comment.