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

RoundingWell / care-ops-frontend / c6789788-b82b-4fa2-afc3-8cfd51fdf72e

21 May 2026 03:23PM UTC coverage: 79.975% (-20.0%) from 99.95%
c6789788-b82b-4fa2-afc3-8cfd51fdf72e

Pull #1697

circleci

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

1410 of 1889 branches covered (74.64%)

Branch coverage included in aggregate %.

3 of 5 new or added lines in 1 file covered. (60.0%)

1120 existing lines in 81 files now uncovered.

4984 of 6106 relevant lines covered (81.62%)

127.86 hits per line

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

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

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

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

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

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

53
    this.showSidebar();
5✔
54

55
    this.startRoute(currentRoute);
5✔
56

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

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

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

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

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

79
    if (!currentWorkflow.isRunning()) {
5✔
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);
2✔
87
  },
88

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

UNCOV
98
    const flowSidebar = this.getChildApp('flowSidebar');
×
99

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

UNCOV
102
    this.editList(flow);
×
103
  },
104

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

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

112
    this.showChildView('sidebar', sidebarView);
5✔
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