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

EcrituresNumeriques / stylo / 13141758304

04 Feb 2025 05:55PM UTC coverage: 26.581% (+0.8%) from 25.809%
13141758304

push

github

web-flow
Merge pull request #1188 from ggrossetie/fix-1171-hooks-usegraphql

342 of 546 branches covered (62.64%)

Branch coverage included in aggregate %.

54 of 303 new or added lines in 10 files covered. (17.82%)

2 existing lines in 2 files now uncovered.

3567 of 14160 relevant lines covered (25.19%)

1.66 hits per line

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

0.0
/front/src/components/workspace/WorkspaceManageMembers.jsx
NEW
1
import { Loading, useToasts } from '@geist-ui/core'
×
2
import React, { useCallback } from 'react'
×
NEW
3
import { useWorkspaceMembersActions } from '../../hooks/workspace.js'
×
4
import ContactSearch from '../ContactSearch.jsx'
×
5

6
export default function WorkspaceManageMembers({ workspace }) {
×
7
  const workspaceId = workspace._id
×
8
  const { setToast } = useToasts()
×
NEW
9
  const { members, error, isLoading, inviteMember, removeMember } =
×
NEW
10
    useWorkspaceMembersActions(workspaceId)
×
11

12
  const handleUserUpdated = useCallback(
×
13
    async ({ user, action }) => {
×
14
      if (action === 'select') {
×
15
        try {
×
NEW
16
          await inviteMember(user)
×
17
          setToast({
×
18
            text: `Utilisateur ${
×
19
              user.displayName || user.username
×
20
            } invité en tant que membre.`,
×
21
            type: 'default',
×
22
          })
×
23
        } catch (err) {
×
24
          setToast({
×
25
            text: String(err),
×
26
            type: 'error',
×
27
          })
×
28
        }
×
29
      } else if (action === 'unselect') {
×
30
        try {
×
NEW
31
          await removeMember(user)
×
32
          setToast({
×
33
            text: `Utilisateur ${
×
34
              user.displayName || user.username
×
35
            } supprimé des membres.`,
×
36
            type: 'warning',
×
37
          })
×
38
        } catch (err) {
×
39
          setToast({
×
40
            text: String(err),
×
41
            type: 'error',
×
42
          })
×
43
        }
×
44
      }
×
45
    },
×
46
    [workspaceId]
×
47
  )
×
48

NEW
49
  if (error) {
×
NEW
50
    return <div>Unable to load workspace members</div>
×
NEW
51
  }
×
52

NEW
53
  if (isLoading) {
×
NEW
54
    return <Loading />
×
NEW
55
  }
×
56

57
  return (
×
58
    <section>
×
59
      <ContactSearch
×
60
        onUserUpdated={handleUserUpdated}
×
61
        members={members}
×
62
        showActiveUser
×
63
      />
×
64
    </section>
×
65
  )
66
}
×
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