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

RoundingWell / care-ops-frontend / 16c2126e-1505-4691-b685-13af16f3ba05

21 May 2026 03:05PM UTC coverage: 84.983% (-15.0%) from 99.95%
16c2126e-1505-4691-b685-13af16f3ba05

Pull #1697

circleci

paulfalgout
fix(flows): surface missing program relationship
Pull Request #1697: fix(flows): surface missing program relationship

1505 of 1885 branches covered (79.84%)

Branch coverage included in aggregate %.

3 of 9 new or added lines in 1 file covered. (33.33%)

814 existing lines in 78 files now uncovered.

5286 of 6106 relevant lines covered (86.57%)

186.68 hits per line

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

93.94
/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 {
122✔
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 {
13✔
35
      region: this.getRegion('content'),
36
      program: this.getOption('program'),
37
    };
38
  },
39

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

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

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

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

53
    this.showSidebar();
13✔
54

55
    this.startRoute(currentRoute);
13✔
56

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

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

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

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

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

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

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

89
  startFlowSidebar(programId) {
90
    const flow = Radio.request('entities', 'programFlows:model', {
6✔
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');
6✔
99

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

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

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

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

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

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