Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Add required field to Input struct #551

Merged
merged 2 commits into from
Sep 23, 2020
Merged

Add required field to Input struct #551

merged 2 commits into from
Sep 23, 2020

Conversation

kaduartur
Copy link
Contributor

- What I did
I added the new field required of type boolean to Input struct to validate if the field can be optional

- How to verify it
Add the new field required to a config.json.
Example:

[
    {
        "name": "sample_text_2",
        "type": "text",
        "label": "Type : ",
	"required": true
    }
]

- Description for the changelog
New field to config.json required

Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
Signed-off-by: Kadu Artur Prussek <kadu.artur@gmail.com>
@kaduartur kaduartur added ✨ feature Suggest a new feature or enhancement to the Ritchie project ✔️ ready-for-review ready for review labels Sep 23, 2020
@kaduartur kaduartur self-assigned this Sep 23, 2020
@kaduartur kaduartur linked an issue Sep 23, 2020 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Merging #551 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #551      +/-   ##
==========================================
+ Coverage   78.60%   78.62%   +0.02%     
==========================================
  Files          98       98              
  Lines        3179     3182       +3     
==========================================
+ Hits         2499     2502       +3     
  Misses        496      496              
  Partials      184      184              
Impacted Files Coverage Δ
pkg/formula/formula.go 85.71% <ø> (ø)
pkg/formula/runner/inputs.go 98.06% <100.00%> (+0.03%) ⬆️

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 77c293e...8d67554. Read the comment docs.

@GuillaumeFalourd
Copy link
Contributor

Will it still be necessary to check the value inside the formula @kaduartur ?

What I mean is: if the input is coded as "required":false and the user doesn't inform any value, the local variable with the input name will be set empty, or it won't be set ?

@kaduartur
Copy link
Contributor Author

Will it still is necessary to check the value inside the formula @kaduartur ?

What I mean is: if the input is coded as "required": false and the user doesn't inform any value, the local variable with the input name will be set empty, or it won't be set?

@GuillaumeFalourd the environment variable that represents the field will be sent empty to formula

@kaduartur
Copy link
Contributor Author

/merge qa

@ritchie-bot
Copy link
Contributor

ritchie-bot bot commented Sep 23, 2020

👌 Merged branch feature/required_field into qa

@kaduartur kaduartur added 🚀 QA and removed ✔️ ready-for-review ready for review labels Sep 23, 2020
@kaduartur kaduartur merged commit 14f3466 into ZupIT:master Sep 23, 2020
@kaduartur kaduartur deleted the feature/required_field branch September 23, 2020 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ feature Suggest a new feature or enhancement to the Ritchie project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add field to set if the Input is Optional or Required
4 participants