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

EcrituresNumeriques / stylo / 15922807606

27 Jun 2025 09:18AM UTC coverage: 39.241% (+0.04%) from 39.201%
15922807606

push

github

web-flow
Crée des requêtes de prévisualisation d'articles/corpus (#1592)

Co-authored-by: Thomas Parisot <thom4parisot@users.noreply.github.com>
Co-authored-by: Guillaume Grossetie <ggrossetie@yuzutech.fr>

570 of 800 branches covered (71.25%)

Branch coverage included in aggregate %.

90 of 250 new or added lines in 17 files covered. (36.0%)

137 existing lines in 8 files now uncovered.

5638 of 15020 relevant lines covered (37.54%)

2.66 hits per line

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

0.0
/front/src/components/collaborative/CollaborativeEditor.jsx
1
import React from 'react'
×
NEW
2
import { useParams, useSearchParams } from 'react-router'
×
3

4
import createReduxStore from '../../createReduxStore.js'
×
5
import { executeQuery } from '../../helpers/graphQL.js'
×
6

7
import ArticleStats from '../ArticleStats.jsx'
×
8
import CollaborativeEditorArticleHeader from './CollaborativeEditorArticleHeader.jsx'
×
9
import CollaborativeEditorMenu from './CollaborativeEditorMenu.jsx'
×
10
import CollaborativeTextEditor from './CollaborativeTextEditor.jsx'
×
11

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

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

16
const articleIdRx = /^[a-f\d]{24}$/i
×
17

18
export async function loader({ params }) {
×
19
  const { id: articleId } = params
×
20

21
  if (articleId && articleIdRx.test(articleId) === false) {
×
22
    throw new Response(`Invalid article id ${articleId}`, { status: 400 })
×
23
  }
×
24

NEW
25
  const sessionToken = localStorage.getItem('sessionToken')
×
26
  try {
×
27
    const { article } = await executeQuery({
×
28
      query: getArticleInfo,
×
29
      variables: { articleId },
×
30
      sessionToken,
×
31
    })
×
32
    return { article }
×
33
  } catch (err) {
×
34
    const errorMessage = err.messages?.[0]?.message ?? err.message
×
35
    const errorType = err.messages?.[0]?.extensions?.type
×
36

37
    if (errorType === 'NOT_FOUND') {
×
38
      throw new Response(errorMessage, { status: 404 })
×
39
    }
×
40

41
    throw err
×
42
  }
×
43
}
×
44

NEW
45
export default function CollaborativeEditor(props) {
×
46
  const { id: articleId, compareTo, version: versionId } = useParams()
×
NEW
47
  const [searchParams] = useSearchParams({ mode: props.mode ?? 'write' })
×
NEW
48
  const mode = searchParams.get('mode')
×
49

50
  return (
×
51
    <section className={styles.container}>
×
52
      <div className={styles.editorArea}>
×
53
        <CollaborativeEditorArticleHeader
×
54
          articleId={articleId}
×
55
          versionId={versionId}
×
56
        />
×
57
        <CollaborativeTextEditor
×
58
          mode={mode}
×
59
          articleId={articleId}
×
60
          versionId={versionId}
×
61
        />
×
62
        <ArticleStats />
×
63
      </div>
×
64

65
      <CollaborativeEditorMenu
×
66
        className={styles.sidebarArea}
×
67
        articleId={articleId}
×
68
        versionId={versionId}
×
69
        compareTo={compareTo}
×
70
      />
×
71
    </section>
×
72
  )
73
}
×
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