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

EcrituresNumeriques / stylo / 14067433582

25 Mar 2025 06:31PM UTC coverage: 31.801%. First build
14067433582

push

github

web-flow
chore: ajout d'une menu sur l'interface d'écriture collaborative (#1364)

* chore: ajout d'une menu sur l'interface d'écriture collaborative

* chore: affiche les métadonnées en lecture seule

470 of 703 branches covered (66.86%)

Branch coverage included in aggregate %.

3 of 281 new or added lines in 9 files covered. (1.07%)

4483 of 14872 relevant lines covered (30.14%)

2.26 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, { useCallback } from 'react'
×
2
import { useParams } from 'react-router-dom'
×
3
import useFetchData from '../../hooks/graphql.js'
×
4
import ArticleStats from '../ArticleStats.jsx'
×
5
import Loading from '../molecules/Loading.jsx'
×
6

7
import { getCollaborativeSession } from './CollaborativeSession.graphql'
×
8

9
import CollaborativeEditorArticleHeader from './CollaborativeEditorArticleHeader.jsx'
×
10
import CollaborativeSessionError from './CollaborativeSessionError.jsx'
×
11
import CollaborativeTextEditor from './CollaborativeTextEditor.jsx'
×
12

13
import styles from './CollaborativeEditor.module.scss'
×
NEW
14
import { Sidebar } from 'react-feather'
×
NEW
15
import Button from '../Button.jsx'
×
NEW
16
import ArticleEditorMetadata from '../Write/ArticleEditorMetadata.jsx'
×
NEW
17
import CollaborativeEditorMenu from './CollaborativeEditorMenu.jsx'
×
18

19
export default function CollaborativeEditor() {
×
20
  const { sessionId: collaborativeSessionId, articleId } = useParams()
×
21

22
  const {
×
23
    data: collaborativeSessionData,
×
24
    isLoading: collaborativeSessionLoading,
×
25
    mutate: mutateCollaborativeSession,
×
26
  } = useFetchData({ query: getCollaborativeSession, variables: { articleId } })
×
27

28
  const handleCollaborativeSessionStateUpdated = useCallback(({ state }) => {
×
29
    if (state === 'ended') {
×
30
      mutateCollaborativeSession()
×
31
    }
×
32
  }, [])
×
33

34
  if (collaborativeSessionLoading) {
×
35
    return <Loading />
×
36
  }
×
37

38
  if (
×
39
    collaborativeSessionData?.article?.collaborativeSession?.id !==
×
40
    collaborativeSessionId
×
41
  ) {
×
42
    return (
×
43
      <div className={styles.errorContainer}>
×
44
        <CollaborativeSessionError error="notFound" />
×
45
      </div>
×
46
    )
47
  }
×
48

49
  const collaborativeSessionCreatorId =
×
50
    collaborativeSessionData?.article?.collaborativeSession?.creator?._id
×
51

52
  return (
×
NEW
53
    <section className={styles.container}>
×
NEW
54
      <div className={styles.main} role="main">
×
NEW
55
        <CollaborativeEditorArticleHeader articleId={articleId} />
×
NEW
56
        <CollaborativeTextEditor
×
NEW
57
          articleId={articleId}
×
NEW
58
          collaborativeSessionCreatorId={collaborativeSessionCreatorId}
×
NEW
59
          collaborativeSessionId={collaborativeSessionId}
×
NEW
60
          onCollaborativeSessionStateUpdated={
×
NEW
61
            handleCollaborativeSessionStateUpdated
×
62
          }
NEW
63
        />
×
NEW
64
        <ArticleStats />
×
NEW
65
      </div>
×
NEW
66
      <CollaborativeEditorMenu articleId={articleId} />
×
NEW
67
    </section>
×
68
  )
69
}
×
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