-
Notifications
You must be signed in to change notification settings - Fork 14
Replace alpaca and remove old dependencies #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 5cbaca0
Replace Alpaca with SurveyJS. Remove old dependencies required by Alp…
markpatton e19fb6c
Update tests for the Alpaca replacement.
markpatton c7161d5
Abstract out formatting of exclamation mark icon to reduce code dupli…
markpatton db15651
Fix bugs related to submission metadata being deleted after going bac…
markpatton cc8bd7b
Change some test values to result in fewer duplicate lines and make S…
markpatton 2e458b8
On submission details page, format the publication date in the user l…
markpatton 6ccb046
Remove unused old popper library version from dependencies
markpatton 4e7d13c
Submission repo details display should use Boostrap 5 float-start
markpatton 99a1003
Remove usage of form-group which Bootstrap 5 no longer has.
markpatton 56e5ece
fix: use ember-bootstrap-v5 theme for tables
jaredgalanis 0281e3e
fix: bring border radius back to zero so everything is squared off
jaredgalanis 8eb539b
fix: remove text decoration for links where not needed
jaredgalanis 6a1da88
fix: replace text-right with text-end to conform with bootstrap 5
jaredgalanis ebc10c4
fix: general spacing on subs index and grants detail
jaredgalanis d248774
fix: a few more spacing and align tweaks to submissions index/detail …
jaredgalanis cd2f9a1
refactor: style metadata form to align with rest of app
jaredgalanis 755cad2
fix: spacing in repo card between checkbox and label
jaredgalanis 9438695
fix: don't wrap text in table buttons
jaredgalanis f03ae25
fix: make metadata form span width of container
jaredgalanis 78e07b2
fix: make border radius square for list-group-items
jaredgalanis a811229
fix: remove table striping
jaredgalanis 01381c7
fix: submission detail table styling
jaredgalanis 139a2b7
fix: one more submission details table spacing issue
jaredgalanis 5d7ff3f
fix: formatting on review step table
jaredgalanis 967eb78
Fix metadata integration test
markpatton eb93dbc
Fix lint errors in CSS
markpatton 68a2473
Handle under-embargo being a string in the metadata blob
markpatton 2fc0fc3
Fix formatting of metadata next button
markpatton c845fa0
Trigger validation on metadata
markpatton 36a08c4
Fix acceptance tests
markpatton 2f473fd
refactor: use showCompleteButton state instead of hiding the button
jaredgalanis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}} | ||
| {{did-update this.setupMetadataForm @schema}} | ||
| {{did-update this.setupMetadataForm @schema @data}} | ||
| > | ||
| </div> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| }); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.