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

EcrituresNumeriques / stylo / 16439650524

22 Jul 2025 08:59AM UTC coverage: 39.184% (+0.04%) from 39.148%
16439650524

Pull #1668

github

web-flow
Merge 6608c5286 into b7926cb4b
Pull Request #1668: Utilise le titre de l'article dans le composant entĂȘte

571 of 807 branches covered (70.76%)

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.

5704 of 15207 relevant lines covered (37.51%)

2.57 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 { Toggle } from '@geist-ui/core'
×
6

7
import useFetchData from '../../hooks/graphql.js'
×
8

9
import Loading from '../molecules/Loading.jsx'
×
10
import CollaborativeEditorActiveVersion from './CollaborativeEditorActiveVersion.jsx'
×
11
import CollaborativeEditorWriters from './CollaborativeEditorWriters.jsx'
×
12

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

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

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

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

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

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

44
      <div className={styles.row}>
×
45
        <div
×
46
          className={styles.mode}
×
47
          onClick={() => setMode(mode === 'preview' ? 'edit' : 'preview')}
×
48
        >
49
          <Toggle
×
50
            id="preview-mode"
×
51
            checked={mode === 'preview'}
×
52
            title={t('article.editor.preview')}
×
53
            onChange={(e) => setMode(e.target.checked ? 'preview' : 'edit')}
×
54
          />
×
55
          <label htmlFor="preview-mode">{t('article.editor.preview')}</label>
×
56
        </div>
×
57

58
        <div className={styles.writers}>
×
59
          <CollaborativeEditorWriters />
×
60
        </div>
×
61
      </div>
×
62
      <CollaborativeEditorActiveVersion versionId={versionId} />
×
63
    </header>
×
64
  )
65
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc