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

RoundingWell / care-ops-frontend / 04733626-2f53-4aa6-a8fd-51f2ead18de6

12 Aug 2025 07:53PM UTC coverage: 96.189% (+1.1%) from 95.097%
04733626-2f53-4aa6-a8fd-51f2ead18de6

Pull #1491

circleci

paulfalgout
Add success callback for auth

In some cases we were created a race condition where the auth function was “resolving” during the auth0 sdk redirect, and so a request was made 401’d and logged out prior to auth0 successfully authing.

success prevents a `return;` from ending the auth await in the index.
Pull Request #1491: Add success callback for auth

1727 of 1810 branches covered (95.41%)

Branch coverage included in aggregate %.

5820 of 6036 relevant lines covered (96.42%)

216.48 hits per line

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

71.43
/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());
5✔
26
  },
27
  beforeStart({ flowId }) {
28
    return [
5✔
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');
×
36
    this.stop();
×
37
  },
38
  onStart({ currentRoute }, program, flow, actions) {
39
    this.program = program;
4✔
40
    this.flow = flow;
4✔
41
    this.actions = actions;
4✔
42

43
    this.maintainFlowActions();
4✔
44

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

126
  onEditProgram() {
127
    const programSidebar = this.getChildApp('programSidebar');
×
128
    Radio.request('sidebar', 'start', programSidebar, { program: this.program });
×
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