Skip to content

Commit c90c33f

Browse files
committed
fix: edit changes
1 parent 42ab64b commit c90c33f

File tree

8 files changed

+29
-25
lines changed

8 files changed

+29
-25
lines changed

src/components/v5/common/ActionSidebar/partials/forms/PaymentBuilderForm/partials/PaymentBuilderRecipientsField/PaymentBuilderRecipientsField.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ const PaymentBuilderRecipientsField: FC<PaymentBuilderRecipientsFieldProps> = ({
8080
const isMobile = useMobile();
8181
const getMenuProps = ({ index }) => ({
8282
cardClassName: 'sm:min-w-[9.625rem]',
83+
contentWrapperClassName:
84+
'!left-6 right-6 !z-[65] sm:!left-auto sm:!right-0',
8385
items: [
8486
{
8587
key: 'add-token',

src/components/v5/common/CompletedAction/partials/EditModeModal/consts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const getEditDecisionMethodDescriptions = (userRole: string) => ({
1212
permission: userRole,
1313
},
1414
),
15-
[DecisionMethod.Reputation]: formatText({
16-
id: 'fundingModal.reputationDescription',
17-
}),
15+
// [DecisionMethod.Reputation]: formatText({
16+
// id: 'fundingModal.reputationDescription',
17+
// }),
1818
});
1919

2020
export const validationSchema = object()
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Action } from '~constants/actions.ts';
2-
import useEnabledExtensions from '~hooks/useEnabledExtensions.ts';
2+
// import useEnabledExtensions from '~hooks/useEnabledExtensions.ts';
33
import { DecisionMethod } from '~types/actions.ts';
44
import { formatText } from '~utils/intl.ts';
55

@@ -10,23 +10,23 @@ export const useEditDecisionMethods = (): DecisionMethodOption[] => {
1010
const userHasPermissions = useCheckIfUserHasPermissions(
1111
Action.PaymentBuilder,
1212
);
13-
const { isVotingReputationEnabled } = useEnabledExtensions();
13+
// const { isVotingReputationEnabled } = useEnabledExtensions();
1414

1515
return [
1616
{
1717
label: formatText({ id: 'decisionMethod.permissions' }),
1818
value: DecisionMethod.Permissions,
1919
isDisabled: !userHasPermissions,
2020
},
21-
...(isVotingReputationEnabled
22-
? [
23-
{
24-
label: formatText({
25-
id: 'decisionMethod.reputation',
26-
}),
27-
value: DecisionMethod.Reputation,
28-
},
29-
]
30-
: []),
21+
// ...(isVotingReputationEnabled
22+
// ? [
23+
// {
24+
// label: formatText({
25+
// id: 'decisionMethod.reputation',
26+
// }),
27+
// value: DecisionMethod.Reputation,
28+
// },
29+
// ]
30+
// : []),
3131
];
3232
};

src/components/v5/common/CompletedAction/partials/PaymentBuilder/partials/PaymentBuilderTable/PaymentBuilderTable.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ const PaymentBuilderTable: FC<PaymentBuilderTableProps> = ({
310310
oldValues: oldSlot,
311311
};
312312
})
313-
.sort((a, b) => a.id - b.id)
314-
.filter((item) => BigNumber.from(item.amount).gt(0));
313+
.sort((a, b) => a.id - b.id);
315314

316315
const unchangedData = data
317316
.filter((item) => !changedSlots.map((slot) => slot.id).includes(item.id))
@@ -324,8 +323,10 @@ const PaymentBuilderTable: FC<PaymentBuilderTableProps> = ({
324323
BigNumber.from(item.amount).gt(0),
325324
);
326325

326+
const dataToShow = isEditStepActive ? dataWithChanges : filteredData;
327+
327328
const columns = useGetPaymentBuilderColumns({
328-
data: filteredData,
329+
data: dataWithChanges,
329330
status,
330331
slots: items,
331332
finalizedTimestamp,
@@ -447,7 +448,7 @@ const PaymentBuilderTable: FC<PaymentBuilderTableProps> = ({
447448
)}
448449
renderSubComponent={renderSubComponent}
449450
data={
450-
!filteredData.length
451+
!data.length
451452
? [
452453
{
453454
recipient: '0x000',
@@ -477,7 +478,7 @@ const PaymentBuilderTable: FC<PaymentBuilderTableProps> = ({
477478
isLoading: true,
478479
},
479480
]
480-
: filteredData
481+
: dataToShow
481482
}
482483
columns={columns}
483484
renderCellWrapper={(_, content) => content}

src/components/v5/common/CompletedAction/partials/PaymentBuilder/partials/PaymentBuilderTable/partials/EditContent/EditContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const renderElement = (
8282

8383
if (key === 'claimDelay') {
8484
if (!value.old && !isNew) {
85-
return <p className="text3">-</p>;
85+
return <p className="text-3">-</p>;
8686
}
8787

8888
const delay = convertPeriodToHours(isNew ? value.new : value.old);
@@ -96,7 +96,7 @@ const renderElement = (
9696
>
9797
{delay}
9898
</p>
99-
<p className="text-md">{formatText(MSG.hours, { hours: delay })}</p>
99+
<p className="text-3">{formatText(MSG.hours, { hours: delay })}</p>
100100
</div>
101101
);
102102
}

src/components/v5/common/CompletedAction/partials/PaymentBuilder/partials/PaymentBuilderTable/partials/EditContent/partials/TokenField/TokenField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const TokenField: FC<TokenFieldProps> = ({ amount, tokenAddress, isNew }) => {
1919
const { colony } = useColonyContext();
2020
const tokenData = getSelectedToken(colony, tokenAddress);
2121

22-
return amount ? (
22+
return amount && amount !== '0' ? (
2323
<div className="flex items-center gap-1 text-3">
2424
<span
2525
className={clsx({

src/components/v5/common/CompletedAction/partials/PaymentBuilderEdit/PaymentBuilderEdit.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ const PaymentBuilderEdit: FC<PaymentBuilderEditProps> = ({ action }) => {
134134
slotId: slot.id,
135135
};
136136
})
137-
.sort((a, b) => a.slotId - b.slotId);
137+
.sort((a, b) => a.slotId - b.slotId)
138+
.filter((item) => item.amount !== '0');
138139

139140
return (
140141
<>

src/components/v5/common/Table/Table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ const Table = <T,>({
236236
buttonClassName="ml-auto"
237237
contentWrapperClassName={clsx(
238238
meatBallMenuProps?.contentWrapperClassName,
239-
'!left-6 right-6 !z-[65] sm:!left-auto',
239+
'!left-6 right-6 !z-[65] sm:!left-auto sm:!right-0',
240240
)}
241241
/>
242242
</td>

0 commit comments

Comments
 (0)