• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EcrituresNumeriques / stylo / 13906025440

17 Mar 2025 05:32PM UTC coverage: 31.197% (+0.5%) from 30.662%
13906025440

push

github

web-flow
chore: supprime useMutation et clarifie les fonctions (#1304)

* chore: supprime useMutation et clarifie les fonctions

- Renomme useGraphQL en useFetchData
- Introduit une fonction useMutateData pour mettre à jour les données pour un scope (query + variables)

* fix: articleId destructuring

* chore: ajout de tests sur le hook article

* fix: mise à jour des tags associés à l'article sur la liste des articles

* chore: adapt TagEditForm tests

462 of 677 branches covered (68.24%)

Branch coverage included in aggregate %.

165 of 341 new or added lines in 29 files covered. (48.39%)

9 existing lines in 8 files now uncovered.

4367 of 14802 relevant lines covered (29.5%)

2.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/front/src/components/ArticleSendCopy.jsx
1
import React, { useCallback } from 'react'
×
2

3
import { useToasts } from '@geist-ui/core'
×
4
import { Send } from 'react-feather'
×
5
import { useTranslation } from 'react-i18next'
×
6

7
import styles from './articleSendCopy.module.scss'
×
UNCOV
8
import ContactSearch from './ContactSearch.jsx'
×
NEW
9
import { useArticleActions } from '../hooks/article.js'
×
10

11
export default function ArticleSendCopy({ article }) {
×
12
  const { setToast } = useToasts()
×
NEW
13
  const { copy } = useArticleActions({ articleId: article._id })
×
14
  const { t } = useTranslation()
×
15

16
  const handleUserUpdated = useCallback(
×
17
    async ({ user, action }) => {
×
18
      if (action === 'select' || action === 'unselect') {
×
19
        try {
×
NEW
20
          await copy(user._id)
×
21
          setToast({
×
22
            text: t('article.sendCopy.successNotification', {
×
23
              username: user.displayName || user.username,
×
24
            }),
×
25
            type: 'success',
×
26
          })
×
27
        } catch (err) {
×
28
          setToast({
×
29
            type: 'error',
×
30
            text: t('article.sendCopy.errorNotification', {
×
31
              errMessage: err.message,
×
32
            }),
×
33
          })
×
34
        }
×
35
      }
×
36
    },
×
37
    [article._id]
×
38
  )
×
39

40
  return (
×
41
    <section className={styles.acquintances}>
×
42
      <ContactSearch
×
43
        selectedIcon={<Send />}
×
44
        unselectedIcon={<Send />}
×
45
        onUserUpdated={handleUserUpdated}
×
46
        members={[]}
×
47
      />
×
48
    </section>
×
49
  )
50
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc