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

RoundingWell / care-ops-frontend / 7a9e0dfe-a1cb-47f6-baca-e6adf9c664aa

06 Aug 2025 08:26PM UTC coverage: 89.726% (-10.3%) from 100.0%
7a9e0dfe-a1cb-47f6-baca-e6adf9c664aa

push

circleci

web-flow
Merge pull request #1485 from RoundingWell/pt-search-updates

Implement `match` object in patient search api response data

1589 of 1839 branches covered (86.41%)

Branch coverage included in aggregate %.

5616 of 6191 relevant lines covered (90.71%)

202.72 hits per line

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

95.24
/src/js/apps/programs/program/flow/flow_app.js
1
import Radio from 'backbone.radio';
2

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

5
import ActionApp from 'js/apps/programs/program/action/action_app';
6

7
import ProgramSidebarApp from 'js/apps/programs/sidebar/program-sidebar_app';
8
import FlowSidebarApp from 'js/apps/programs/sidebar/flow-sidebar_app';
9

10
import { LayoutView, ContextTrailView, HeaderView, AddActionView, ListView } from 'js/views/programs/program/flow/flow_views';
11
import { SidebarView } from 'js/views/programs/program/sidebar/sidebar-views';
12

13
export default SubRouterApp.extend({
14
  routerAppName: 'ProgramFlowApp',
15
  childApps: {
16
    action: ActionApp,
17
    programSidebar: ProgramSidebarApp,
18
    flowSidebar: FlowSidebarApp,
19
  },
20
  eventRoutes: {
21
    'programFlow:action': 'showActionSidebar',
22
    'programFlow:action:new': 'showActionSidebar',
23
  },
24
  onBeforeStart() {
25
    this.showView(new LayoutView());
13✔
26
  },
27
  beforeStart({ flowId }) {
28
    return [
13✔
29
      Radio.request('entities', 'fetch:programs:model:byProgramFlow', flowId),
30
      Radio.request('entities', 'fetch:programFlows:model', flowId),
31
      Radio.request('entities', 'fetch:programActions:collection:byProgramFlow', flowId),
32
    ];
33
  },
34
  onFail() {
35
    Radio.trigger('event-router', 'notFound');
1✔
36
    this.stop();
1✔
37
  },
38
  onStart({ currentRoute }, program, flow, actions) {
39
    this.program = program;
11✔
40
    this.flow = flow;
11✔
41
    this.actions = actions;
11✔
42

43
    this.maintainFlowActions();
11✔
44

45
    this.showChildView('contextTrail', new ContextTrailView({
11✔
46
      model: this.flow,
47
      program: this.program,
48
    }));
49

50
    this.showHeader();
11✔
51
    this.showAddAction();
11✔
52
    this.showActionList();
11✔
53
    this.showProgramSidebar();
11✔
54

55
    this.startRoute(currentRoute);
11✔
56
  },
57

58
  maintainFlowActions() {
59
    this.listenTo(this.actions, 'change:id destroy', () => {
11✔
60
      this.flow.setActions(this.actions);
3✔
61
    });
62
  },
63

64
  showHeader() {
65
    const headerView = new HeaderView({
11✔
66
      model: this.flow,
67
    });
68

69
    this.listenTo(headerView, {
11✔
70
      'edit': this.onEditFlow,
71
    });
72

73
    this.showChildView('header', headerView);
11✔
74
  },
75

76
  showAddAction() {
77
    const addActionView = new AddActionView();
11✔
78

79
    this.listenTo(addActionView, {
11✔
80
      'click:addAction': () => {
81
        Radio.trigger('event-router', 'programFlow:action:new', this.flow.id);
1✔
82
      },
83
    });
84

85
    this.showChildView('addAction', addActionView);
11✔
86
  },
87

88
  showActionList() {
89
    this.showChildView('actionList', new ListView({
11✔
90
      collection: this.actions,
91
    }));
92
  },
93

94
  showProgramSidebar() {
95
    const sidebarView = new SidebarView({ model: this.program });
11✔
96

97
    this.listenTo(sidebarView, {
11✔
98
      'edit': this.onEditProgram,
99
    });
100

101
    this.showChildView('sidebar', sidebarView);
11✔
102
  },
103

104
  showActionSidebar(flowId, actionId) {
105
    const actionApp = this.getChildApp('action');
9✔
106

107
    this.listenToOnce(actionApp, {
9✔
108
      'start'(options, action) {
109
        this.editAction(action);
9✔
110
      },
111
    });
112

113
    this.startChildApp('action', { actionId, flowId });
9✔
114
  },
115

116
  editAction(action) {
117
    if (action.isNew()) {
9✔
118
      action.set({ sequence: this.actions.length });
2✔
119
      this.actions.add(action);
2✔
120
      return;
2✔
121
    }
122

123
    action.trigger('editing', true);
7✔
124
  },
125

126
  onEditProgram() {
127
    const programSidebar = this.getChildApp('programSidebar');
1✔
128
    Radio.request('sidebar', 'start', programSidebar, { program: this.program });
1✔
129
  },
130

131
  onEditFlow() {
132
    const flowSidebar = this.getChildApp('flowSidebar');
×
133
    Radio.request('sidebar', 'start', flowSidebar, { flow: this.flow });
×
134
  },
135
});
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