wvulibraries / mfcs-ruby Goto Github PK
View Code? Open in Web Editor NEWPorting MFCS to ruby.
Porting MFCS to ruby.
Create a System Model and Database Entry. This allows setting system variables for a variety of tasks. Such as read-only.
This module is a reusable bit of code that can be used in any part of the rails application. These validations go along with validations that are inside of the various parts of the form builder.
Phone Number : validates that a phone number is a legit phone.
Limit Words. Limits the number of words in a string.
Limit Characters. Limits the number of characters in a string.
URL. Validates the string is a proper URL. Accepts telnet, ssh, fpt, https, http.
Optional URL. Validates the string is a proper URL or is an empty string.
Email. Validates that the given param is a valid email. Uses base ruby regex for doing this.
WVU Email Validates the internal email address.
IP Address. This one had a to-do to fix because it wasn't working properly so this should be fixed using ruby-core classes.
Integer. This was not also fully functional in MFCS. A valid integer could have float point numbers and other constants and the MFCS regular expression didn't take this into account.
Integer with spaces. This has been fixed to allow for many different test cases to pass and uses a shared function with the other method.
Alpha Numerical Validation. Validates a variety of alphanumerical characters including spaces.
Alpha Numerical Validation with spaces. Validates a variety of alphanumerical characters including spaces.
Alphabetical Characters Only.
Alphabetical Characters Only with spaces.
No Special Characters.
Date Validates as a edtf date. Edtf will silently fai as nil if the edtf date is not valid. See specs for full examples of valid edtf dates.
Code Can be found https://github.com/wvulibraries/mfcs-ruby/blob/master/app/lib/validator.rb
Tests and Specs
https://github.com/wvulibraries/mfcs-ruby/blob/master/spec/lib/validator_spec.rb
When checking the database for duplicate entries, the database validation is not able to determine if this is the same record that has already been created, so it creates an error saying that the item may not be saved. This renders all item updates completely useless as no items will update.
This will be the same in the JavaScript because the JS does not know when the item is being updated or saved or any information about the item.
Bugs Fixed :
Form Validation Bugs that had to be tested on the server and in the interface.
A project model needs to be made that can be used to attach forms, users, and objects independently.
There needs to be a project tab at the top of the page for each user that pulls their specific projects and pushes their specific projects. AJAX.
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.
The form builder group has some custom JS Validations that need to be added to be sure that these items are present.
THIS IS FOR FORMBUILDER ONLY OPTIONS
THESE HAVE BEEN COMPLETED. NOT BEEN DONE IN THE BACKEND JUST THE JS.
-- MOVED TO FORM BUILDER BUG
The database migrations from PHP are going to be handled by Tracy... I will be working on the import scripts for ruby which will require cross walking data to new data models.
The FFMPEG Video class needs the ability to make thumbnails, set size, format, and keep aspect ratio among other video options set in the MFCS form.
When an object is uploaded the following Image Tasks May need to take place.
Automatic Importing and Adjusting of MFCS data that was exported from MFCS old to use in the new MFCS.
This entails that imported data works perfectly and as expected in the new form builder so that if edited the item is modified correctly.
The allowed file types is a dynamic multiple fields that should store as an array in the JSON of the file field.
Form Builder Navigations need to be remade so users can create and modify a list of links to show beside the form. These links will be custom form. They need a way to be reordered and modified to link to a variety of forms. The person who modifies this will need to be responsible for making a list of evolving tasks.
Because drag and drop is not accessible(directly) may want to look at another way to sort the fields. However, GitHub does use it so maybe accessible methods can be added or multiple ways of doing it to keep from causing issues.
Drag and Drop Event Listener Research
Programming the Drag and Drop
Bugs Fixed:
The form was not rebuilding on a new/error or updated error of the form. We had to recall a method as json, instead of getting the field from the active record and parsing it to json.
System / Job Management
MFCS has a ton of scripts that maybe with MFCS or on the MFCS server that include backup, reprocessing, and other tasks.
Evaluate Scripts
Account for All Jobs
Rewrite Jobs
Form Builder is full of features and probably a little bloated, but we are trying to match exact functionality minus anything that is not actually being used.
Form Builder Features
The audio class needs to be similar to the video class but slightly modified.
Line 80 in d860ac5
Hey, I'm Camillo from CodeClimate, I'm reaching out about the ZenDesk ticket created here, and I would be glad to help with your issue.
I took a look at your failed job in CircleCI and I realized that you may be missing a setting in your yml.
The trick here is to set CC_TEST_REPORTER_ID
at the moment SimpleCov is being run, meaning setting for both bundle exec rake
and the CodeClimate action. (in your setting file you had it only in the latter)
As you can see in the simplecov ReadMe JSON formatter section, there is a comment explaining that SimpleCov will automatically use the JSON formatter along with the HTML formatter when the CC_TEST_REPORTER_ID
variable is present in the environment.
Newer versions need that JSON formatter to work. You may find more context about this in this comment.
Please let me know if this works for you
Currently, we have a TDD test suite for Rails and Ruby Modules, but nothing set up for behavioral tests and JavaScript related tests. Need to setup a capybara instance and a virtual chrome for doing JavaScript-based interaction tests. This will be a little bit of a learning curve for drag/drop, click, and other customized data inputs. It may also be a time-consuming process because of the number of possibilities for each form and field.
This is a brief summary of the frontend component work that has been done up to this point.
The process of creating MFCS has come down many roads and those choices mainly affect the frontend. The first of those being that we are using the new rails pipeline for delivering assets, which is essentially using a heavily modified webpack. Webpack is a very specific way of interacting with the JavaScript, CSS, and some HTML. In doing so we have our views which will have references to our frontend modules and hopefully reduce complexity and overhead in the app in future aspects.
Modules Completed
Alerts (CSS, JavaScript and HTML)
Breadcrumbs (CSS, JS, and HTML/ERB)
Buttons (CSS)
Events (JS)
Footer (CSS, JS, and HTML/ERB)
Form Builder (CSS, JS, and HTML/ERB)
Forms (CSS)
Header (CSS, JS, and HTML/ERB)
Home (CSS, JS, and HTML/ERB)
Login (CSS, JS, and HTML/ERB)
Main (CSS, JS, and HTML/ERB)
Top Bar (CSS, JS, and HTML/ERB)
Validation (CSS / JS)
Variable (CSS, JS, and HTML/ERB)
WVU Branding (CSS, JS, and HTML/ERB)
Responsibility for this class is to assume responsibility of checking file type and calling the proper conversion class after the type of the file has been checked.
API Version 1 is a mock-up of some API functionality that was needed for form building along with a few functions that were in the MFCS repo in a variety of places.
Case 1: In the includes folder there existed a series of JSON output files that were created by MFCS for use within the form builder. These essentially were PHP output files with no protection except for a script that allowed no view access off-campus.
Solution:
We needed a way to use this and be sure that only we can use this part of the application. I created a public API and a private API module and worked to get the information out safely and securely.
Public API Module
Private API Module
Controller for API
Routes and Namespacing
Queries and Documentation
Testing
The form builder is being worked on as an operation form element, in MFCS this is done in multiple PHP VIews, this logic needed to be abstracted to presenters and logical models.
In the new MFCS these have been abstracted out to Modules that fit somewhere between a Presenter and Actor.
--- More complicated Ones that need JS Hooks.
This is the model we are going to use to associate the files to items. The idea is to have this data in a few locations just in case because the previous system if this information was lost from the item it was not recoverable.
The file upload box needs to contain a variety of checks and balances for each possible upload. An example could be configurations for images, audio, video, etc. Each one will be different as per the type of upload box that is in the form.
This is mostly done, clips is a suggestion that isn't currently in MFCS, going to skip that for now since we have so much more work to do on this project.
We need to figure out a way to create a testing suite for the JavaScript side of things. Some of this should be covered by behavioral testing, but some need to be functional because of return values.
An active record model concern that can attach to all models for a modular way of checking if the system is in readonly mode before doing any actions that involve databases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.