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

feat: Allow deletion of delegate transactions from the queue [SW-297] #4400

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 8 additions & 4 deletions src/components/transactions/TxDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ const TxDetailsBlock = ({ txSummary, txDetails }: TxDetailsProps): ReactElement
const isUnsigned =
isMultisigExecutionInfo(txSummary.executionInfo) && txSummary.executionInfo.confirmationsSubmitted === 0

const isUntrusted =
const isTxFromProposer =
isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo) &&
txDetails.detailedExecutionInfo.trusted === false
txDetails.detailedExecutionInfo.trusted &&
isUnsigned

const isUntrusted =
isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo) && !txDetails.detailedExecutionInfo.trusted

// If we have no token list we always trust the transfer
const isTrustedTransfer = !hasDefaultTokenlist || isTrustedTx(txSummary)
Expand Down Expand Up @@ -117,9 +121,9 @@ const TxDetailsBlock = ({ txSummary, txDetails }: TxDetailsProps): ReactElement
</div>

{/* Signers */}
{!isUnsigned && (
{(!isUnsigned || isTxFromProposer) && (
<div className={css.txSigners}>
<TxSigners txDetails={txDetails} txSummary={txSummary} />
<TxSigners txDetails={txDetails} txSummary={txSummary} isTxFromProposer={isTxFromProposer} />

{isQueue && (
<Box className={css.buttons}>
Expand Down
21 changes: 16 additions & 5 deletions src/components/transactions/TxSigners/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ const shouldHideConfirmations = (detailedExecutionInfo?: DetailedExecutionInfo):
type TxSignersProps = {
txDetails: TransactionDetails
txSummary: TransactionSummary
isTxFromProposer: boolean
}

export const TxSigners = ({ txDetails, txSummary }: TxSignersProps): ReactElement | null => {
export const TxSigners = ({ txDetails, txSummary, isTxFromProposer }: TxSignersProps): ReactElement | null => {
const { detailedExecutionInfo, txInfo, txId } = txDetails
const [hideConfirmations, setHideConfirmations] = useState<boolean>(shouldHideConfirmations(detailedExecutionInfo))
const isPending = useIsPending(txId)
Expand Down Expand Up @@ -186,13 +187,23 @@ export const TxSigners = ({ txDetails, txSummary }: TxSignersProps): ReactElemen
</ListItemText>
</ListItem>
)}
<ListItem>
<ListItem sx={{ alignItems: 'flex-start' }}>
<StyledListItemIcon $state={executor ? StepState.CONFIRMED : StepState.DISABLED}>
{executor ? <Check /> : <MissingConfirmation />}
</StyledListItemIcon>
<ListItemText data-testid="tx-action-status" primaryTypographyProps={{ fontWeight: 700 }}>
{executor ? 'Executed' : isPending ? txStatus : 'Can be executed'}
</ListItemText>
<ListItemText
primary={
executor ? 'Executed' : isPending ? txStatus : isTxFromProposer ? 'Signer review' : 'Can be executed'
}
secondary={
isTxFromProposer
? 'This transaction was created by a Proposer. Please review and either confirm or reject it. Once confirmed, it can be finalized and executed.'
: undefined
}
data-testid="tx-action-status"
primaryTypographyProps={{ fontWeight: 700 }}
secondaryTypographyProps={{ mt: 1 }}
/>
</ListItem>
</List>
{executor ? (
Expand Down
Loading