• 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/workspace/WorkspaceSelectionItems.jsx
1
import React, { useCallback, useMemo } from 'react'
×
2
import PropTypes from 'prop-types'
×
3
import { useSelector } from 'react-redux'
×
4

5
import useFetchData from '../../hooks/graphql.js'
×
NEW
6
import Loading from '../molecules/Loading.jsx'
×
7

UNCOV
8
import WorkspaceSelectItem from './WorkspaceSelectItem.jsx'
×
9

NEW
10
import { getArticleWorkspaces } from './Workspaces.graphql'
×
11

12
export default function WorkspaceSelectionItems({ articleId }) {
×
13
  const userWorkspaces = useSelector((state) => state.activeUser.workspaces)
×
14
  const { data, isLoading, mutate } = useFetchData(
×
15
    { query: getArticleWorkspaces, variables: { articleId } },
×
16
    {
×
17
      revalidateOnFocus: false,
×
18
      revalidateOnReconnect: false,
×
19
    }
×
20
  )
×
21

22
  const articleWorkspaces = useMemo(
×
23
    () => data?.article?.workspaces || [],
×
24
    [data]
×
25
  )
×
26

27
  const handleWorkspaceUpdate = useCallback(() => {
×
28
    mutate()
×
29
  }, [mutate])
×
30

31
  if (isLoading) {
×
32
    return <Loading />
×
33
  }
×
34

35
  return (
×
36
    <>
×
37
      {userWorkspaces.map((workspace) => (
×
38
        <WorkspaceSelectItem
×
39
          key={workspace._id}
×
40
          id={workspace._id}
×
41
          color={workspace.color}
×
42
          name={workspace.name}
×
43
          articleId={articleId}
×
44
          selected={articleWorkspaces.map((w) => w._id).includes(workspace._id)}
×
45
          onChange={handleWorkspaceUpdate}
×
46
        />
×
47
      ))}
×
48
    </>
×
49
  )
50
}
×
51

52
WorkspaceSelectionItems.propTypes = {
×
53
  articleId: PropTypes.string,
×
54
}
×
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