SUSE-Enceladus / blue-horizon

web-based user interface to terraforming the public cloud
GNU General Public License v3.0
11 stars 8 forks source link

Add client side variables validation #161

Closed arbulu89 closed 4 years ago

arbulu89 commented 4 years ago

Implement client side variable validation using the pattern option:

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern

It adds 2 new options to configure the variables using the description entry;

[title:my variable title [pattern:[mypattern]:endpattern]

I have not found a better way to encapsulate the pattern option without the endpattern keyword, as the patterns might have several [] (even nested ones).

blue-horizon-validation

codecov[bot] commented 4 years ago

Codecov Report

Merging #161 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #161   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines          700       700           
=========================================
  Hits           700       700           
Impacted Files Coverage Δ
app/models/variable.rb 100.00% <100.00%> (ø)
app/controllers/variables_controller.rb 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 17091cc...e6f144f. Read the comment docs.

arbulu89 commented 4 years ago

Hi @bear454 ,

I have updated the keywords to something like [pattern:/my regex/]. It looks better and it still works fine