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

mac-s-g / react-json-view / #1215

pending completion
#1215

push

web-flow
Merge pull request #342 from mac-s-g/bump-patch

bump patch version

284 of 349 branches covered (81.38%)

Branch coverage included in aggregate %.

504 of 597 relevant lines covered (84.42%)

90.19 hits per line

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

62.5
/src/js/components/ObjectKeyModal/AddKeyRequest.js
1
import React from 'react';
2
import dispatcher from './../../helpers/dispatcher';
3
import ObjectAttributes from './../../stores/ObjectAttributes';
4
import ObjectKeyModal from './ObjectKeyModal';
5

6
//global theme
7
import Theme from './../../themes/getStyle';
8

9
//this input appears when adding a new value to an object
10
export default class extends React.PureComponent {
11
    render() {
12
        const { active, theme, rjvId } = this.props;
20✔
13

14
        return active ? (
20✔
15
            <ObjectKeyModal
16
                rjvId={rjvId}
17
                theme={theme}
18
                isValid={this.isValid}
19
                submit={this.submit}
20
            />
21
        ) : null;
22
    }
23

24
    isValid = input => {
20✔
25
        const { rjvId } = this.props;
2✔
26
        const request = ObjectAttributes.get(
2✔
27
            rjvId,
28
            'action',
29
            'new-key-request'
30
        );
31
        return (
2✔
32
            input != '' &&
2!
33
            Object.keys(request.existing_value).indexOf(input) === -1
34
        );
35
    };
36

37
    submit = input => {
20✔
38
        const { rjvId } = this.props;
×
39
        let request = ObjectAttributes.get(rjvId, 'action', 'new-key-request');
×
40
        request.new_value = { ...request.existing_value };
×
41
        request.new_value[input] = this.props.defaultValue;
×
42
        dispatcher.dispatch({
×
43
            name: 'VARIABLE_ADDED',
44
            rjvId: rjvId,
45
            data: request
46
        });
47
    };
48
}
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

© 2025 Coveralls, Inc