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

CenterForOpenScience / ember-osf-web / 5543708847

pending completion
5543708847

push

github

web-flow
Merge pull request #1904 from CenterForOpenScience/basket/cesium

Basket/cesium

2490 of 3649 branches covered (68.24%)

Branch coverage included in aggregate %.

101 of 101 new or added lines in 25 files covered. (100.0%)

5711 of 7667 relevant lines covered (74.49%)

244.16 hits per line

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

73.68
/lib/osf-components/addon/components/node-navbar/component.ts
1
import Component from '@ember/component';
2
import { action, computed } from '@ember/object';
3
import { inject as service } from '@ember/service';
4
import config from 'ember-get-config';
5
import Media from 'ember-responsive';
6
import { tracked } from 'tracked-built-ins';
7

8
import { layout } from 'ember-osf-web/decorators/component';
9
import Node from 'ember-osf-web/models/node';
10

11
import styles from './styles';
12
import template from './template';
13

14
export type NodeLike = Pick<Node, 'id' | 'isRegistration'>;
15

16
@layout(template, styles)
17
export default class NodeNavbar extends Component {
18
    @service media!: Media;
19
    // Optional parameters
20
    node?: Node;
21
    allowComments?: boolean;
22
    renderInPlace?: boolean;
23

24
    // Private properties
25
    secondaryNavbarId = config.secondaryNavbarId;
27✔
26
    @tracked collapsedNav = true;
×
27

28
    @computed('node.isRegistration')
29
    get fakeParent(): NodeLike | null {
30
        if (this.node) {
27!
31
            const id = this.node.belongsTo('parent').id();
27✔
32
            if (id) {
27✔
33
                return {
5✔
34
                    id,
35
                    // The parent of a registration is always a registration. When a component
36
                    // is registered without its parent, the registration is its own root.
37
                    isRegistration: this.node.isRegistration,
38
                };
39
            }
40
        }
41
        return null;
22✔
42
    }
43

44
    @action
45
    toggleNav() {
46
        this.toggleProperty('collapsedNav');
×
47
    }
48

49
    get shouldShowNavLinks() {
50
        if (this.media.isMobile || this.media.isTablet){
27!
51
            return !this.collapsedNav;
×
52
        }
53
        return true;
27✔
54
    }
55
}
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