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

EcrituresNumeriques / stylo / 13987938500

21 Mar 2025 08:48AM UTC coverage: 31.659% (+0.6%) from 31.087%
13987938500

push

github

web-flow
chore: remplace les modales Geist (#1358)

Remplace aussi <Loading> par notre composant.

464 of 686 branches covered (67.64%)

Branch coverage included in aggregate %.

42 of 569 new or added lines in 36 files covered. (7.38%)

27 existing lines in 18 files now uncovered.

4396 of 14665 relevant lines covered (29.98%)

2.26 hits per line

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

0.0
/front/src/components/collaborative/CollaborativeEditorStatus.jsx
NEW
1
import { useToasts } from '@geist-ui/core'
×
UNCOV
2
import React, { useCallback } from 'react'
×
3
import { StopCircle } from 'react-feather'
×
4
import { useTranslation } from 'react-i18next'
×
5
import { useHistory } from 'react-router-dom'
×
NEW
6
import { useGraphQLClient } from '../../helpers/graphQL.js'
×
NEW
7
import { useModal } from '../../hooks/modal.js'
×
NEW
8
import Button from '../Button.jsx'
×
NEW
9
import Modal from '../Modal.jsx'
×
NEW
10
import FormActions from '../molecules/FormActions.jsx'
×
11

NEW
12
import styles from './CollaborativeEditorStatus.module.scss'
×
13
import CollaborativeEditorWebSocketStatus from './CollaborativeEditorWebSocketStatus.jsx'
×
14
import CollaborativeEditorWriters from './CollaborativeEditorWriters.jsx'
×
15

16
import { stopCollaborativeSession } from './CollaborativeSession.graphql'
×
17

18
/**
19
 * @param props
20
 * @param {string} props.articleId
21
 * @param {string} props.websocketStatus
22
 * @param {string} props.collaborativeSessionState
23
 * @return {Element}
24
 */
25
export default function CollaborativeEditorStatus({
×
26
  articleId,
×
27
  websocketStatus,
×
28
  collaborativeSessionState,
×
29
}) {
×
30
  const { t } = useTranslation()
×
31
  const { query } = useGraphQLClient()
×
32
  const { setToast } = useToasts()
×
33
  const history = useHistory()
×
34

NEW
35
  const collaborativeSessionEndModal = useModal()
×
36

37
  const handleEndCollaborativeSession = useCallback(async () => {
×
38
    try {
×
39
      await query({
×
40
        query: stopCollaborativeSession,
×
41
        variables: { articleId },
×
42
      })
×
43
      setToast({
×
44
        type: 'default',
×
45
        text: 'Collaborative session ended',
×
46
      })
×
47
      history.push('/articles')
×
48
    } catch (err) {
×
49
      setToast({
×
50
        type: 'error',
×
51
        text: 'Unable to stop the collaborative session: ' + err.toString(),
×
52
      })
×
53
    }
×
54
  }, [])
×
55

56
  return (
×
57
    <>
×
58
      <div className={styles.row}>
×
59
        <div className={styles.writers}>
×
60
          <CollaborativeEditorWriters />
×
61
        </div>
×
62
        <div className={styles.status}>
×
63
          <CollaborativeEditorWebSocketStatus
×
64
            status={websocketStatus}
×
65
            state={collaborativeSessionState}
×
66
          />
×
67
        </div>
×
68
        {websocketStatus === 'connected' &&
×
69
          collaborativeSessionState === 'started' && (
×
NEW
70
            <Button primary onClick={() => collaborativeSessionEndModal.show()}>
×
NEW
71
              <StopCircle /> {t('article.collaborativeSessionEnd.title')}
×
UNCOV
72
            </Button>
×
73
          )}
74
      </div>
×
NEW
75
      <Modal
×
NEW
76
        {...collaborativeSessionEndModal.bindings}
×
NEW
77
        title={
×
NEW
78
          <>
×
NEW
79
            <StopCircle />
×
NEW
80
            {t('article.collaborativeSessionEnd.title')}
×
NEW
81
          </>
×
82
        }
83
      >
NEW
84
        {t('article.collaborativeSessionEnd.confirmMessage')}
×
NEW
85
        <FormActions
×
NEW
86
          onCancel={() => collaborativeSessionEndModal.close()}
×
NEW
87
          onSubmit={handleEndCollaborativeSession}
×
NEW
88
        />
×
NEW
89
      </Modal>
×
UNCOV
90
    </>
×
91
  )
92
}
×
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