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

EcrituresNumeriques / stylo / 18379771351

09 Oct 2025 02:31PM UTC coverage: 39.427% (-0.1%) from 39.574%
18379771351

push

github

web-flow
chore: permet de renseigner la configuration du formulaire des métadonnées sur un espace de travail (#1696)

596 of 844 branches covered (70.62%)

Branch coverage included in aggregate %.

14 of 192 new or added lines in 7 files covered. (7.29%)

2 existing lines in 1 file now uncovered.

5911 of 15660 relevant lines covered (37.75%)

2.58 hits per line

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

0.0
/front/src/components/workspace/WorkspaceUpdateFormMetadata.jsx
NEW
1
import React, { useCallback } from 'react'
×
NEW
2
import { useTranslation } from 'react-i18next'
×
NEW
3
import { toast } from 'react-toastify'
×
4

NEW
5
import { fromFormData } from '../../helpers/forms.js'
×
NEW
6
import { useWorkspaceActions } from '../../hooks/workspace.js'
×
7

NEW
8
import FormActions from '../molecules/FormActions.jsx'
×
9

NEW
10
import buttonStyles from '../button.module.scss'
×
NEW
11
import styles from './createWorkspace.module.scss'
×
12

13
/**
14
 * @param {Object} props
15
 * @param {Function} props.onSubmit
16
 * @param {Function} props.onCancel
17
 * @param {Object} props.workspace
18
 * @return {JSX.Element}
19
 */
NEW
20
export default function WorkspaceUpdateFormMetadata({
×
NEW
21
  onSubmit,
×
NEW
22
  onCancel,
×
NEW
23
  workspace,
×
NEW
24
}) {
×
NEW
25
  const { t } = useTranslation()
×
NEW
26
  const { updateFormMetadata } = useWorkspaceActions()
×
27

NEW
28
  const handleSubmit = useCallback(async (event) => {
×
NEW
29
    event.preventDefault()
×
NEW
30
    try {
×
NEW
31
      const updateFormMetadataInput = fromFormData(event.target)
×
NEW
32
      await updateFormMetadata(workspace._id, updateFormMetadataInput)
×
NEW
33
      toast(t('workspace.updateFormMetadata.successNotification'), {
×
NEW
34
        type: 'info',
×
NEW
35
      })
×
36

NEW
37
      onSubmit()
×
NEW
38
    } catch (err) {
×
NEW
39
      toast(
×
NEW
40
        t('workspace.updateFormMetadata.errorNotification', {
×
NEW
41
          errMessage: err,
×
NEW
42
        }),
×
NEW
43
        {
×
NEW
44
          type: 'error',
×
NEW
45
        }
×
NEW
46
      )
×
NEW
47
    }
×
NEW
48
  }, [])
×
49

NEW
50
  return (
×
NEW
51
    <section>
×
NEW
52
      <form onSubmit={handleSubmit} className={styles.form}>
×
NEW
53
        <label htmlFor="data">{t('workspace.formMetadata.data')}</label>
×
NEW
54
        <div>
×
NEW
55
          <textarea
×
NEW
56
            id="data"
×
NEW
57
            name="data"
×
NEW
58
            className={buttonStyles.textarea}
×
NEW
59
            style={{ width: '100%' }}
×
NEW
60
            rows="12"
×
61
          >
NEW
62
            {workspace.formMetadata.data}
×
NEW
63
          </textarea>
×
NEW
64
        </div>
×
NEW
65
        <label htmlFor="ui">{t('workspace.formMetadata.ui')}</label>
×
NEW
66
        <div>
×
NEW
67
          <textarea
×
NEW
68
            id="ui"
×
NEW
69
            name="ui"
×
NEW
70
            className={buttonStyles.textarea}
×
NEW
71
            style={{ width: '100%' }}
×
NEW
72
            rows="10"
×
73
          >
NEW
74
            {workspace.formMetadata.ui}
×
NEW
75
          </textarea>
×
NEW
76
        </div>
×
77

NEW
78
        <FormActions
×
NEW
79
          onCancel={onCancel}
×
NEW
80
          submitButton={{
×
NEW
81
            text: t('workspace.updateFormMetadata.buttonText'),
×
NEW
82
            title: t('workspace.updateFormMetadata.buttonTitle'),
×
NEW
83
          }}
×
NEW
84
        />
×
NEW
85
      </form>
×
NEW
86
    </section>
×
87
  )
NEW
88
}
×
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