How to use the cozy-ui/transpiled/react/Alerter.success 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 / Debug.jsx View on Github external
try {
      await client.stackClient.fetchJSON('POST', '/notifications', {
        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 / 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
const startAndWaitService = async (client, serviceName) => {
  const jobs = client.collection('io.cozy.jobs')
  const { data: job } = await jobs.create('service', {
    name: serviceName,
    slug: 'banks'
  })
  const finalJob = await jobs.waitFor(job.id)
  if (finalJob.state === 'errored') {
    Alerter.error(`Job finished with error. Error is ${finalJob.error}`)
  } else if (finalJob.state === 'done') {
    Alerter.success(`Job finished successfully`)
  } else {
    Alerter.error(`Job finished with state ${finalJob.state}`)
  }
  return finalJob
}
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 / NewAccountSettings.jsx View on Github external
onSuccess: () => {
        router.push('/settings/accounts')
        Alerter.success(t('AccountSettings.success'))
      },
      onError: err => {