Skip to content

Commit 4ec182d

Browse files
committed
fix comments
1 parent c456f45 commit 4ec182d

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

src/components/molecules/GenericBarChart.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface ISingleBarChartProps extends IBarChartBaseProps {}
3535

3636
interface IMultiBarChartProps extends IBarChartBaseProps {
3737
isStacked: boolean;
38-
yLabels?: string[];
38+
customYLabels?: string[];
3939
editorBarOptions?: Record<number, boolean>;
4040
}
4141

@@ -107,16 +107,16 @@ const MultiBarChart: FC<IMultiBarChartProps> = ({
107107
isStacked,
108108
textLabel,
109109
subtitle,
110-
yLabels,
110+
customYLabels,
111111
editorBarOptions,
112112
}) => {
113113
const theme = useTheme();
114114
const colors = (theme.palette.primary as ColorScheme).barChartColors;
115115

116116
const defaultYLabels = data ? Object.keys(data[0]) : [];
117-
const customYLabels = yLabels || defaultYLabels.slice(1);
117+
const yLabels= customYLabels || defaultYLabels.slice(1);
118118

119-
const maxBarsNum = customYLabels.length;
119+
const maxBarsNum = yLabels.length;
120120
const filteredColors: Record<string, any> =
121121
editorBarOptions && Object.keys(editorBarOptions).length !== 0
122122
? Object.values(editorBarOptions)
@@ -150,14 +150,14 @@ const MultiBarChart: FC<IMultiBarChartProps> = ({
150150
key={i}
151151
stackId={isStacked ? 'stack_1' : undefined}
152152
fill={filteredColors[i]}
153-
dataKey={customYLabels[i]}
153+
dataKey={yLabels[i]}
154154
style={barStyle}
155155
isAnimationActive={false}
156156
>
157157
{!isStacked && (
158158
<LabelList
159159
content={<CustomizedLabel isPercentage={isPercentage} isStacked={isStacked} />}
160-
dataKey={customYLabels[i]}
160+
dataKey={yLabels[i]}
161161
/>
162162
)}
163163
</Bar>

src/components/molecules/widgets/KilledAndInjuredCountPerAgeGroupStackedWidget.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ interface IProps {
1111

1212
const KilledAndInjuredCountPerAgeGroupStackedWidget: FC<IProps> = ({ data, editorBarOptions }) => {
1313
const { text } = data;
14-
debugger;
1514
const multiBarSeries = createBarWidget(data, editorBarOptions);
1615
return <MultiBarChart isStacked={true} isPercentage={false} data={multiBarSeries}
1716
textLabel={text.title}
18-
yLabels={Object.values(text.labels_map)}
17+
customYLabels={Object.values(text.labels_map)}
1918
subtitle={text.subtitle}
2019
editorBarOptions={editorBarOptions} />;
2120
};

src/const/cards.const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const operationalCards: WidgetName[] = [
1818
// WidgetName.accident_count_by_driver_type,
1919
WidgetName.killed_and_injured_count_per_age_group,
2020
WidgetName.accident_count_by_day_night,
21-
WidgetName.killed_and_injured_count_per_age_group_stacked
21+
WidgetName.killed_and_injured_count_per_age_group_stacked,
2222
];
2323

2424
export type OrgLogoData = {key : string, path:string} ;

src/models/WidgetData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,4 @@ export interface IWidgetKilledAndInjuredCountPerAgeGroup extends IWidgetDataBase
197197
subtitle?: string;
198198
title?: string;
199199
};
200-
}
200+
}

src/services/widgets.data.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const fetchWidgets = async ({
4747
}: IWidgetInput): Promise<ILocationData | undefined> => {
4848
try {
4949
const widgetsUrl = getWidgetUrl({ lang, newsId, yearAgo, gpsId, city, street });
50+
console.log(widgetsUrl);
5051
const response = await axios.get(widgetsUrl);
5152
return processWidgetsFetchResponse(response);
5253
} catch (error) {

src/utils/barChart.utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const barsWidgetsLabels: Record<string, Array<string>> = {
1010
['textView.fatal.plural', 'textView.severe.plural', 'textView.light.plural'],
1111
'injured_count_by_accident_year':
1212
['textView.killed.plural', 'textView.severeInjured.plural', 'textView.lightInjured.plural'],
13-
}
13+
}
1414

1515
export const barsWidgetsTitle: Record<string, string> = {
1616
'accident_count_by_accident_year': 'cardEditor.showAccidents',
@@ -75,7 +75,6 @@ export function createBarWidget (
7575
data: IWidgetMultiBarData,
7676
editorBarOptions: Record<number, boolean>
7777
): BarDataMap[] {
78-
debugger
7978
const { items, text } = data;
8079
const excludeList = (Object.keys(editorBarOptions).length !== 0) ?
8180
Object.values(editorBarOptions).map((include: any, index: number) => {

0 commit comments

Comments
 (0)