Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DEV-13777): invoice split screen and new component for customer #534

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
eb25f78
DEV-13777 invoice split screen and new component for customer
cristinafrombr Jan 21, 2025
3c5803f
Merge branch 'v4' of github.com:team-monite/monite-sdk into DEV-13777…
cristinafrombr Jan 22, 2025
e824639
dev-13777 new customer component with + decorator and letter from sel…
cristinafrombr Jan 22, 2025
497b82a
dev-13777 border-color fixes for customer component
cristinafrombr Jan 22, 2025
ca65821
dev-13777 optimizing autocomplete border css
cristinafrombr Jan 23, 2025
4bbcd34
dev-13777 address within customer input
cristinafrombr Jan 23, 2025
9a81354
dev-13777 invoice preview structure
cristinafrombr Jan 23, 2025
ec3743b
DEV-13777 using sample data for invoice preview for now
cristinafrombr Jan 23, 2025
6d447ca
DEV-13777 scroll enforced only in form (left) side of screen
cristinafrombr Jan 24, 2025
06da043
DEV-13777 functional modal create new counterpart
cristinafrombr Jan 25, 2025
2922d7b
dev-13777 edit counterpart modal basics
cristinafrombr Jan 25, 2025
194adc7
dev-13777 value of new counterpart is used
cristinafrombr Jan 25, 2025
ad3ce95
dev-13777 showing real counterpart address and name in invoice preview
cristinafrombr Jan 26, 2025
9639c67
dev-13777 payment terms and other real data in invoice preview
cristinafrombr Jan 28, 2025
2d99c67
dev-13777 removing excess css from invoice preview, formatting price
cristinafrombr Jan 28, 2025
a229c51
dev-13777 fixed border color, displaying currency symbol
cristinafrombr Jan 28, 2025
e0c4173
dev-13777 edit customer modal with new read only fields
cristinafrombr Jan 28, 2025
8a94b0f
dev-13777 more improvements to edit counterpart modal, replace asteri…
cristinafrombr Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCallback, useMemo } from 'react';

import { CounterpartVatForm } from '@/components/counterparts/CounterpartDetails/CounterpartVatForm';
import { MoniteScopedProviders } from '@/core/context/MoniteScopedProviders';
import { CircularProgress } from '@mui/material';

import { CounterpartAddressFormUpdate } from './CounterpartAddressFormUpdate';
import { CounterpartBankForm } from './CounterpartBankForm';
Expand Down Expand Up @@ -35,6 +36,7 @@ const CounterpartDetailsBase = (props: CounterpartsDetailsProps) => {
onAddressEdit,
onAddressUpdate,
contactId,
onClose,
onContactEdit,
onContactCreate,
onContactUpdate,
Expand All @@ -60,7 +62,7 @@ const CounterpartDetailsBase = (props: CounterpartsDetailsProps) => {
const defaultValues = props.type ? props.defaultValues : undefined;

const renderSubResource = useCallback(() => {
if (!counterpartId) return null;
if (!counterpartId) return <CircularProgress color="inherit" size={20} />;

switch (counterpartView) {
case COUNTERPART_VIEW.view:
Expand Down Expand Up @@ -145,6 +147,7 @@ const CounterpartDetailsBase = (props: CounterpartsDetailsProps) => {
onBankCreate,
onBankEdit,
onBankUpdate,
onClose,
onContactCancel,
onContactCreate,
onContactEdit,
Expand Down Expand Up @@ -174,6 +177,7 @@ const CounterpartDetailsBase = (props: CounterpartsDetailsProps) => {
id={counterpartId}
onCancel={showView}
onCreate={onCreate}
onClose={props.onClose}
onUpdate={onUpdate}
showCategories={showCategories}
defaultValues={defaultValues}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
{dialogContext?.isDialogContent && (
<IconWrapper
aria-label={t(i18n)`Counterpart Close`}
onClick={dialogContext.onClose}
onClick={props.onClose || dialogContext.onClose}
color="inherit"
>
<CloseIcon />
Expand Down Expand Up @@ -386,7 +386,11 @@ export const CounterpartIndividualForm = (props: CounterpartsFormProps) => {
<Button
variant="outlined"
color="inherit"
onClick={isUpdateMode ? props.onCancel : dialogContext?.onClose}
onClick={
isUpdateMode
? props.onCancel
: props.onClose || dialogContext?.onClose
}
>
{t(i18n)`Cancel`}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type CounterpartsFormProps = {
*/
id?: string;
onCancel?: () => void;
onClose?: () => void;
onCreate?: (id: string) => void;
onUpdate?: (id: string) => void;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ export const CounterpartView = (props: CounterpartViewProps) => {
/>
);
}

return (
<>
<Grid container alignItems="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type CounterpartViewProps = {

onAddressEdit?: (id: string) => void;

onClose?: () => void;

onContactCreate?: () => void;
onContactEdit?: (id: string) => void;
onContactDelete?: (id: string) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ interface CommonCounterpartDetailsProps
*/
onDelete?: (id: CounterpartId) => void;

onClose?: () => void;

onContactCreate?: (id: CounterpartId) => void;
onContactUpdate?: (id: CounterpartId) => void;
onContactDelete?: (id: CounterpartId) => void;
Expand Down Expand Up @@ -149,6 +151,7 @@ export function useCounterpartDetails(props: CounterpartsDetailsProps) {
}
}, [actions, props.id, props.type]);

const onClose = useLatest(props.onClose);
const onCreateImmutable = useLatest(props.onCreate);
const onCreate = useCallback(
(id: string) => {
Expand Down Expand Up @@ -311,6 +314,7 @@ export function useCounterpartDetails(props: CounterpartsDetailsProps) {
vatId,
counterpartView,
actions,
onClose,
onCreate,
onUpdate,
onEdit,
Expand Down
Loading