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

EcrituresNumeriques / stylo / 17724634656

15 Sep 2025 06:54AM UTC coverage: 39.426% (+0.04%) from 39.389%
17724634656

push

github

web-flow
fix: Utilise le titre de l'article dans le composant entĂȘte (#1668)

586 of 824 branches covered (71.12%)

Branch coverage included in aggregate %.

0 of 9 new or added lines in 3 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

5786 of 15338 relevant lines covered (37.72%)

2.61 hits per line

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

0.0
/front/src/components/collaborative/CollaborativeEditorArticleHeader.jsx
1
import React, { useEffect, useState } from 'react'
×
2
import { useTranslation } from 'react-i18next'
×
3
import { useSearchParams } from 'react-router'
×
4

5
import useFetchData from '../../hooks/graphql.js'
×
6

7
import CollaborativeEditorActiveVersion from './CollaborativeEditorActiveVersion.jsx'
×
8
import CollaborativeEditorWriters from './CollaborativeEditorWriters.jsx'
×
9
import Loading from '../molecules/Loading.jsx'
×
10
import Toggle from '../molecules/Toggle.jsx'
×
11

12
import { getArticleInfo } from '../Article.graphql'
×
13

14
import styles from './CollaborativeEditorArticleHeader.module.scss'
×
15

16
/**
17
 * @param props
18
 * @param {string} props.articleTitle
19
 * @param {string?} props.versionId
20
 * @returns {import('react').ReactElementElement}
21
 */
22
export default function CollaborativeEditorArticleHeader({
×
NEW
23
  articleTitle,
×
24
  versionId,
×
25
}) {
×
26
  const { t } = useTranslation()
×
27

28
  const [searchParams, setSearchParams] = useSearchParams()
×
29
  const [mode, setMode] = useState('edit')
×
30

31
  useEffect(() => {
×
32
    if (mode === 'preview' && searchParams.get('mode') !== 'preview') {
×
33
      setSearchParams({ mode: 'preview' })
×
34
    } else if (searchParams.get('mode') === 'preview') {
×
35
      setSearchParams({})
×
36
    }
×
37
  }, [mode])
×
38

39
  return (
×
40
    <header className={styles.header}>
×
NEW
41
      <h1 className={styles.title}>{articleTitle}</h1>
×
42

43
      <div className={styles.row}>
×
44
        <Toggle
×
45
          id="preview-mode"
×
46
          checked={mode === 'preview'}
×
47
          title={t('article.editor.preview')}
×
48
          onChange={(checked) => setMode(checked ? 'preview' : 'edit')}
×
49
        >
50
          {t('article.editor.preview')}
×
51
        </Toggle>
×
52

53
        <div className={styles.writers}>
×
54
          <CollaborativeEditorWriters />
×
55
        </div>
×
56
      </div>
×
57
      <CollaborativeEditorActiveVersion versionId={versionId} />
×
58
    </header>
×
59
  )
60
}
×
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