Skip to content

Commit

Permalink
fix(harvest): Routes for /config with LaunchTriggerAlert was incorrect
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `konnectorRoot` must be the route to the connector, not the account in it. You have to change something like `konnectorRoot="/harvest/connectorName/accounts/accountId"` in something like `konnectorRoot="/harvest/connectorName"`
  • Loading branch information
JF-Cozy committed Feb 2, 2023
1 parent b3a7ca9 commit c67f5a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -78,7 +78,7 @@ const RoutesV4 = ({
>
<AccountModalContentWrapper>
<DataTab
konnectorRoot={`${konnectorRoot}/accounts/${match.params.accountId}`}
konnectorRoot={konnectorRoot}
konnector={konnectorWithTriggers}
showNewAccountButton={!konnectorWithTriggers.clientSide}
onDismiss={onDismiss}
Expand Down
Expand Up @@ -10,6 +10,7 @@ import SyncIcon from 'cozy-ui/transpiled/react/Icons/Sync'
import GearIcon from 'cozy-ui/transpiled/react/Icons/Gear'

import { useFlowState } from '../../models/withConnectionFlow'
import { getAccountId } from '../../helpers/triggers'
import { isDisconnected } from '../../helpers/konnectors'
import withAdaptiveRouter from '../hoc/withRouter'
import useMaintenanceStatus from '../hooks/useMaintenanceStatus'
Expand Down Expand Up @@ -51,7 +52,16 @@ const LaunchTriggerAlertMenu = ({ flow, t, konnectorRoot, historyAction }) => {
{!isKonnectorDisconnected && (
<ActionMenuItem
left={<Icon icon={GearIcon} />}
onClick={() => historyAction(`${konnectorRoot}/config`, 'push')}
onClick={() =>
historyAction(
konnectorRoot
? `${konnectorRoot}/accounts/${getAccountId(
trigger
)}/config`
: '/config',
'push'
)
}
>
{t('card.launchTrigger.configure')}
</ActionMenuItem>
Expand Down

0 comments on commit c67f5a6

Please sign in to comment.