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

EcrituresNumeriques / stylo / 14090633575

26 Mar 2025 06:19PM UTC coverage: 31.811% (+0.01%) from 31.801%
14090633575

push

github

web-flow
chore: remplace feather par lucide (plus d'icĂ´nes) (#1374)

470 of 703 branches covered (66.86%)

Branch coverage included in aggregate %.

4 of 47 new or added lines in 46 files covered. (8.51%)

2 existing lines in 1 file now uncovered.

4483 of 14867 relevant lines covered (30.15%)

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
1
import { useToasts } from '@geist-ui/core'
×
2
import React, { useCallback } from 'react'
×
NEW
3
import { StopCircle } from 'lucide-react'
×
4
import { useTranslation } from 'react-i18next'
×
5
import { useHistory } from 'react-router-dom'
×
6
import { useGraphQLClient } from '../../helpers/graphQL.js'
×
7
import { useModal } from '../../hooks/modal.js'
×
8
import Button from '../Button.jsx'
×
9
import Modal from '../Modal.jsx'
×
10
import FormActions from '../molecules/FormActions.jsx'
×
11

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

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

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

34
  const collaborativeSessionEndModal = useModal()
×
35

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

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