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

EcrituresNumeriques / stylo / 14865094533

06 May 2025 04:42PM UTC coverage: 37.581% (-0.1%) from 37.729%
14865094533

push

github

web-flow
Prévisualisation en ligne (#1469)

Co-authored-by: Thomas Parisot <thom4parisot@users.noreply.github.com>

532 of 759 branches covered (70.09%)

Branch coverage included in aggregate %.

0 of 124 new or added lines in 14 files covered. (0.0%)

1 existing line in 1 file now uncovered.

5239 of 14597 relevant lines covered (35.89%)

2.51 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 from 'react'
×
NEW
2
import { NavLink, useRouteMatch } from 'react-router-dom'
×
NEW
3
import { useTranslation } from 'react-i18next'
×
4

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

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

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

13
import styles from './CollaborativeEditorArticleHeader.module.scss'
×
NEW
14
import buttonStyles from '../button.module.scss'
×
15

16
/**
17
 * @param props
18
 * @param {string} props.articleId
19
 * @param {string?} props.versionId
20
 * @returns {import('react').ReactElementElement}
21
 */
NEW
22
export default function CollaborativeEditorArticleHeader({
×
NEW
23
  articleId,
×
NEW
24
  versionId,
×
NEW
25
}) {
×
NEW
26
  const { t } = useTranslation()
×
NEW
27
  const match = useRouteMatch(
×
NEW
28
    versionId
×
NEW
29
      ? `/article/${articleId}/version/${versionId}`
×
NEW
30
      : `/article/${articleId}`
×
NEW
31
  )
×
32

33
  const { data, isLoading } = useFetchData(
×
34
    { query: getArticleInfo, variables: { articleId } },
×
35
    {
×
36
      revalidateIfStale: false,
×
37
      revalidateOnFocus: false,
×
38
      revalidateOnReconnect: false,
×
NEW
39
      fallbackData: {
×
NEW
40
        article: {},
×
NEW
41
      },
×
42
    }
×
43
  )
×
44
  if (isLoading) {
×
45
    return <Loading />
×
46
  }
×
47

48
  return (
×
49
    <header className={styles.header}>
×
NEW
50
      <h1 className={styles.title}>{data.article.title}</h1>
×
51

NEW
52
      <div className={styles.row}>
×
NEW
53
        <CollaborativeEditorActiveVersion versionId={versionId} />
×
54

NEW
55
        <ul className={buttonStyles.inlineGroup} aria-label={t('article.editor.modes.menuLabel')}>
×
NEW
56
          <li>
×
NEW
57
            <NavLink
×
NEW
58
              activeClassName={buttonStyles.activeLink}
×
NEW
59
              exact className={buttonStyles.linkSecondary} to={match.path}>
×
NEW
60
              {t('article.editor.modes.edit')}
×
NEW
61
            </NavLink>
×
NEW
62
          </li>
×
NEW
63
          <li>
×
NEW
64
            <NavLink
×
NEW
65
              exact
×
NEW
66
              activeClassName={buttonStyles.activeLink}
×
NEW
67
              className={buttonStyles.linkSecondary}
×
NEW
68
              to={`${match.path}/preview`}
×
69
            >
NEW
70
              {t('article.editor.modes.preview')}
×
NEW
71
            </NavLink>
×
NEW
72
          </li>
×
NEW
73
        </ul>
×
74

NEW
75
        <div className={styles.writers}>
×
NEW
76
          <CollaborativeEditorWriters />
×
NEW
77
        </div>
×
NEW
78
      </div>
×
UNCOV
79
    </header>
×
80
  )
81
}
×
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