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

MarkUsProject / Markus / 17995758328

25 Sep 2025 03:11AM UTC coverage: 91.834% (-0.004%) from 91.838%
17995758328

Pull #7673

github

web-flow
Merge beabcc80d into 62c060720
Pull Request #7673: Convert "Rename Group" modal to React component

697 of 1488 branches covered (46.84%)

Branch coverage included in aggregate %.

13 of 15 new or added lines in 1 file covered. (86.67%)

1 existing line in 1 file now uncovered.

42305 of 45338 relevant lines covered (93.31%)

119.56 hits per line

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

80.95
/app/javascript/Components/Modals/rename_group_modal.jsx
1
import React from "react";
2
import Modal from "react-modal";
3
import PropTypes from "prop-types";
4

5
export default class RenameGroupModal extends React.Component {
6
  constructor(props) {
7
    super(props);
3✔
8
    this.state = {
3✔
9
      groupName: "",
10
    };
11
  }
12

13
  componentDidMount() {
14
    Modal.setAppElement("body");
3✔
15
  }
16

17
  componentDidUpdate(prevProps) {
18
    if (this.props.isOpen && this.props.currentGroupName) {
2!
NEW
19
      this.setState({groupName: this.props.currentGroupName});
×
20
    }
21
  }
22

23
  handleChange = event => {
3✔
24
    this.setState({groupName: event.target.value});
1✔
25
  };
26

27
  handleSubmit = event => {
3✔
28
    event.preventDefault();
1✔
29
    if (!this.state.groupName) {
1!
NEW
30
      return this.props.onRequestClose();
×
31
    }
32
    this.props.onSubmit(this.state.groupName);
1✔
33
    this.setState({groupName: ""});
1✔
34
  };
35

36
  render() {
37
    return (
5✔
38
      <Modal
39
        className="react-modal markus-dialog"
40
        isOpen={this.props.isOpen}
41
        onRequestClose={this.props.onRequestClose}
42
        id="rename_group_dialog"
43
      >
44
        <h2>{I18n.t("groups.rename_group")}</h2>
45
        <form onSubmit={this.handleSubmit}>
46
          <label htmlFor="groupName">{I18n.t("activerecord.attributes.group.group_name")}</label>
47
          <input
48
            id="groupName"
49
            type="text"
50
            value={this.state.groupName}
51
            onChange={event => this.handleChange(event)}
1✔
52
            autoFocus
53
          />
54
          <div className={"dialog-actions"}>
55
            <button
56
              className="button"
57
              type="submit"
58
              disabled={!this.state.groupName}
59
              data-testid="rename-submit-button"
60
            >
61
              {I18n.t("groups.rename_group")}
62
            </button>
63
            <button className="button" type="reset" onClick={this.props.onRequestClose}>
64
              {I18n.t("cancel")}
65
            </button>
66
          </div>
67
        </form>
68
      </Modal>
69
    );
70
  }
71
}
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