Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6caef5a
Remove mocked metadata schema service and deprecated formSchema attri…
markpatton Apr 14, 2025
5cbaca0
Replace Alpaca with SurveyJS. Remove old dependencies required by Alp…
markpatton Apr 14, 2025
e19fb6c
Update tests for the Alpaca replacement.
markpatton Apr 14, 2025
c7161d5
Abstract out formatting of exclamation mark icon to reduce code dupli…
markpatton Apr 18, 2025
db15651
Fix bugs related to submission metadata being deleted after going bac…
markpatton Apr 18, 2025
cc8bd7b
Change some test values to result in fewer duplicate lines and make S…
markpatton Apr 21, 2025
2e458b8
On submission details page, format the publication date in the user l…
markpatton Apr 23, 2025
6ccb046
Remove unused old popper library version from dependencies
markpatton Apr 24, 2025
4e7d13c
Submission repo details display should use Boostrap 5 float-start
markpatton Apr 24, 2025
99a1003
Remove usage of form-group which Bootstrap 5 no longer has.
markpatton Apr 24, 2025
56e5ece
fix: use ember-bootstrap-v5 theme for tables
jaredgalanis Apr 25, 2025
0281e3e
fix: bring border radius back to zero so everything is squared off
jaredgalanis Apr 25, 2025
8eb539b
fix: remove text decoration for links where not needed
jaredgalanis May 1, 2025
6a1da88
fix: replace text-right with text-end to conform with bootstrap 5
jaredgalanis May 1, 2025
ebc10c4
fix: general spacing on subs index and grants detail
jaredgalanis May 1, 2025
d248774
fix: a few more spacing and align tweaks to submissions index/detail …
jaredgalanis May 2, 2025
cd2f9a1
refactor: style metadata form to align with rest of app
jaredgalanis May 3, 2025
755cad2
fix: spacing in repo card between checkbox and label
jaredgalanis May 3, 2025
9438695
fix: don't wrap text in table buttons
jaredgalanis May 3, 2025
f03ae25
fix: make metadata form span width of container
jaredgalanis May 5, 2025
78e07b2
fix: make border radius square for list-group-items
jaredgalanis May 5, 2025
a811229
fix: remove table striping
jaredgalanis May 5, 2025
01381c7
fix: submission detail table styling
jaredgalanis May 5, 2025
139a2b7
fix: one more submission details table spacing issue
jaredgalanis May 5, 2025
5d7ff3f
fix: formatting on review step table
jaredgalanis May 5, 2025
967eb78
Fix metadata integration test
markpatton May 7, 2025
eb93dbc
Fix lint errors in CSS
markpatton May 8, 2025
68a2473
Handle under-embargo being a string in the metadata blob
markpatton May 8, 2025
2fc0fc3
Fix formatting of metadata next button
markpatton May 8, 2025
c845fa0
Trigger validation on metadata
markpatton May 8, 2025
36a08c4
Fix acceptance tests
markpatton May 8, 2025
2f473fd
refactor: use showCompleteButton state instead of hiding the button
jaredgalanis May 12, 2025
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
5 changes: 5 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import './deprecation-workflow';
import 'bootstrap/dist/css/bootstrap.css';
import 'ember-modal-dialog/app/styles/ember-modal-dialog/ember-modal-structure.css';
import 'ember-modal-dialog/app/styles/ember-modal-dialog/ember-modal-appearance.css';
import 'sweetalert2/dist/sweetalert2.css';
import 'survey-core/survey-core.css';

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand Down
2 changes: 1 addition & 1 deletion app/components/display-metadata-keys/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{! template-lint-disable no-triple-curlies }}
<ul class="list-unstyled" {{did-insert this.setupDisplayData}}>
<ul class="d-flex flex-column list-unstyled gap-3" {{did-insert this.setupDisplayData}}>
{{#each this.displayData as |data|}}
<li>
{{#if data.isArray}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/external-repo-review/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class ExternalRepoReviewComponent extends Component {
if (value.dismiss) {
return; // Don't redirect
}
$('#externalSubmission').modal('hide');
swal.close();
const win = window.open(repo.url, '_blank');
if (win) {
win.focus();
Expand Down
12 changes: 7 additions & 5 deletions app/components/found-manuscripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { action, get, set } from '@ember/object';
export default class FoundManuscriptsComponent extends Component {
@service oaManuscriptService;
@service workflow;
@service store;
@service appStaticConfig;

@tracked foundManuscripts = [];
Expand Down Expand Up @@ -39,11 +38,14 @@ export default class FoundManuscriptsComponent extends Component {

@task
setupManuscripts = function* () {
const doi = this.workflow.getDoiInfo().DOI;
const foundOAMss = yield this.oaManuscriptService.lookup(doi);
const doi = this.args.doi;

if (foundOAMss) {
this.foundManuscripts = [...foundOAMss];
if (doi) {
const foundOAMss = yield this.oaManuscriptService.lookup(doi);

if (foundOAMss) {
this.foundManuscripts = [...foundOAMss];
}
}
};
}
2 changes: 1 addition & 1 deletion app/components/grant-action-cell/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<LinkTo
@route="submissions.new"
@query={{hash grant=(get @record "grant.id") submission=null}}
class="btn btn-outline-primary"
class="btn btn-outline-primary text-nowrap"
>New submission</LinkTo>
{{yield}}
6 changes: 3 additions & 3 deletions app/components/message-dialog/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{{#if this.show}}
<ModalDialog @onClose="toggleModal" @translucentOverlay={{false}}>
<form class="dialog-form-width">
<div class="form-group row">
<div class="mb-3 row">
<label class="col-sm-3 col-form-label" for="msg-to">Recipient:</label>
<div class="col-sm-9">
<Input aria-label="msg-to" @id="msg-to" class="form-control" @type="text" @value={{this.to}} />
</div>
</div>

<div class="form-group row">
<div class="mb-3 row">
<label class="col-sm-3 col-form-label" for="msg-subject">Subject:</label>
<div class="col-sm-9">
<Input aria-label="msg-subject" @id="msg-subject" class="form-control" @type="text" @value={{this.subject}} />
</div>
</div>

<div class="form-group">
<div class="mb-3">
<label for="msg-text">Message:</label>
<Textarea aria-label="msg-text" @id="msg-text" class="form-control" @value={{this.message}} @rows="10" />
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/components/metadata-form/index.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div
id="schemaForm"
class="alpaca-form form-group"
id="metadata-form"
class="mb-3"
data-test-metadata-form
{{did-insert this.setupMetadataForm}}
Comment thread
markpatton marked this conversation as resolved.
{{did-update this.setupMetadataForm @schema}}
{{did-update this.setupMetadataForm @schema @data}}
>
</div>
80 changes: 46 additions & 34 deletions app/components/metadata-form/index.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
import Component from '@glimmer/component';
import stripEmptyArrays from 'pass-ui/util/strip-empty-arrays';
import { action } from '@ember/object';
import { SurveyModel } from 'survey-js-ui';
import { DefaultLightPanelless } from 'survey-core/themes';

export default class MetadataForm extends Component {
survey = null;

@action
setupMetadataForm() {
const componentContext = this;
const originalForm = this.args.schema;
const newForm = JSON.parse(JSON.stringify(originalForm));
if (!originalForm.options) {
newForm.options = {};
}
const surveySchema = this.args.schema;
const surveyData = this.args.data;

// form ctrls
newForm.options.form = {
buttons: {
Back: {
title: 'Back',
styles: 'pull-left btn btn-outline-primary',
click() {
componentContext.args.previousForm(stripEmptyArrays(this.getValue()));
},
},
Abort: {
label: 'Cancel',
styles: 'pull-left btn btn-outline-danger ml-2',
click() {
componentContext.args.cancel();
},
},
Next: {
label: 'Next',
styles: 'pull-right btn btn-primary next',
click() {
componentContext.args.nextForm(stripEmptyArrays(this.getValue()));
},
},
const customCss = {
body: 'pt-4',
page: {
// Remove default survey.js page class
root: '',
},
text: {
root: 'form-control',
},
comment: {
root: 'form-control',
},
dropdown: {
control: 'form-control',
},
};

newForm.options.hideInitValidationError = true;
this.survey = new SurveyModel(surveySchema);

this.survey.css = customCss;
this.survey.showCompleteButton = false;

this.survey.mergeData(surveyData);

this.survey.applyTheme(DefaultLightPanelless);

this.survey.applyTheme({
cssVariables: {
'--sjs-primary-backcolor': 'black',
'--sjs-primary-forecolor': 'white',
'--sjs-primary-backcolor-light': '#f0f0f0',
'--sjs-general-backcolor-dim': 'white',
'--sjs-font-family': 'var(--font-bodycopy)',
},
});
this.survey.render(document.getElementById('metadata-form'));

if (typeof this.args.onSurveyReady === 'function') {
this.args.onSurveyReady(this.survey);
}

$('#schemaForm').empty();
$('#schemaForm').alpaca(newForm);
this.survey.onComplete.add((_sender, _options) => {
this.args.next(this.survey.data);
});
}
}
19 changes: 10 additions & 9 deletions app/components/nav-bar/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
class="navbar-toggler text-center border-none"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
data-target="#navbar-supported-content"
aria-controls="navbar-supported-content"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="collapse navbar-collapse" id="navbar-supported-content">
<ul class="navbar-nav w-75">
<li class="nav-item">
<LinkTo @route="dashboard" class="nav-link pl-0 ml-0">
Expand Down Expand Up @@ -61,23 +61,24 @@
<div class="nav-item dropdown ml-auto w-25">
<a
id="user-menu-name"
class="nav-link accountInfo pr-1"
data-toggle="dropdown"
class="nav-link dropdown-toggle accountInfo pr-1"
href="#"
data-bs-toggle="dropdown"
role="button"
aria-haspopup="true"
aria-expanded="false"
{{on "click" this.toggleUserMenu}}
>
{{this.currentUser.user.displayName}}
</a>
<div id="user-menu" class="dropdown">
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<ul class="dropdown-menu {{if this.isUserMenuOpen 'show'}}" aria-labelledby="user-menu-name">
<li>
<a class="dropdown-item" href="#" {{on "click" this.logOut}}>
<i class="fa fa-lock"></i>
Logout
</a>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions app/components/nav-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default class NavBar extends Component {
@tracked aboutUrl = null;
@tracked contactUrl = null;
@tracked faqUrl = null;
@tracked isUserMenuOpen = false;

constructor() {
super(...arguments);
Expand Down Expand Up @@ -62,4 +63,9 @@ export default class NavBar extends Component {
this.faqUrl = config.branding.pages.faqUrl;
}
};

@action
toggleUserMenu() {
this.isUserMenuOpen = !this.isUserMenuOpen;
}
}
2 changes: 1 addition & 1 deletion app/components/repocopy-display/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{! template-lint-disable link-rel-noopener }}
<div class="row">
<div class="d-flex">
<strong class="col-5 px-0">Manuscript ID(s):</strong>
{{#if @repoCopy.externalIds}}
<ul class="col list-unstyled">
Expand Down
2 changes: 1 addition & 1 deletion app/components/repository-card/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
onChange: f(), // onChange handler for selecting this repo
}
}}
<li class="list-group-item d-flex align-items-center my-1">
<li class="list-group-item d-flex align-items-center my-1 gap-2">
{{#if @choice}}
<input
aria-label="Optional repositories checkbox"
Expand Down
2 changes: 1 addition & 1 deletion app/components/submission-action-cell/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{! template-lint-disable link-href-attributes no-action no-inline-styles no-invalid-interactive }}
{{#if @record.isStub}}
<LinkTo @route="submissions.new" @query={{hash submission=@record.id}} class="btn btn-outline-primary">
<LinkTo @route="submissions.new" @query={{hash submission=@record.id}} class="btn btn-outline-primary text-nowrap">
Finish submission
</LinkTo>
{{else if (and (eq @record.submissionStatus "changes-requested") this.isSubmitter)}}
Expand Down
4 changes: 2 additions & 2 deletions app/components/submission-repo-details/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{! template-lint-disable link-rel-noopener no-curly-component-invocation no-implicit-this }}
<li>
<div class="card float-left col-5 mr-3 mb-0">
<div class="card float-start col-5 mr-3 mb-0">
<div class="card-body sub-status">
<div class="row card-title">
{{#if @repo.url}}
Expand All @@ -10,7 +10,7 @@
{{/if}}
</div>
<p class="card-text">
<div class="row">
<div class="d-flex">
<strong class="col-5 px-0">Deposit status: </strong>
{{#unless this.isExternalRepo}}
<div class="col">
Expand Down
13 changes: 7 additions & 6 deletions app/components/workflow-basics/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
If the manuscript/article you are submitting has been assigned a Digital Object Identifier (DOI), please provide it
now to pre-populate submission forms.
</p>
<div class="form-group">
<label>
<div class="mb-3">
<label for="doi">
DOI
</label>
<p class="help-block">
Expand Down Expand Up @@ -129,8 +129,8 @@
</div>
{{/if}}
</div>
<div class="form-group">
<label>
<div class="mb-3">
<label for="title">
Manuscript/Article Title
<span class="text-muted">
(required)
Expand All @@ -149,14 +149,14 @@
/>
</div>

<div class="form-group">
<div class="mb-3">
<p class="lead text-muted">
If you are an NIH-user, a journal selection is required to deposit into PMC. It is optional for all other users. If
you do not see your journal listed, you can skip the journal selection and still use PASS to deposit into
JScholarship.
</p>
<div>
<label>
<label for="journal">
Journal
</label>
{{#if this.contactUrl}}
Expand All @@ -177,6 +177,7 @@
/>
{{else}}
<input
id="journal"
type="text"
class="form-control"
value={{@publication.journal.journalName}}
Expand Down
Loading
Loading