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

CaptainFact / captain-fact-frontend / 12789257986

15 Jan 2025 01:22PM UTC coverage: 6.953%. Remained the same
12789257986

push

github

web-flow
Merge pull request #1351 from CaptainFact/staging

Release

58 of 1814 branches covered (3.2%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

269 of 2889 relevant lines covered (9.31%)

0.26 hits per line

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

0.0
/app/components/Users/UserSettings.jsx
1
import { Flex } from '@rebass/grid'
2
import React from 'react'
3
import { withNamespaces } from 'react-i18next'
4
import { connect } from 'react-redux'
5

6
import { deleteUserAccount } from '../../API/http_api/current_user'
7
import { addModal, popModal } from '../../state/modals/reducer'
8
import UserLanguageSelector from '../LoggedInUser/UserLanguageSelector'
9
import { withLoggedInUser } from '../LoggedInUser/UserProvider'
10
import Button from '../Utils/Button'
11
import { LoadingFrame } from '../Utils/LoadingFrame'
12
import DeleteUserModal from './DeleteUserModal'
13
import EditUserForm from './EditUserForm'
14

15
@connect((state) => ({ locale: state.UserPreferences.locale }), { addModal, popModal })
×
16
@withNamespaces('user')
17
@withLoggedInUser
18
export default class UserSettings extends React.PureComponent {
19
  render() {
NEW
20
    const { t, addModal, logout } = this.props
×
21
    return this.props.isLoading ? (
×
22
      <LoadingFrame />
23
    ) : (
24
      <div className="section">
25
        <div className="has-text-centered">
26
          <h3 className="title is-3">{t('accountSettings')}</h3>
27
        </div>
28
        <EditUserForm />
29
        <br />
30
        <hr />
31
        <div className="has-text-centered">
32
          <h3 className="title is-3">{t('main:menu.language')}</h3>
33
          <Flex justifyContent="center">
34
            <UserLanguageSelector />
35
          </Flex>
36
        </div>
37
        <br />
38
        <hr />
39
        <br />
40
        <div className="has-text-centered">
41
          <h3 className="title is-3">{t('dangerZone')}</h3>
42
          <Button
43
            className="is-danger"
44
            onClick={() =>
45
              addModal({
×
46
                Modal: DeleteUserModal,
47
                props: {
48
                  handleConfirm: () => {
49
                    return deleteUserAccount().then(() => {
×
50
                      logout()
×
51
                      this.props.popModal()
×
52
                    })
53
                  },
54
                },
55
              })
56
            }
57
          >
58
            {t('deleteAccount')}
59
          </Button>
60
        </div>
61
      </div>
62
    )
63
  }
64
}
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