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

EcrituresNumeriques / stylo / 15066626824

16 May 2025 10:41AM UTC coverage: 37.574% (-0.02%) from 37.594%
15066626824

Pull #1517

github

web-flow
Merge e05a1c169 into 607ffe7f9
Pull Request #1517: Mise à jour vers react-router@7

549 of 776 branches covered (70.75%)

Branch coverage included in aggregate %.

13 of 373 new or added lines in 28 files covered. (3.49%)

5 existing lines in 4 files now uncovered.

5319 of 14841 relevant lines covered (35.84%)

2.56 hits per line

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

0.0
/front/src/components/collaborative/CollaborativeEditorArticleHeader.jsx
NEW
1
import React, { useCallback } from 'react'
×
NEW
2
import { NavLink, useMatch } from 'react-router'
×
UNCOV
3
import { useTranslation } from 'react-i18next'
×
NEW
4
import clsx from 'clsx'
×
5

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

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

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

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

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

32
  const { data, isLoading } = useFetchData(
×
33
    { query: getArticleInfo, variables: { articleId } },
×
34
    {
×
35
      revalidateIfStale: false,
×
36
      revalidateOnFocus: false,
×
37
      revalidateOnReconnect: false,
×
38
      fallbackData: {
×
39
        article: {},
×
40
      },
×
41
    }
×
42
  )
×
43

NEW
44
  const activeClassName = useCallback(
×
NEW
45
    ({ isActive }) =>
×
NEW
46
      clsx(buttonStyles.linkSecondary, isActive && buttonStyles.activeLink),
×
NEW
47
    []
×
NEW
48
  )
×
49

50
  if (isLoading) {
×
51
    return <Loading />
×
52
  }
×
53

54
  return (
×
55
    <header className={styles.header}>
×
56
      <h1 className={styles.title}>{data.article.title}</h1>
×
57

58
      <div className={styles.row}>
×
59
        <CollaborativeEditorActiveVersion versionId={versionId} />
×
60

NEW
61
        <ul
×
NEW
62
          className={buttonStyles.inlineGroup}
×
NEW
63
          aria-label={t('article.editor.modes.menuLabel')}
×
64
        >
65
          <li>
×
NEW
66
            <NavLink className={activeClassName} to={match.pathnameBase} end>
×
67
              {t('article.editor.modes.edit')}
×
68
            </NavLink>
×
69
          </li>
×
70
          <li>
×
71
            <NavLink
×
NEW
72
              className={activeClassName}
×
NEW
73
              to={`${match.pathnameBase}/preview`}
×
NEW
74
              end
×
75
            >
76
              {t('article.editor.modes.preview')}
×
77
            </NavLink>
×
78
          </li>
×
79
        </ul>
×
80

81
        <div className={styles.writers}>
×
82
          <CollaborativeEditorWriters />
×
83
        </div>
×
84
      </div>
×
85
    </header>
×
86
  )
87
}
×
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

© 2025 Coveralls, Inc