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

CenterForOpenScience / ember-osf-web / 8572628743

05 Apr 2024 04:09PM UTC coverage: 65.858% (-2.3%) from 68.147%
8572628743

Pull #2185

github

web-flow
Merge 8cf5772d8 into f8c2d0077
Pull Request #2185: [DRAFT] [ENG-5346] Added the public preregistration to the author assertions page

2642 of 4314 branches covered (61.24%)

Branch coverage included in aggregate %.

14 of 288 new or added lines in 23 files covered. (4.86%)

20 existing lines in 4 files now uncovered.

6156 of 9045 relevant lines covered (68.06%)

217.4 hits per line

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

10.0
/app/preprints/-components/submit/title-and-file/component.ts
1
import Component from '@glimmer/component';
2
import PreprintStateMachine from 'ember-osf-web/preprints/-components/submit/preprint-state-machine/component';
3
import { action } from '@ember/object';
4
import { ValidationObject } from 'ember-changeset-validations';
5
import { validatePresence } from 'ember-changeset-validations/validators';
6
import buildChangeset from 'ember-osf-web/utils/build-changeset';
7

8
/**
9
 * The TitleAndFile Args
10
 */
11
interface TitleAndFileArgs {
12
    manager: PreprintStateMachine;
13
}
14

15
interface TitleAndFileForm {
16
    title: string;
17
    description: string;
18
}
19

20
const TitleAndFileFormValidation: ValidationObject<TitleAndFileForm> = {
1✔
21
    title: validatePresence({
22
        presence: true,
23
        ignoreBlank: true,
24
        type: 'empty',
25
    }),
26
    description: validatePresence({
27
        presence: true,
28
        ignoreBlank: true,
29
        type: 'empty',
30
    }),
31
};
32

33
/**
34
 * The Title And File Component
35
 */
36
export default class TitleAndFile extends Component<TitleAndFileArgs>{
NEW
37
    titleAndFileFormChangeset = buildChangeset(this.args.manager.preprint, TitleAndFileFormValidation);
×
38

39
    @action
40
    public validate(): void {
NEW
41
        this.titleAndFileFormChangeset.validate();
×
NEW
42
        if (this.titleAndFileFormChangeset.isInvalid) {
×
NEW
43
            this.args.manager.validateTitleAndFile(false);
×
NEW
44
            return;
×
45
        }
NEW
46
        this.titleAndFileFormChangeset.execute();
×
NEW
47
        this.args.manager.validateTitleAndFile(true);
×
48
    }
49
}
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