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

CaptainFact / captain-fact-frontend / 10872055555

15 Sep 2024 03:05PM UTC coverage: 6.986% (-0.06%) from 7.044%
10872055555

Pull #1302

github

Betree
feat: Statement draft
Pull Request #1302: Feat/statement draft

58 of 1808 branches covered (3.21%)

Branch coverage included in aggregate %.

0 of 21 new or added lines in 4 files covered. (0.0%)

2 existing lines in 2 files now uncovered.

269 of 2873 relevant lines covered (9.36%)

0.27 hits per line

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

0.0
/app/components/Statements/StatementHeader.jsx
1
import { Box } from '@rebass/grid'
2
import React from 'react'
3
import { withNamespaces } from 'react-i18next'
4
import Popup from 'reactjs-popup'
5
import { InfoCircle } from 'styled-icons/fa-solid'
6

7
import { MIN_REPUTATION_REMOVE_STATEMENT, MIN_REPUTATION_UPDATE_STATEMENT } from '../../constants'
8
import ClickableIcon from '../Utils/ClickableIcon'
9
import Message from '../Utils/Message'
10
import ReputationGuardTooltip from '../Utils/ReputationGuardTooltip'
11
import Tag from '../Utils/Tag'
12
import TimeDisplay from '../Utils/TimeDisplay'
13

14
export default withNamespaces('videoDebate')(
15
  ({
16
    t,
17
    statementTime,
18
    isDraft,
19
    speaker,
20
    handleTimeClick,
21
    handleShowHistory,
22
    handleEdit,
23
    handleShare,
24
    handleDelete,
25
    withoutActions,
26
    customButtons,
27
  }) => (
28
    <header className="card-header">
×
29
      <div className="card-header-title">
30
        <Box mr={2}>
31
          <TimeDisplay time={statementTime} handleClick={handleTimeClick} />
32
        </Box>
33
        {isDraft && (
×
34
          <Popup
35
            contentStyle={{ zIndex: 999, maxWidth: 350 }}
36
            on="hover"
37
            trigger={
38
              <div className="mr-2">
39
                <Tag type="warning" size="small">
40
                  <span className="mr-1"> {t('statement.draft')}</span>
41
                  <InfoCircle size={12} />
42
                </Tag>
43
              </div>
44
            }
45
          >
46
            <Message type="dark">{t('statement.draftDetails')}</Message>
47
          </Popup>
48
        )}
49
        {speaker && speaker.picture && (
×
50
          <img className="speaker-mini" src={speaker.picture} alt="" />
51
        )}
52
        <strong>{speaker ? speaker.full_name : ''}</strong>
×
53
      </div>
54
      {(!withoutActions || customButtons) && (
×
55
        <div className="card-header-icon">
56
          {!withoutActions && (
×
57
            <React.Fragment>
58
              {!isDraft && (
×
59
                <ReputationGuardTooltip
60
                  requiredRep={MIN_REPUTATION_REMOVE_STATEMENT}
61
                  tooltipPosition="left center"
62
                >
63
                  {({ hasReputation }) => (
NEW
64
                    <ClickableIcon
×
65
                      name="times"
66
                      size="action-size"
67
                      title={t('main:actions.remove')}
68
                      onClick={handleDelete}
69
                      disabled={!hasReputation}
70
                    />
71
                  )}
72
                </ReputationGuardTooltip>
73
              )}
74
              <ReputationGuardTooltip
75
                requiredRep={MIN_REPUTATION_UPDATE_STATEMENT}
76
                tooltipPosition="left center"
77
              >
78
                {({ hasReputation }) => (
79
                  <ClickableIcon
×
80
                    name="pencil"
81
                    size="action-size"
82
                    title={t('main:actions.edit')}
83
                    onClick={handleEdit}
84
                    disabled={!hasReputation}
85
                  />
86
                )}
87
              </ReputationGuardTooltip>
88
              {!isDraft && (
×
89
                <React.Fragment>
90
                  <ClickableIcon
91
                    name="history"
92
                    size="action-size"
93
                    title={t('history')}
94
                    onClick={handleShowHistory}
95
                  />
96
                  <ClickableIcon
97
                    name="share-alt"
98
                    size="action-size"
99
                    title={t('main:actions.share')}
100
                    onClick={handleShare}
101
                  />
102
                </React.Fragment>
103
              )}
104
            </React.Fragment>
105
          )}
106

107
          {customButtons || null}
×
108
        </div>
109
      )}
110
    </header>
111
  ),
112
)
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