How to use the cozy-ui/transpiled/react/Alerter.error function in cozy-ui

To help you get started, we’ve selected a few cozy-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-banks / src / ducks / settings / NewAccountSettings.jsx View on Github external
onError: err => {
        // eslint-disable-next-line no-console
        console.error(err)
        Alerter.error(t('AccountSettings.failure'))
      }
    })
github cozy / cozy.github.io / en / cozy-banks / src / ducks / settings / makeRuleComponent.jsx View on Github external
const onError = err => {
      // eslint-disable-next-line no-console
      console.warn('Could not save rule')
      // eslint-disable-next-line no-console
      console.error(err)
      Alerter.error(t('Settings.rules.saving-error'))
    }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / pin / PinEditView.jsx View on Github external
async handleChooseFingerprint(fingerprintChoice) {
    const t = this.props.t
    try {
      await this.savePin(this.state.chosenPin, fingerprintChoice)
    } catch (e) {
      Alerter.error(t('Pin.error-save'))
      throw e
    } finally {
      this.setState({ saving: false })
    }
    Alerter.success(t('Pin.successfully-changed'))
    this.props.onSaved()
  }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / settings / GroupSettings.jsx View on Github external
onRemove = async () => {
    const { group, router, client, t } = this.props

    try {
      await client.destroy(group)
      router.push('/settings/groups')
    } catch (err) {
      logException(err)
      Alerter.error(t('Groups.deletion_error'))
    }
  }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / recurrence / RecurrencePage.jsx View on Github external
const handleRename = async () => {
    try {
      await renameRecurrenceManually(
        client,
        bundle,
        renameInputRef.current.value
      )
      dismissAction()
      Alerter.success(t('Recurrence.rename.save-success'))
    } catch (e) {
      Alerter.error(t('Recurrence.rename.save-error'))
    }
  }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / settings / Debug.jsx View on Github external
data: {
          type: 'io.cozy.notifications',
          attributes: {
            category: 'transaction-greater',
            title: 'Test notification',
            message: 'This is a test notification message',
            preferred_channels: ['mobile', 'mail'],
            content: 'This is a test notification text content',
            content_html: 'This is a test notification HTML content'
          }
        }
      })

      Alerter.success('Notification sent')
    } catch (err) {
      Alerter.error('Failed to send notification: ' + err)
    }
  }
github cozy / cozy.github.io / en / cozy-banks / src / components / UserActionRequired / index.jsx View on Github external
acceptUpdatedTos = async () => {
    const cozyClient = this.props.client
    try {
      await cozyClient.stackClient.fetchJSON(
        'PUT',
        '/settings/instance/sign_tos'
      )
      this.setState({
        warnings: this.state.warnings.filter(w => w.code !== 'tos-updated')
      })
    } catch (e) {
      Alerter.error('TOS.updated.error')
    }
  }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / recurrence / DebugRecurrencePage.jsx View on Github external
async function() {
      setSavingBundles(true)
      try {
        await saveHydratedBundles(client, finalBundles)
      } catch (error) {
        Alerter.error(error.message)
      } finally {
        setSavingBundles(false)
      }
    },
    [finalBundles, client]
github cozy / cozy.github.io / en / cozy-banks / src / ducks / transactions / actions / ReimbursementStatusAction / ReimbursementStatusAction.jsx View on Github external
handleChange = async e => {
    const { transaction, client, t } = this.props
    transaction.reimbursementStatus = e.target.value

    this.hideModal()

    try {
      await client.save(transaction)
    } catch (err) {
      logException(err)
      Alerter.error(t('Transactions.reimbursementStatusUpdateError'))
    }
  }