Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Feb 5, 2024
1 parent a0ca289 commit af2a03c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
15 changes: 9 additions & 6 deletions packages/desktop-client/src/components/reports/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { View } from '../common/View';
import { CashFlowCard } from './reports/CashFlowCard';
import { CategorySpendingCard } from './reports/CategorySpendingCard';
import { CustomReportCard } from './reports/CustomReportCard';
import {CustomReportListCards} from './reports/CustomReportListCards';
import { CustomReportListCards } from './reports/CustomReportListCards';
import { NetWorthCard } from './reports/NetWorthCard';
import { SankeyCard } from './reports/SankeyCard';

Expand All @@ -22,12 +22,15 @@ export function Overview() {
const sankeyFeatureFlag = useFeatureFlag('sankeyReport');

const customReportsFeatureFlag = useFeatureFlag('customReports');

const featureCount =
3 -
categorySpendingReportFeatureFlag ? 1 : 0 -
sankeyFeatureFlag ? 1 : 0 -
customReportsFeatureFlag ? 1 : 0;
3 - categorySpendingReportFeatureFlag
? 1
: 0 - sankeyFeatureFlag
? 1
: 0 - customReportsFeatureFlag
? 1
: 0;

const accounts = useSelector(state => state.queries.accounts);
return (
Expand Down
42 changes: 22 additions & 20 deletions packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,25 +184,27 @@ export function AreaGraph({
data={data.monthData}
margin={{ top: 0, right: labelsMargin, left: 0, bottom: 0 }}
>
{!compact && ( //flag
<>
<CartesianGrid strokeDasharray="3 3" vertical={false} />
<XAxis
dataKey="date"
tick={{ fill: theme.pageText }}
tickLine={{ stroke: theme.pageText }}
/>
<YAxis
dataKey={balanceTypeOp}
domain={[
viewLabels ? labelsMin : 'auto',
viewLabels ? labelsMax : 'auto',
]}
tickFormatter={tickFormatter}
tick={{ fill: theme.pageText }}
tickLine={{ stroke: theme.pageText }}
/>
</>
{compact ? null : (
<CartesianGrid strokeDasharray="3 3" vertical={false} />
)}
{compact ? null : (
<XAxis
dataKey="date"
tick={{ fill: theme.pageText }}
tickLine={{ stroke: theme.pageText }}
/>
)}
{compact ? null : (
<YAxis
dataKey={balanceTypeOp}
domain={[
viewLabels ? labelsMin : 'auto',
viewLabels ? labelsMax : 'auto',
]}
tickFormatter={tickFormatter}
tick={{ fill: theme.pageText }}
tickLine={{ stroke: theme.pageText }}
/>
)}
<Tooltip
content={<CustomTooltip balanceTypeOp={balanceTypeOp} />}
Expand Down Expand Up @@ -234,7 +236,7 @@ export function AreaGraph({
fill="url(#splitColor)"
fillOpacity={1}
>
{viewLabels && !compact && (
{viewLabels && (
<LabelList
dataKey={balanceTypeOp}
content={e => customLabel(e, width, lastLabel)}
Expand Down
1 change: 0 additions & 1 deletion packages/desktop-client/src/hooks/useFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export function useFilters<T>(initialFilters: T[] = []) {
const [saved, setSaved] = useState<T[]>(null);

const onApply = useCallback(
//flag
newFilter => {
if (newFilter === null) {
setFilters([]);
Expand Down
4 changes: 2 additions & 2 deletions packages/loot-core/src/client/data-hooks/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function toJS(rows: CustomReportData[]) {
export function useReports() {
const reports = toJS(useLiveQuery(() => q('reports').select('*'), []) || []);
/** Sort reports by alphabetical order */
// Sort reports by alphabetical order
function sort(reports) {
return reports.sort((a, b) =>
a.name.trim().localeCompare(b.name.trim(), { ignorePunctuation: true }),
Expand All @@ -42,7 +42,7 @@ export function useReports(): CustomReportEntity[] {
useLiveQuery(() => q('transaction_filters').select('*'), []) || [],
);

/** Sort reports by alphabetical order */
// Sort reports by alphabetical order
function sort(reports: CustomReportEntity[]) {
return reports.sort((a, b) =>
a.name && b.name
Expand Down

0 comments on commit af2a03c

Please sign in to comment.