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

caleb531 / flip-book / 10499286139

21 Aug 2024 11:59PM UTC coverage: 25.53% (-2.0%) from 27.541%
10499286139

push

github

caleb531
Convert components to JSX

72 of 100 branches covered (72.0%)

Branch coverage included in aggregate %.

0 of 743 new or added lines in 22 files covered. (0.0%)

54 existing lines in 21 files now uncovered.

386 of 1694 relevant lines covered (22.79%)

6.85 hits per line

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

0.0
/scripts/components/storage-upgrader.jsx
NEW
1
import m from "mithril";
×
NEW
2
import DismissableOverlayComponent from "./overlay.jsx";
×
NEW
3
import LoadingComponent from "./loading.jsx";
×
NEW
4
import StorageUpgrader from "../models/storage-upgrader.js";
×
NEW
5
import ModalComponent from "./modal.jsx";
×
NEW
6
import _ from "underscore";
×
7

8
class StorageUpgraderComponent {
×
9
  oninit() {
×
10
    this.upgrader = new StorageUpgrader();
×
11
    if (this.upgrader.shouldUpgrade()) {
×
12
      this.isVisible = true;
×
13
      this.upgrade();
×
14
    }
×
15
  }
×
16

17
  upgrade() {
×
18
    // Show the upgrade panel for a minimum of 1000ms so the user has time to
19
    // perceive what's happening
20
    setTimeout(() => {
×
21
      try {
×
22
        this.upgrader.upgrade().catch((error) => {
×
23
          this.handleError(error);
×
24
        });
×
25
      } catch (error) {
×
26
        this.handleError(error);
×
27
      }
×
28
    }, 1000);
×
29
  }
×
30

31
  handleError(error) {
×
32
    console.error(error);
×
33
    this.isVisible = false;
×
34
    m.redraw();
×
35
  }
×
36

37
  // When the Storage Upgrade prompt shows, blur the editor by focusing the
38
  // prompt
39
  blurEditor({ dom }) {
×
40
    _.defer(() => {
×
41
      dom.focus();
×
42
    });
×
43
  }
×
44

45
  view() {
×
NEW
46
    return this.isVisible ? (
×
NEW
47
      <div className="storage-upgrader" oncreate={this.blurEditor}>
×
NEW
48
        <ModalComponent>
×
NEW
49
          <h2 className="storage-upgrader-heading">Upgrading Database...</h2>
×
NEW
50
          <p className="storage-upgrader-message">
×
51
            Hang tight while we upgrade the database...
NEW
52
          </p>
×
NEW
53
          <LoadingComponent class="storage-upgrader-loading" />
×
NEW
54
        </ModalComponent>
×
NEW
55
      </div>
×
NEW
56
    ) : null;
×
57
  }
×
58
}
×
59

60
export default StorageUpgraderComponent;
×
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