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

RoundingWell / care-ops-frontend / 478f32b5-a05d-4bf1-aab0-cc40366fae9d

17 Sep 2025 08:01AM UTC coverage: 95.256% (-4.7%) from 100.0%
478f32b5-a05d-4bf1-aab0-cc40366fae9d

push

circleci

web-flow
Merge pull request #1514 from RoundingWell/formio-loader

Attach preloader html after formio DOM content is loaded

1709 of 1849 branches covered (92.43%)

Branch coverage included in aggregate %.

6002 of 6246 relevant lines covered (96.09%)

191.66 hits per line

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

96.97
/src/js/apps/programs/program/program_app.js
1
import { partial } from 'underscore';
2
import Radio from 'backbone.radio';
3

4
import SubRouterApp from 'js/base/subrouterapp';
5

6
import { PROGRAM_BEHAVIORS } from 'js/static';
7

8
import WorkflowsApp from 'js/apps/programs/program/workflows/workflows_app';
9
import ActionApp from 'js/apps/programs/program/action/action_app';
10
import ProgramSidebarApp from 'js/apps/programs/sidebar/program-sidebar_app';
11
import FlowSidebarApp from 'js/apps/programs/sidebar/flow-sidebar_app';
12

13
import { LayoutView } from 'js/views/programs/program/program_views';
14
import { SidebarView } from 'js/views/programs/program/sidebar/sidebar-views';
15

16
export default SubRouterApp.extend({
17
  eventRoutes() {
18
    return {
147✔
19
      'program:details': partial(this.startCurrent, 'workflows'),
20
      'program:action': this.startProgramAction,
21
      'program:action:new': this.startProgramAction,
22
      'programFlow:new': this.startFlowSidebar,
23
    };
24
  },
25

26
  childApps: {
27
    workflows: WorkflowsApp,
28
    action: ActionApp,
29
    programSidebar: ProgramSidebarApp,
30
    flowSidebar: FlowSidebarApp,
31
  },
32

33
  currentAppOptions() {
34
    return {
14✔
35
      region: this.getRegion('content'),
36
      program: this.getOption('program'),
37
    };
38
  },
39

40
  onBeforeStart() {
41
    this.getRegion().startPreloader();
14✔
42
  },
43

44
  beforeStart({ programId }) {
45
    return Radio.request('entities', 'fetch:programs:model', programId);
14✔
46
  },
47

48
  onStart({ currentRoute }, program) {
49
    this.program = program;
14✔
50

51
    this.setView(new LayoutView({ model: program }));
14✔
52

53
    this.showSidebar();
14✔
54

55
    this.startRoute(currentRoute);
14✔
56

57
    this.showView();
14✔
58
  },
59

60
  startProgramAction(programId, actionId) {
61
    const actionApp = this.getChildApp('action');
4✔
62

63
    this.listenToOnce(actionApp, {
4✔
64
      'start'(options, action) {
65
        this.editList(action);
4✔
66
      },
67
      'fail'() {
68
        this.startCurrent('workflows');
×
69
      },
70
    });
71

72
    this.startChildApp('action', { actionId, programId });
4✔
73
  },
74

75
  // Triggers event on started workflow for marking the edited item
76
  editList(item) {
77
    const currentWorkflow = this.getCurrent() || this.startCurrent('workflows');
11✔
78

79
    if (!currentWorkflow.isRunning()) {
11✔
80
      this.listenToOnce(currentWorkflow, 'start', () => {
3✔
81
        currentWorkflow.triggerMethod('edit:item', item);
3✔
82
      });
83
      return;
3✔
84
    }
85

86
    currentWorkflow.triggerMethod('edit:item', item);
8✔
87
  },
88

89
  startFlowSidebar(programId) {
90
    const flow = Radio.request('entities', 'programFlows:model', {
7✔
91
      _program: { id: programId, type: 'programs' },
92
      _owner: null,
93
      published_at: null,
94
      archived_at: null,
95
      behavior: PROGRAM_BEHAVIORS.STANDARD,
96
    });
97

98
    const flowSidebar = this.getChildApp('flowSidebar');
7✔
99

100
    Radio.request('sidebar', 'start', flowSidebar, { flow });
7✔
101

102
    this.editList(flow);
7✔
103
  },
104

105
  showSidebar() {
106
    const sidebarView = new SidebarView({ model: this.program });
14✔
107

108
    this.listenTo(sidebarView, {
14✔
109
      'edit': this.onEdit,
110
    });
111

112
    this.showChildView('sidebar', sidebarView);
14✔
113
  },
114

115
  onEdit() {
116
    const programSidebar = this.getChildApp('programSidebar');
4✔
117
    Radio.request('sidebar', 'start', programSidebar, { program: this.program });
4✔
118
  },
119
});
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