Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions app/preprints/-components/submit/supplements/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ interface SupplementsArgs {
*/
export default class Supplements extends Component<SupplementsArgs>{
@tracked displayExistingNodeWidget = false;
@tracked displayCreateNodeWidget = false;
@tracked isSupplementAttached = false;
@tracked isModalOpen = false;

constructor(owner: unknown, args: SupplementsArgs) {
super(owner, args);
Expand All @@ -32,26 +32,24 @@ export default class Supplements extends Component<SupplementsArgs>{
}

public get isDisplayCancelButton(): boolean {
return this.displayExistingNodeWidget ||
this.displayCreateNodeWidget;
return this.displayExistingNodeWidget;
}

@action
public onCancelProjectAction(): void {
this.displayExistingNodeWidget = false;
this.displayCreateNodeWidget = false;
this.isModalOpen = false;
}

@action
public onConnectOsfProject(): void {
this.displayExistingNodeWidget = true;
this.displayCreateNodeWidget = false;
}

@action
public onCreateOsfProject(): void {
this.displayCreateNodeWidget = true;
this.displayExistingNodeWidget = false;
this.isModalOpen = true;
}

@task
Expand Down
11 changes: 8 additions & 3 deletions app/preprints/-components/submit/supplements/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
data-test-create-osf-button
data-analytics-name='Create a new OSF preprint'
{{on 'click' this.onCreateOsfProject}}
local-class='btn-width {{if this.displayCreateNodeWidget 'selected'}}'
local-class='btn-width {{if this.isModelOpen 'selected'}}'
@layout='large'
>
{{t 'preprints.submit.step-four.create-button'}}
Expand All @@ -48,9 +48,7 @@
<Preprints::-Components::Submit::Supplements::ExistingNodeWidget
@projectSelected={{this.projectSelected}}
/>
{{/if}}

{{#if this.isDisplayCancelButton}}
<div local-class='cancel-button-container'>
<Button
data-test-cancel-button
Expand All @@ -60,5 +58,12 @@
</Button>
</div>
{{/if}}

<NewProjectModal
@isPublic={{true}}
@openModal={{this.isModalOpen}}
@afterProjectCreated={{this.projectSelected}}
@closeModal={{this.onCancelProjectAction}}
/>
{{/if}}
</div>
4 changes: 0 additions & 4 deletions app/preprints/-components/submit/title-and-file/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@
}
}
}

&.mobile {
height: fit-content;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div local-class='preprint-input-container {{if (is-mobile) 'mobile'}}'>
<div local-class='preprint-input-container'>
<h3 local-class='title'
data-test-title
>
Expand Down