Skip to content

Commit

Permalink
Merge branch 'master' into matiss/electron-reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis authored Oct 4, 2023
2 parents 402526a + 476070b commit 9f96b6c
Show file tree
Hide file tree
Showing 109 changed files with 179 additions and 506 deletions.
10 changes: 10 additions & 0 deletions packages/desktop-client/e2e/schedules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,15 @@ test.describe('Schedules', () => {
'Show completed schedules',
);
await expect(page).toHaveScreenshot(screenshotConfig(page));

// Schedules search shouldn't shrink with many schedules
for (let i = 0; i < 15; i++) {
await schedulesPage.addNewSchedule({
payee: 'Home Depot',
account: 'HSBC',
amount: 0,
});
}
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.
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.
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.
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
@@ -1,6 +1,6 @@
{
"name": "@actual-app/web",
"version": "23.9.0",
"version": "23.10.0",
"license": "MIT",
"files": [
"build"
Expand Down
8 changes: 4 additions & 4 deletions packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Notification({
style={{
marginTop: 10,
color: positive
? theme.alt4NoticeText
? theme.noticeText
: error
? theme.alt3ErrorText
: theme.alt4WarningText,
Expand All @@ -121,13 +121,13 @@ function Notification({
padding: '14px 14px',
fontSize: 14,
backgroundColor: positive
? theme.alt2NoticeBackground
? theme.noticeBackgroundLight
: error
? theme.errorBackground
: theme.alt2WarningBackground,
borderTop: `3px solid ${
positive
? theme.altNoticeAccent
? theme.noticeBorder
: error
? theme.altErrorAccent
: theme.altWarningAccent
Expand Down Expand Up @@ -173,7 +173,7 @@ function Notification({
backgroundColor: 'transparent',
border: `1px solid ${
positive
? theme.altNoticeAccent
? theme.noticeBorder
: error
? theme.altErrorAccent
: theme.altWarningAccent
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/accounts/Balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function Balances({
value < 0
? theme.errorText
: value > 0
? theme.noticeText
? theme.noticeTextLight
: theme.pageTextSubdued,
})}
privacyFilter={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function AccountCard({ account, updated, getBalanceQuery, onSelect }) {
{account.bankId && (
<View
style={{
backgroundColor: theme.noticeText,
backgroundColor: theme.noticeBackgroundDark,
marginLeft: '-23px',
width: 8,
height: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function ReconcilingMessage({
{targetDiff === 0 ? (
<View
style={{
color: theme.noticeText,
color: theme.noticeTextLight,
flex: 1,
flexDirection: 'row',
alignItems: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function CategoryList({
alignItems: 'center',
fontSize: 11,
fontWeight: 500,
color: theme.noticeAccent,
color: theme.noticeTextMenu,
padding: '6px 8px',
':active': {
backgroundColor: 'rgba(100, 100, 100, .25)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function PayeeList({
<View
style={{
display: 'block',
color: theme.noticeAccent,
color: theme.noticeTextMenu,
borderRadius: 4,
fontSize: isNarrowWidth ? 'inherit' : 11,
fontWeight: 500,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function IncomeProgress({ current, target }: IncomeProgressProps) {
return (
<PieProgress
progress={frac}
color={over ? theme.errorText : theme.noticeText}
color={over ? theme.errorText : theme.noticeTextLight}
backgroundColor={over ? theme.errorBackground : theme.pageBackground}
style={{ width: 20, height: 20 }}
/>
Expand Down Expand Up @@ -132,7 +132,7 @@ function ExpenseProgress({ current, target }: ExpenseProgressProps) {
return (
<PieProgress
progress={frac}
color={over ? theme.errorText : theme.noticeText}
color={over ? theme.errorText : theme.noticeTextLight}
backgroundColor={over ? theme.errorBackground : theme.pageBackground}
style={{ width: 20, height: 20 }}
/>
Expand Down Expand Up @@ -379,7 +379,6 @@ export function BudgetSummary({ month }: BudgetSummaryProps) {
fontWeight: 500,
textDecorationSkip: 'ink',
},
currentMonth === month && { textDecoration: 'underline' },
])}`}
>
{monthUtils.format(month, 'MMMM')}
Expand Down Expand Up @@ -473,7 +472,7 @@ export function BudgetSummary({ month }: BudgetSummaryProps) {
padding: '10px 20px',
justifyContent: 'space-between',
backgroundColor: theme.tableRowHeaderBackground,
borderTop: '1px solid ' + theme.tableRowHeaderText,
borderTop: '1px solid ' + theme.tableBorder,
}}
>
<Saved projected={month >= currentMonth} />
Expand Down
75 changes: 59 additions & 16 deletions packages/desktop-client/src/components/common/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ButtonProps = HTMLProps<HTMLButtonElement> & {
as?: ElementType;
};

type ButtonType = 'normal' | 'primary' | 'bare';
type ButtonType = 'normal' | 'primary' | 'bare' | 'link';

const backgroundColor = {
normal: theme.buttonNormalBackground,
Expand All @@ -33,6 +33,7 @@ const backgroundColor = {
bareDisabled: theme.buttonBareDisabledBackground,
menu: theme.buttonMenuBackground,
menuSelected: theme.buttonMenuSelectedBackground,
link: theme.buttonBareBackground,
};

const backgroundColorHover = {
Expand All @@ -41,6 +42,7 @@ const backgroundColorHover = {
bare: theme.buttonBareBackgroundHover,
menu: theme.buttonMenuBackgroundHover,
menuSelected: theme.buttonMenuSelectedBackgroundHover,
link: theme.buttonBareBackground,
};

const borderColor = {
Expand All @@ -50,6 +52,7 @@ const borderColor = {
primaryDisabled: theme.buttonPrimaryDisabledBorder,
menu: theme.buttonMenuBorder,
menuSelected: theme.buttonMenuSelectedBorder,
link: theme.buttonBareBackground,
};

const textColor = {
Expand All @@ -61,6 +64,7 @@ const textColor = {
bareDisabled: theme.buttonBareDisabledText,
menu: theme.buttonMenuText,
menuSelected: theme.buttonMenuSelectedText,
link: theme.pageTextLink,
};

const textColorHover = {
Expand All @@ -71,6 +75,55 @@ const textColorHover = {
menuSelected: theme.buttonMenuSelectedTextHover,
};

const linkButtonHoverStyles = {
textDecoration: 'underline',
boxShadow: 'none',
};

const _getBorder = (type, typeWithDisabled) => {
switch (type) {
case 'bare':
case 'link':
return 'none';

default:
return '1px solid ' + borderColor[typeWithDisabled];
}
};

const _getPadding = type => {
switch (type) {
case 'bare':
return '5px';
case 'link':
return '0';
default:
return '5px 10px';
}
};

const _getActiveStyles = (type, bounce) => {
switch (type) {
case 'bare':
return { backgroundColor: theme.buttonBareBackgroundActive };
case 'link':
return {
transform: 'none',
boxShadow: 'none',
};
default:
return {
transform: bounce && 'translateY(1px)',
boxShadow: `0 1px 4px 0 ${
type === 'primary'
? theme.buttonPrimaryShadow
: theme.buttonNormalShadow
}`,
transition: 'none',
};
}
};

const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(
{
Expand All @@ -94,22 +147,13 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(

hoveredStyle = {
...(type !== 'bare' && styles.shadow),
...(type === 'link' && linkButtonHoverStyles),
backgroundColor: backgroundColorHover[type],
color: color || textColorHover[type],
...hoveredStyle,
};
activeStyle = {
...(type === 'bare'
? { backgroundColor: theme.buttonBareBackgroundActive }
: {
transform: bounce && 'translateY(1px)',
boxShadow:
'0 1px 4px 0 ' +
(type === 'primary'
? theme.buttonPrimaryShadow
: theme.buttonNormalShadow),
transition: 'none',
}),
..._getActiveStyles(type, bounce),
...activeStyle,
};

Expand All @@ -118,14 +162,13 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
padding: type === 'bare' ? '5px' : '5px 10px',
padding: _getPadding(type),
margin: 0,
overflow: 'hidden',
display: 'flex',
display: type === 'link' ? 'inline' : 'flex',
borderRadius: 4,
backgroundColor: backgroundColor[typeWithDisabled],
border:
type === 'bare' ? 'none' : '1px solid ' + borderColor[typeWithDisabled],
border: _getBorder(type, typeWithDisabled),
color: color || textColor[typeWithDisabled],
transition: 'box-shadow .25s',
WebkitAppRegion: 'no-drag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ function ConfigureField({
<Stack direction="row" align="flex-start">
{field === 'amount' || field === 'date' ? (
<Select
bare
options={
field === 'amount'
? [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function ChangePassword() {
<Text
style={{
marginTop: 20,
color: theme.noticeText,
color: theme.noticeTextLight,
borderRadius: 4,
fontSize: 15,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ export default function GoCardlessExternalMsg({
fontSize: 15,
fontWeight: 600,
marginTop: 10,
backgroundColor: theme.alt3NoticeText,
borderColor: theme.alt3NoticeText,
backgroundColor: theme.noticeBackgroundDark,
borderColor: theme.noticeBackgroundDark,
}}
onClick={onContinue}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function ParsedDate({ parseDateFormat, showParsed, dateFormat, date }) {
)}{' '}
&rarr;{' '}
</Text>
<Text style={{ color: parsed ? theme.alt3NoticeText : theme.errorText }}>
<Text style={{ color: parsed ? theme.noticeTextLight : theme.errorText }}>
{parsed || 'Invalid'}
</Text>
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export default function PlaidExternalMsg({
fontSize: 15,
fontWeight: 600,
marginTop: 10,
backgroundColor: theme.alt3NoticeText,
borderColor: theme.alt3NoticeText,
backgroundColor: theme.noticeBackgroundDark,
borderColor: theme.noticeBorder,
}}
onClick={onContinue}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/payees/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function RuleButton({ ruleCount, focused, onEdit, onClick }) {
padding: '3px 6px',
backgroundColor: theme.noticeBackground,
border: '1px solid ' + theme.noticeBackground,
color: theme.altNoticeText,
color: theme.noticeTextDark,
fontSize: 12,
}}
onEdit={onEdit}
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/reports/Change.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Change({ amount }) {
<Block
style={{
...styles.smallText,
color: amount < 0 ? theme.errorText : theme.noticeText,
color: amount < 0 ? theme.errorText : theme.noticeTextLight,
}}
>
{amount >= 0 ? '+' : ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function ScheduleAmountCell({
<Text
style={{
flex: 1,
color: num > 0 ? theme.noticeText : theme.tableText,
color: num > 0 ? theme.noticeTextLight : theme.tableText,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
Expand Down
10 changes: 5 additions & 5 deletions packages/desktop-client/src/components/schedules/StatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export function getStatusProps(status: StatusTypes) {
};
case 'paid':
return {
color: theme.alt2NoticeText,
backgroundColor: theme.altNoticeBackground,
color: theme.noticeText,
backgroundColor: theme.noticeBackgroundLight,
Icon: ValidationCheck,
};
case 'completed':
Expand All @@ -50,8 +50,8 @@ export function getStatusProps(status: StatusTypes) {
};
case 'pending':
return {
color: theme.alt3NoticeText,
backgroundColor: theme.alt2NoticeBackground,
color: theme.noticeTextLight,
backgroundColor: theme.noticeBackgroundLight,
Icon: CalendarIcon,
};
case 'scheduled':
Expand All @@ -62,7 +62,7 @@ export function getStatusProps(status: StatusTypes) {
};
case 'cleared':
return {
color: theme.noticeText,
color: theme.noticeTextLight,
backgroundColor: theme.altTableBackground,
Icon: CheckCircle1,
};
Expand Down
Loading

0 comments on commit 9f96b6c

Please sign in to comment.