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

EcrituresNumeriques / stylo / 14055217767

25 Mar 2025 08:43AM UTC coverage: 31.575% (-0.08%) from 31.659%
14055217767

Pull #1364

github

web-flow
Merge d589a87ce into 273c36e1a
Pull Request #1364: chore: ajout d'une menu sur l'interface d'écriture collaborative

464 of 688 branches covered (67.44%)

Branch coverage included in aggregate %.

0 of 171 new or added lines in 6 files covered. (0.0%)

27 existing lines in 2 files now uncovered.

4396 of 14704 relevant lines covered (29.9%)

2.25 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 { Link as GeistLink, Popover } from '@geist-ui/core'
×
2
import clsx from 'clsx'
×
UNCOV
3
import React, { useCallback } from 'react'
×
UNCOV
4
import { AlignLeft, Eye, Printer } from 'react-feather'
×
5
import { useDispatch, useSelector } from 'react-redux'
×
6
import { Link } from 'react-router-dom'
×
7

8
import useFetchData from '../../hooks/graphql.js'
×
UNCOV
9
import { useModal } from '../../hooks/modal.js'
×
10

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

13
import Button from '../Button.jsx'
×
14

15
import buttonStyles from '../button.module.scss'
×
16
import Export from '../Export.jsx'
×
UNCOV
17
import Modal from '../Modal.jsx'
×
UNCOV
18
import Loading from '../molecules/Loading.jsx'
×
UNCOV
19
import styles from './CollaborativeEditorArticleHeader.module.scss'
×
20

21
/**
22
 * @param props
23
 * @param {string} props.articleId
24
 * @return {Element}
25
 */
26
export default function CollaborativeEditorArticleHeader({ articleId }) {
×
27
  const dispatch = useDispatch()
×
28
  const articleStructure = useSelector((state) => state.articleStructure)
×
29
  const { data, isLoading } = useFetchData(
×
30
    { query: getArticleInfo, variables: { articleId } },
×
31
    {
×
32
      revalidateIfStale: false,
×
UNCOV
33
      revalidateOnFocus: false,
×
34
      revalidateOnReconnect: false,
×
35
    }
×
36
  )
×
UNCOV
37
  const exportModal = useModal()
×
38

39
  const handleTableOfContentsEntryClicked = useCallback(({ target }) => {
×
40
    dispatch({
×
41
      type: 'UPDATE_EDITOR_CURSOR_POSITION',
×
42
      lineNumber: parseInt(target.dataset.index, 10),
×
43
      column: 0,
×
44
    })
×
45
  }, [])
×
46

47
  if (isLoading) {
×
48
    return <Loading />
×
49
  }
×
50

51
  return (
×
52
    <header className={styles.header}>
×
NEW
53
      <h1 className={styles.title}>{data?.article?.title}</h1>
×
54

UNCOV
55
      <div>
×
56
        <Button
×
57
          icon
×
58
          title="Download a printable version"
×
UNCOV
59
          onClick={() => exportModal.show()}
×
60
        >
61
          <Printer />
×
62
        </Button>
×
63
        <Link
×
64
          to={`/article/${articleId}/preview`}
×
65
          title="Preview (open a new window)"
×
UNCOV
66
          target="_blank"
×
UNCOV
67
          rel="noopener noreferrer"
×
68
          className={buttonStyles.icon}
×
69
        >
70
          <Eye />
×
71
        </Link>
×
72
      </div>
×
73

74
      <Modal
×
75
        {...exportModal.bindings}
×
UNCOV
76
        title={
×
77
          <>
×
UNCOV
78
            <Printer /> Export
×
UNCOV
79
          </>
×
80
        }
81
      >
UNCOV
82
        <Export
×
UNCOV
83
          articleId={articleId}
×
UNCOV
84
          name={data?.article?.title}
×
UNCOV
85
          bib={data?.article?.workingVersion?.bibPreview}
×
UNCOV
86
          onCancel={() => exportModal.close()}
×
UNCOV
87
        />
×
UNCOV
88
      </Modal>
×
UNCOV
89
    </header>
×
90
  )
UNCOV
91
}
×
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