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

Validations #6

Open
46 of 47 tasks
ddavisgraphics opened this issue Mar 16, 2020 · 0 comments
Open
46 of 47 tasks

Validations #6

ddavisgraphics opened this issue Mar 16, 2020 · 0 comments
Assignees

Comments

@ddavisgraphics
Copy link
Contributor

ddavisgraphics commented Mar 16, 2020

The validations need to be considered in each form section before the item can be saved. Not sure how I'm going to work this in currently.

FORM BUILDER

  • [name] - can not have spaces
  • [choices] - must have fields selected also
  • [file types] - must be a valid file type

The form builder group has some custom JS Validations that need to be added to be sure that these items are present.

  • Url
  • Trailing Spaces
  • Starting Spaces
  • Regular Expression

DATA ENTRY

FIELD SPECIFIC VALIDATIONS

  • Detailed Error for the validation issue at hand.
  • Textarea / Text Fields (Min, Max) for each format (words, and characters)
    • Between Min / Max for Characters
    • Between Min / Max for Words
  • Number (Min, Max, Step)
    • Number Step is divisible by the entered value
    • Number is in between Min / Max
  • Any Field (no duplicates modifier)
    • Checks Database for Duplicate Values

VALIDATIONS

  • Date (EDTF)
  • Email
  • Website
  • Character Limit
  • Word Limit
  • Alphabetical Characters Only
  • AlphaNumerical
  • AlphaNumerical Plus Spaces
  • Numerical
  • Numerical Plus Spaces

REFACTOR

  • Namespaces these items into classes which create an instance that will allow us to perform the needed tasks.
  • Actor This is the performer part of the namespace and it uses Single Responsibility Principle to call the other namespaced methods from the information provided by the form field.
  • Validator This class checks the hash and returns the items as an array that need to be validated
  • TextLength
  • Integer Between Range
  • Integer Step Length
  • Regular Expression
  • Date (EDTF)
  • Email
  • Website
  • Character Limit
  • Word Limit
  • Alphabetical Characters Only
  • AlphaNumerical
  • AlphaNumerical Plus Spaces
  • Numerical
  • Numerical Plus Spaces

CURRENT MFCS BEHAVIOR

  • The current behavior only shows the validations on submission and doesn't describe the error.
  • The error is provided on the top of the screen providing the name of the field only.
  • Text validations only work for min/max words and the validation in the validation dropdown menu.
  • Integers do not validate min, max, or step. Behavior is somewhat deprecated because it is never used (maybe because it never worked?).

NEW BEHAVIOR STEPS

  • Create JavaScript Event Controller for Validations
  • Use Timeout and Debounce to keep from submitting many times on keyup
  • Create Controller and API for Validations
  • Test Controller for API Validations
  • Use JavaScript to return the error and show the validations.
@ddavisgraphics ddavisgraphics self-assigned this May 5, 2020
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

No branches or pull requests

1 participant