Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into colorConsolidation
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Oct 21, 2023
2 parents 0aec38b + d338a73 commit 4b88c2c
Show file tree
Hide file tree
Showing 399 changed files with 1,227 additions and 406 deletions.
10 changes: 10 additions & 0 deletions packages/desktop-client/e2e/page-models/reports-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ export class ReportsPage {
return this.pageContent.getByRole('link', { name: /^Net/ }).waitFor();
}

async goToNetWorthPage() {
await this.pageContent.getByRole('link', { name: /^Net/ }).click();
return new ReportsPage(this.page);
}

async goToCashFlowPage() {
await this.pageContent.getByRole('link', { name: /^Cash/ }).click();
return new ReportsPage(this.page);
}

async getAvailableReportList() {
return this.pageContent
.getByRole('link')
Expand Down
10 changes: 10 additions & 0 deletions packages/desktop-client/e2e/reports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,14 @@ test.describe('Reports', () => {
expect(reports).toEqual(['Net Worth', 'Cash Flow']);
await expect(page).toHaveScreenshot(screenshotConfig(page));
});

test('loads net worth graph and checks visuals', async () => {
await reportsPage.goToNetWorthPage();
await expect(page).toHaveScreenshot(screenshotConfig(page));
});

test('loads cash flow graph and checks visuals', async () => {
await reportsPage.goToCashFlowPage();
await expect(page).toHaveScreenshot(screenshotConfig(page));
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/desktop-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"watch": "cross-env BROWSER=none yarn start",
"build": "cross-env INLINE_RUNTIME_CHUNK=false craco build",
"build:browser": "cross-env ./bin/build-browser",
"generate:icons": "rm src/icons/*/*.js; cd src/icons && svgr --expand-props start --ext js -d . .",
"generate:icons": "rm src/icons/*/*.tsx; cd src/icons && svgr --typescript --expand-props start -d . .",
"test": "craco test",
"e2e": "npx playwright test --browser=chromium",
"vrt": "cross-env VRT=true npx playwright test --browser=chromium"
Expand Down
6 changes: 5 additions & 1 deletion packages/desktop-client/src/components/LoggedInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export default function LoggedInUser({

return (
<View style={{ flexDirection: 'row', alignItems: 'center', ...style }}>
<Button type="bare" onClick={() => setMenuOpen(true)} style={{ color }}>
<Button
type="bare"
onClick={() => setMenuOpen(true)}
style={color && { color }}
>
{serverMessage()}
</Button>

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) {
syncState === 'offline' ||
syncState === 'local'
? theme.altTableText
: null;
: 'inherit';

const activeStyle = isMobile
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ function SingleAutocomplete({
offset={2}
style={{
padding: 0,
backgroundColor: theme.menuItemText,
color: theme.tableBackground,
backgroundColor: theme.menuAutoCompleteBackground,
color: theme.menuAutoCompleteText,
minWidth: 200,
...tooltipStyle,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const BudgetCategories = memo(
<View
style={{
marginBottom: 10,
backgroundColor: 'white',
backgroundColor: theme.tableBackground,
overflow: 'hidden',
boxShadow: styles.cardShadow,
borderRadius: '0 0 4px 4px',
Expand Down Expand Up @@ -235,7 +235,7 @@ const BudgetCategories = memo(
<View
style={{
height: styles.incomeHeaderHeight,
backgroundColor: 'white',
backgroundColor: theme.tableBackground,
}}
>
<IncomeHeader
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/budget/BudgetTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { createRef, Component } from 'react';

import * as monthUtils from 'loot-core/src/shared/months';

import { styles } from '../../style';
import { theme, styles } from '../../style';
import View from '../common/View';
import { IntersectionBoundary } from '../tooltips';

Expand Down Expand Up @@ -189,7 +189,7 @@ class BudgetTable extends Component {
backgroundColor: 'transparent',
},
'& ::-webkit-scrollbar-thumb:vertical': {
backgroundColor: 'white',
backgroundColor: theme.tableHeaderBackground,
},
}),
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const BudgetTotals = memo(function BudgetTotals({
<View
data-testid="budget-totals"
style={{
backgroundColor: 'white',
backgroundColor: theme.tableBackground,
flexDirection: 'row',
flexShrink: 0,
boxShadow: styles.cardShadow,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import { theme } from '../../style';
import View from '../common/View';
import { useDraggable, useDroppable, DropHighlight } from '../sort';
import { Row } from '../table';
Expand Down Expand Up @@ -46,7 +47,7 @@ function ExpenseCategory({
innerRef={dropRef}
collapsed={true}
style={{
backgroundColor: 'transparent',
backgroundColor: theme.tableBackground,
opacity: cat.hidden ? 0.5 : undefined,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Text from './Text';
import View from './View';

export type ModalProps = {
title: string;
title?: string;
isCurrent?: boolean;
isHidden?: boolean;
children: ReactNode | (() => ReactNode);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React, { useState } from 'react';

import { type FinanceModals } from 'loot-core/src/client/state-types/modals';
import { send } from 'loot-core/src/platform/client/fetch';
import { getTestKeyError } from 'loot-core/src/shared/errors';

import { type BoundActions } from '../../hooks/useActions';
import { theme } from '../../style';
import { type CommonModalProps } from '../../types/modals';
import Button, { ButtonWithLoading } from '../common/Button';
import ExternalLink from '../common/ExternalLink';
import InitialFocus from '../common/InitialFocus';
Expand All @@ -13,11 +16,17 @@ import Paragraph from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

type FixEncryptionKeyProps = {
modalProps: CommonModalProps;
actions: BoundActions;
options: FinanceModals['fix-encryption-key'];
};

export default function FixEncryptionKey({
modalProps,
actions,
options = {},
}) {
}: FixEncryptionKeyProps) {
let { hasExistingKey, cloudFileId, onSuccess } = options;

let [password, setPassword] = useState('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function CashFlowGraph({ graphData, isConcise }: CashFlowGraphProps) {
}
>
<VictoryGroup>
<VictoryBar data={graphData.expenses} />
<VictoryBar
data={graphData.expenses}
style={{ data: { fill: chartTheme.colors.red } }}
/>
<VictoryBar data={graphData.income} />
</VictoryGroup>
<VictoryLine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default function ScheduleDetails({ modalProps, actions, id }) {
q('transactions')
.filter({ schedule: state.schedule.id })
.select('*')
.options({ splits: 'none' }),
.options({ splits: 'all' }),
data => dispatch({ type: 'set-transactions', transactions: data }),
);
return live.unsubscribe;
Expand Down Expand Up @@ -303,7 +303,7 @@ export default function ScheduleDetails({ modalProps, actions, id }) {
q('transactions')
.filter({ $and: filters })
.select('*')
.options({ splits: 'none' }),
.options({ splits: 'all' }),
data => dispatch({ type: 'set-transactions', transactions: data }),
);
unsubscribe = live.unsubscribe;
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/settings/Themes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { useActions } from '../../hooks/useActions';
import { themeNames, useTheme } from '../../style';
import { themeOptions, useTheme } from '../../style';
import Button from '../common/Button';
import Select from '../common/Select';
import Text from '../common/Text';
Expand All @@ -21,7 +21,7 @@ export default function ThemeSettings() {
saveGlobalPrefs({ theme: value });
}}
value={theme}
options={themeNames.map(name => [name, name])}
options={themeOptions}
/>
</Button>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import React, { type SVGProps } from 'react';

import { css } from 'glamor';
import { css, keyframes } from 'glamor';

import Loading from './Loading';

const rotation = css.keyframes({
const rotation = keyframes({
'0%': { transform: 'rotate(-90deg)' },
'100%': { transform: 'rotate(666deg)' },
});

function AnimatedLoading(props) {
function AnimatedLoading(props: SVGProps<SVGSVGElement>) {
return (
<span
className={`${css({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import React, { type SVGProps, useState } from 'react';

const SvgLoading = props => {
const SvgLoading = (props: SVGProps<SVGSVGElement>) => {
let { color = 'currentColor' } = props;
let [gradientId] = useState('gradient-' + Math.random());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgLogo = props => (
import type { SVGProps } from 'react';
const SvgLogo = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/src/icons/logo/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Logo } from './Logo';
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAdd = props => (
import type { SVGProps } from 'react';
const SvgAdd = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgDelete = props => (
import type { SVGProps } from 'react';
const SvgDelete = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgExpandArrow = props => (
import type { SVGProps } from 'react';
const SvgExpandArrow = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgLeftArrow2 = props => (
import type { SVGProps } from 'react';
const SvgLeftArrow2 = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgMath = props => (
import type { SVGProps } from 'react';
const SvgMath = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgMerge = props => (
import type { SVGProps } from 'react';
const SvgMerge = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgRightArrow2 = props => (
import type { SVGProps } from 'react';
const SvgRightArrow2 = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgSplit = props => (
import type { SVGProps } from 'react';
const SvgSplit = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgSubtract = props => (
import type { SVGProps } from 'react';
const SvgSubtract = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
9 changes: 9 additions & 0 deletions packages/desktop-client/src/icons/v0/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export { default as Add } from './Add';
export { default as Delete } from './Delete';
export { default as ExpandArrow } from './ExpandArrow';
export { default as LeftArrow2 } from './LeftArrow2';
export { default as Math } from './Math';
export { default as Merge } from './Merge';
export { default as RightArrow2 } from './RightArrow2';
export { default as Split } from './Split';
export { default as Subtract } from './Subtract';
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAdd = props => (
import type { SVGProps } from 'react';
const SvgAdd = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAddOutline = props => (
import type { SVGProps } from 'react';
const SvgAddOutline = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAddSolid = props => (
import type { SVGProps } from 'react';
const SvgAddSolid = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAdjust = props => (
import type { SVGProps } from 'react';
const SvgAdjust = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAirplane = props => (
import type { SVGProps } from 'react';
const SvgAirplane = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
const SvgAlbum = props => (
import type { SVGProps } from 'react';
const SvgAlbum = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Loading

0 comments on commit 4b88c2c

Please sign in to comment.