Skip to content

Comments

Replace alpaca and remove old dependencies#1301

Merged
markpatton merged 32 commits intomainfrom
1140-replace-alpaca
May 12, 2025
Merged

Replace alpaca and remove old dependencies#1301
markpatton merged 32 commits intomainfrom
1140-replace-alpaca

Conversation

@markpatton
Copy link
Contributor

@markpatton markpatton commented Mar 12, 2025

Changes:

  • Removes various old dependencies that were manually loaded from index.html
    • No more jquery!
  • Removes manually included bootstrap 4 such that we are now on 5 as package.json always claimed
  • Replace use of alpaca with SurveryJS
    • The look and feel of the metadata form is different
    • Validation is different and can be more finely tuned
    • The resulting submission metadata should be the same
    • Schema service is configured by static JSON files:
      • The pass-core metadata schema service is not used
      • Survey schema has every metadata field in it
      • The repository map indicates which properties a repository metadata schema and if they are required
        • Note the handling of dynamic requires
  • Schema service in pass-ui handle manages repository metadata schemas
    • Backend metadata schema service no longer used
    • Fairly simple, only complexity is merging in required fields
  • Refactor handling of metadata, doi info, and read only metadata properties in the workflow
    • The code kept confusing doi info and metadata and was hard to understand
  • Needed to set publication.journal relationship to async in order to have it load.
  • When running with ember s, you must add --environment=production or there will be a CSP failure.

TODO:

  • On workflow basics step, the journal label for attribute is not correctly targeting the input element generated by ember-power-select. The triggerId argument does not appear to work.
  • CSP error when clicking edit on a submission with a DOI
    • Refused to load the image 'data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e'
  • SonarQube failing because of code duplication warning on nih-submission-test. There is a lot of duplication in that test, but not from the pr. It should be cleaned up at some point.
  • Fontawesome css is included directly as app/styles/font-awesome-5-0-13.css and probably should not be.
  • Clicking "New Submission" on a grant in the grants page or "Edit Submission" on a submission o the submissions page causes an error. But this only occurs when running in development mode!
  • Add embargo to pass-acceptance-testing

Required prs:

Manual testing needed:

  • Compare metadata forms with production to make sure nothing has been missed.
  • Check handling of read only metadata fields
  • Check validation
  • Check handling of required fields
  • Submission using nihms, jscholarship, and both
    • Check that deposit to the underlying repository works in order to make sure metadata is interpreted correctly.
  • Check that read only properties set correctly in forms
  • Check interactions with web-link repositories.
    • Used to rely on jquery
  • Check if form validation working
    • Note the conditional validation in nihms

@markpatton markpatton changed the title First draft of replacing alpaca and removing old dependencies Replace alpaca and remove old dependencies Mar 26, 2025
@markpatton markpatton force-pushed the 1140-replace-alpaca branch from 6b31d18 to 9d0ec02 Compare April 14, 2025 17:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 43 out of 48 changed files in this pull request and generated 1 comment.

Files not reviewed (5)
  • app/components/metadata-form/index.hbs: Language not supported
  • app/components/nav-bar/index.hbs: Language not supported
  • app/components/workflow-basics/index.hbs: Language not supported
  • app/components/workflow-files/index.hbs: Language not supported
  • app/components/workflow-metadata/index.hbs: Language not supported
Comments suppressed due to low confidence (2)

app/components/workflow-basics/index.js:241

  • [nitpick] Ensure consistent property access for journal attributes; consider using a uniform approach (either direct property access or Ember's get()) for accessing journal names throughout the code.
metadata['journal-title'] = journal.journalName;

app/models/repository.js:13

  • Verify that 'set' is a supported attribute type or a custom transform in your Ember Data configuration, ensuring proper serialization and deserialization.
@attr('set') schemas;

@markpatton markpatton marked this pull request as ready for review April 16, 2025 15:11
@rpoet-jh
Copy link
Contributor

rpoet-jh commented Apr 18, 2025

@markpatton Did some testing, here are my notes:

Bugs:

  • Edit of submission: details form doesn't show publication date or author
  • Form not updating attribute if grant/repos are changed in submission workflow.
    Steps:
    Login as nihuser
    create submission
    journal: Diabetes forecast
    grant: select QQDV123P7, next through to Details
    NTMLA attribute is displayed
    go back to grants page and remove QQDV123P7 and add TEST_E2E_AWD_NUM and click next through to Details. NTMLA attribute still in form. If you select TEST_E2E_AWD_NUM on new submission, NTMLA attribute is not in form.

Styling:

  • paginator layout is off
  • buttons on Dashboard underline when hover
  • table rows are striped

Workflow

  • buttons on Basics and Review steps too close to component above them (margin/padding off)
  • Details
    • Font needs to be changed to match
    • Form should be left justified
    • Width of text fields should fill 100%
    • Should NLMTA be with Journal fields?
    • Make Complete button the Next button on the workflow button footer

Submissions

  • Buttons in the Actions columns need styling on table

Submission Details

  • With Approval Requested submission, as the approver, click on submission link to open the details page. The layout of the Repositories (2 repos) is vertical instead of horizontal. I think the width of whole attribute panel needs to fill parent.
  • Buttons on bottom too close to details panel

@markpatton
Copy link
Contributor Author

@rpoet-jh

I think all the logic errors you reported are fixed.
I do see the same graphical glitches.

markpatton and others added 19 commits May 8, 2025 11:00
…aca. Switch to Bootstrap 5. Refactor metadata schema service to not rely on external service and be simpler. Refactor handling of DOI metadata in the workflow.
…cation and make SonarQube happy. Also fix handling of dialog close on submission details page.
- so that ember-models-table uses bootstrap 5
- needs a few overrides for pagination
- we might decide to do it differently in the future, but this at least keeps things as consistent with where things were as possible
@markpatton markpatton force-pushed the 1140-replace-alpaca branch from 00de3ce to 36a08c4 Compare May 8, 2025 15:01
Copy link
Contributor

@jaredgalanis jaredgalanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Only a few comments that I don't think we need to address now.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@markpatton markpatton merged commit 4826218 into main May 12, 2025
2 of 5 checks passed
@markpatton markpatton deleted the 1140-replace-alpaca branch May 12, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants