Merge pull request #901 from SiIky/feat/Zya3XwXx/update_transaction_on_cancel

feat: update transaction details on cancel
This commit is contained in:
Rafael Taranto 2021-11-14 23:43:12 +00:00 committed by GitHub
commit 0d5da716e5
4 changed files with 11 additions and 13 deletions

View file

@ -64,7 +64,7 @@ export const ConfirmDialog = memo(
message,
confirmationMessage = `Write '${toBeConfirmed}' to confirm this action`,
onConfirmed,
onDissmised,
onDismissed,
initialValue = '',
disabled = false,
...props
@ -77,7 +77,7 @@ export const ConfirmDialog = memo(
const innerOnClose = () => {
setValue('')
setError(false)
onDissmised()
onDismissed()
}
const isOnErrorState =

View file

@ -207,7 +207,7 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {
}
})
}}
onDissmised={() => {
onDismissed={() => {
setAction({ command: null })
setErrorMessage(null)
}}

View file

@ -350,7 +350,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
}
})
}}
onDissmised={() => {
onDismissed={() => {
setAction({ command: null })
setErrorMessage(null)
}}
@ -362,5 +362,5 @@ const DetailsRow = ({ it: tx, timezone }) => {
export default memo(
DetailsRow,
(prev, next) =>
prev.it.id === next.it.id && prev.it.hasError === next.it.hasError
prev.it.id === next.it.id && getStatus(prev.it) === getStatus(next.it)
)

View file

@ -122,24 +122,22 @@ const Transactions = () => {
const { data: filtersResponse, loading: loadingFilters } = useQuery(
GET_TRANSACTION_FILTERS
)
const [filteredTransactions, setFilteredTransactions] = useState([])
const [variables, setVariables] = useState({ limit: NUM_LOG_RESULTS })
const {
data: txResponse,
data: txData,
loading: loadingTransactions,
refetch,
startPolling,
stopPolling
} = useQuery(GET_TRANSACTIONS, {
variables,
onCompleted: data => setFilteredTransactions(R.path(['transactions'])(data))
})
} = useQuery(GET_TRANSACTIONS, { variables })
useEffect(() => {
startPolling(10000)
return stopPolling
})
const txList = txData ? txData.transactions : []
const { data: configResponse, configLoading } = useQuery(GET_DATA)
const timezone = R.path(['config', 'locale_timezone'], configResponse)
@ -273,7 +271,7 @@ const Transactions = () => {
onChange={onFilterChange}
/>
</div>
{txResponse && (
{txList && (
<div className={classes.buttonsWrapper}>
<LogsDowloaderPopover
title="Download logs"
@ -310,7 +308,7 @@ const Transactions = () => {
loading={loadingTransactions && configLoading}
emptyText="No transactions so far"
elements={elements}
data={filteredTransactions}
data={txList}
Details={DetailsRow}
expandable
rowSize="sm"