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

CenterForOpenScience / ember-osf-web / 13206780108

07 Feb 2025 07:33PM UTC coverage: 66.63% (-0.2%) from 66.833%
13206780108

Pull #2490

github

web-flow
Merge f400645ac into 7005478ea
Pull Request #2490: [wip][ENG-6953][ENG-6954][ENG-6955] send usage metrics to datacite

3113 of 5101 branches covered (61.03%)

Branch coverage included in aggregate %.

18 of 53 new or added lines in 4 files covered. (33.96%)

13 existing lines in 2 files now uncovered.

7915 of 11450 relevant lines covered (69.13%)

189.65 hits per line

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

66.67
/app/models/configured-addon.ts
1
import Model, { AsyncBelongsTo, attr, belongsTo } from '@ember-data/model';
2
import { waitFor } from '@ember/test-waiters';
3
import { task } from 'ember-concurrency';
4

5
import UserReferenceModel from 'ember-osf-web/models/user-reference';
6
import { tracked } from 'tracked-built-ins';
7
import { taskFor } from 'ember-concurrency-ts';
8
import { ConnectedStorageOperationNames, OperationKwargs } from './addon-operation-invocation';
9

10

11
export interface ConfiguredAddonEditableAttrs {
12
    displayName: string;
13
    rootFolder: string;
14
}
15

16
export default class ConfiguredAddonModel extends Model {
17
    @attr('string') displayName!: string;
18
    @attr('fixstring') externalUserId!: string;
19
    @attr('fixstring') externalUserDisplayName!: string;
20

21
    @attr('string') iconUrl!: string;
22
    @attr('string') authorizedResourceUri?: string;
23

24
    @attr('array') connectedCapabilities!: ConnectedCapabilities[];
25
    @attr('array') connectedOperationNames!: ConnectedStorageOperationNames[];
26
    @attr('fixstring') rootFolder!: string;
27
    @attr('fixstring') externalServiceName!: string;
28

29
    @belongsTo('user-reference', { inverse: null })
30
    accountOwner!: AsyncBelongsTo<UserReferenceModel> & UserReferenceModel;
31

32
    @attr('boolean')
33
    currentUserIsOwner!: boolean;
34

35
    async getFolderItems(this: ConfiguredAddonModel, _kwargs?: OperationKwargs) : Promise<any> {
36
        // To be implemented in child classes
UNCOV
37
        return;
×
38
    }
39

40

41
    async getItemInfo(this: ConfiguredAddonModel, _itemId: string) : Promise<any> {
42
        // To be implemented in child classes
UNCOV
43
        return;
×
44
    }
45

46
    get hasRootFolder() {
47
        return true;
4✔
48

49
    }
50

51
    @tracked rootFolderName = '';
2✔
52

53
    @task
54
    @waitFor
55
    async getRootFolderName(this: ConfiguredAddonModel) {
56
        const response = await taskFor(this.getItemInfo).perform(this.rootFolder);
4✔
57
        this.rootFolderName = response.operationResult.itemName;
4✔
58
    }
59
}
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

© 2025 Coveralls, Inc