Skip to content
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

Implement form support in Vue.js/REST API #3594

Closed
NateWr opened this issue Apr 17, 2018 · 20 comments
Closed

Implement form support in Vue.js/REST API #3594

NateWr opened this issue Apr 17, 2018 · 20 comments
Assignees
Labels
Enhancement:3:Major A new feature or improvement that will take a month or more to complete.
Milestone

Comments

@NateWr
Copy link
Contributor

NateWr commented Apr 17, 2018

The commit history on this is very large, so I will summarize the PRs and discussion here.

Summary

These PRs replace the context and site settings forms. A set of Vue.js components controls forms on the client side. Forms are submitted to the API, which uses service classes to validate, sanitize, get, create and update objects.

Significant infrastructural changes have been put in place, which I hope to consolidate into best practices used throughout the application. Includes:

  • Define and document entities with json-schema.
  • Replace our validation with Laravel's validation library.
  • Service class methods to sanitize and validate entities based on their json-schema.
  • A set of form and field components to configure and load forms on the frontend.

I've written up a rough introduction to the new schema-based architecture.

PRs:

#3931
pkp/ojs#2067
pkp/omp#614
pkp/ui-library#20
pkp/ojs-user-guide#20
pkp/omp-user-guide#2
pkp/customBlockManager#46
pkp/citationStyleLanguage#44
pkp/orcidProfile#49
pkp/staticPages#42
pkp/tinymce#41
pkp/usageStats#6

Theme PRs:

https://github.com/NateWr/bootstrap3/pull/101
NateWr/criticalTimes#4

Discussion

@NateWr NateWr self-assigned this Apr 17, 2018
@NateWr NateWr added the Enhancement:3:Major A new feature or improvement that will take a month or more to complete. label Apr 17, 2018
@NateWr NateWr added this to the OJS/OMP 3.2 milestone Apr 17, 2018
@asmecher
Copy link
Member

So a couple of notes about the current Form Builder Vocabulary structure. Overall it's been inflexible and weird and unpleasant to work with, but there are a few things it has done decently:

  • Abstracted away labeling and kept the required markup minimal (and accessibility standardized, if not wonderful)
  • Managed details like TinyMCE support with the flip of an attribute
  • Managed escaping/XSS (not hard to do with e.g. raw HTML, but needs to be done)
  • Especially multilingual support. This probably justifies its own meeting.

For better or for worse it did shrink a lot of multifarious markup down to a much trimmer and more standardized set.

NateWr added a commit to NateWr/ui-library that referenced this issue May 24, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 29, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 30, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 30, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 30, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 30, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 30, 2018
…forms.

When the aria-describedby content is read out by a screenreader, it would
read the tooltip label. Something like: Tooltip for fieldname. But a
screenreader user has no easy way to interact with that tooltip to display
it. So instead we put the tooltip content into a separate hidden element
and use that as thet aria-describedby. Now the screenreader reads out the
actual tooltip rather than the button label.
NateWr added a commit to NateWr/ui-library that referenced this issue May 30, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 31, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 31, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 31, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 31, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue May 31, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 1, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 1, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 1, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 1, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 4, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 4, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 12, 2018
NateWr added a commit to NateWr/ui-library that referenced this issue Jun 12, 2018
NateWr added a commit to NateWr/ojs that referenced this issue Jan 16, 2019
NateWr added a commit to NateWr/ojs that referenced this issue Jan 16, 2019
NateWr added a commit to NateWr/omp that referenced this issue Jan 16, 2019
NateWr added a commit to NateWr/omp that referenced this issue Jan 16, 2019
NateWr added a commit to NateWr/omp that referenced this issue Jan 16, 2019
ppv1979 added a commit to ppv1979/pkp-lib that referenced this issue Jan 17, 2019
mtub added a commit that referenced this issue Jan 17, 2019
NateWr added a commit that referenced this issue Jan 17, 2019
#3594 Fix linting and syntax errors and remove unused .git…
NateWr added a commit to pkp/omp that referenced this issue Jan 17, 2019
NateWr added a commit to pkp/ojs that referenced this issue Jan 17, 2019
NateWr added a commit to pkp/ui-library that referenced this issue Jan 17, 2019
pkp/pkp-lib#3594 Refactor library to improve docs, JS linting and dep…
NateWr added a commit to pkp/bootstrap3 that referenced this issue Mar 4, 2019
NateWr added a commit to NateWr/pkp-lib that referenced this issue Apr 1, 2019
NateWr added a commit to pkp/ojs that referenced this issue Apr 11, 2019
pkp/pkp-lib#3594 Add announcements locale strings dropped during rebase
NateWr added a commit to NateWr/pkp-docs that referenced this issue Jan 23, 2020
NateWr added a commit to pkp/defaultManuscript that referenced this issue Feb 18, 2020
henriqueramos pushed a commit to henriqueramos/ui-library that referenced this issue Jan 20, 2022
- Add components for form fields, groups and pages
- Add CSRF token to all POST, PUT and DELETE requests
- Add pagination
- Add multilingual support and progress tracking
- Add tooltips and descriptions
- Add HelpButton to open help panel
- Add conditional display of form fields and groups
- Add form error handling:
  - Add inline field errors
  - Add aria-invalid to invalid fields
  - Add button to go to next error
  - Add screenreader error interaction controls
  - Add indication of pages with errors in page list
  - Prevent form submission when errors present
- Prevent form submission when required fields empty
  - Remove errors when a field is modified
- Add styling for forms inside tabs
- Add custom fields for metadata, showEnsuringLink, PKP PN plugin
- Add custom form for handling theme options, copyrightHolder
- Add tab component
- Add new Orderer component
  - Update ListPanelItemOrderer to use new Orderer component
  - Implement FieldOptions ordering
- Update submission list item status to new API structure
- Update watchers to use Vue's watch feature
henriqueramos pushed a commit to henriqueramos/ui-library that referenced this issue Jan 20, 2022
- Update vue-tabs-component to fix id/hash bug
- Add CSRF token to file upload fields and LicenseForm
- Fix bio showing in reviewer selection when no bio exists
- Use description in FieldHTML instead of value so it is not submitted
- Adjust size of form group titles
- Don't show ListPanel filter button when no filters exist
- Use inline tinymce editor [1]

[1] This improves load time significantly, because tinymce no longer
makes a separate request to a CSS file for each instance of the
editor. It also solves an issue with tinymce editors inside modals,
in which the iframe would stop loading properly if the modal was
closed and reopened.
henriqueramos pushed a commit to henriqueramos/ui-library that referenced this issue Jan 20, 2022
henriqueramos pushed a commit to henriqueramos/ui-library that referenced this issue Jan 20, 2022
…endencies

This is a complete rebuild of the UI Library as a Vue CLI 3 app. It
caters to child components better now, which is what the majority of
our components will be.
henriqueramos pushed a commit to henriqueramos/ui-library that referenced this issue Jan 20, 2022
pkp/pkp-lib#3594 Refactor library to improve docs, JS linting and dep…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:3:Major A new feature or improvement that will take a month or more to complete.
Projects
None yet
Development

No branches or pull requests

2 participants