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

Adding feature containsAny, containsAll, containsOnly, notContainsAny and notContainsAll in conditional options #874

Merged

Conversation

andressaabreuzup
Copy link
Contributor

Signed-off-by: Finzi andressa.abreu@zup.com.br
Issue: #858

Description

Adding feature containsAny, containsAll, containsOnly, notContainsAny and notContainsAll in conditional options

How to verify it

Create a formula with the new conditional options.

Example of a config.json with containsAny:

[
	{
		"name": "sample_multiselect",
		"type": "multiselect",
		"items": [
			"item_1",
			"item_2",
			"item_3",
			"item_4"
		],
		"label": "Choose one or more items: ",
		"required": false,
		"tutorial": "Select one or more items for this field."
	},
	{
		"name": "sample_text",
     	        "type": "text",
		"label": "Type : ",
		"default": "test",
		"condition": {
			"variable": "sample_multiselect",
			"operator": "containsAny",
			"value":    "item_2|item_3"
		}
	}
]

Changelog

Adding feature containsAny, containsAll, containsOnly, notContainsAny and notContainsAll in conditional options

… on conditional options

Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
@andressaabreuzup andressaabreuzup self-assigned this Feb 26, 2021
@andressaabreuzup andressaabreuzup added ✔️ ready-for-review ready for review ✨ feature Suggest a new feature or enhancement to the Ritchie project labels Feb 26, 2021
@andressaabreuzup andressaabreuzup linked an issue Feb 26, 2021 that may be closed by this pull request
1 task
@andressaabreuzup andressaabreuzup changed the title [858] Adding feature containsAny, containsAll, containsOnly, notContainsAny and notContainsAll in conditional options Adding feature containsAny, containsAll, containsOnly, notContainsAny and notContainsAll in conditional options Feb 26, 2021
@henriquemoraeszup henriquemoraeszup added this to the Community milestone Feb 26, 2021
pkg/formula/input/input.go Outdated Show resolved Hide resolved
pkg/formula/input/prompt/prompt_test.go Outdated Show resolved Hide resolved
pkg/formula/input/prompt/prompt_test.go Outdated Show resolved Hide resolved
pkg/formula/input/prompt/prompt_test.go Outdated Show resolved Hide resolved
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
@brunasilvazup brunasilvazup added the 📚 documentation Improvements or additions to documentation label Mar 2, 2021
@brunasilvazup brunasilvazup removed the ✔️ ready-for-review ready for review label Mar 3, 2021
@andressaabreuzup andressaabreuzup added the 🚧 WIP Work in Progress label Mar 3, 2021
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
@codecov-io
Copy link

Codecov Report

Merging #874 (f8272f4) into master (a1db972) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #874      +/-   ##
==========================================
+ Coverage   84.45%   84.46%   +0.01%     
==========================================
  Files         113      113              
  Lines        4034     4037       +3     
==========================================
+ Hits         3407     3410       +3     
  Misses        433      433              
  Partials      194      194              
Impacted Files Coverage Δ
pkg/formula/input/flag/flag.go 95.74% <100.00%> (+0.09%) ⬆️
pkg/formula/input/prompt/prompt.go 92.30% <100.00%> (+0.09%) ⬆️

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 a1db972...f8272f4. Read the comment docs.

@andressaabreuzup andressaabreuzup added ✔️ ready-for-review ready for review and removed 🚧 WIP Work in Progress labels Mar 11, 2021
@brunasilvazup brunasilvazup added waiting reply Waiting for an answer to a comment and removed ✔️ ready-for-review ready for review labels Mar 11, 2021
andressaabreuzup and others added 4 commits March 12, 2021 10:15
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
@andressaabreuzup andressaabreuzup added ✔️ ready-for-review ready for review and removed waiting reply Waiting for an answer to a comment labels Mar 15, 2021
pkg/formula/input/input.go Outdated Show resolved Hide resolved
pkg/formula/input/flag/flag.go Outdated Show resolved Hide resolved
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
Copy link
Contributor

@henriquemoraeszup henriquemoraeszup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, just a comment, but looks good 💯

pkg/formula/input/prompt/prompt_test.go Outdated Show resolved Hide resolved
pkg/formula/input/flag/flag.go Outdated Show resolved Hide resolved
brunasilvazup
brunasilvazup previously approved these changes Mar 16, 2021
Copy link
Contributor

@brunasilvazup brunasilvazup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some suggestions, but it's up to you.

Independent, great functionality, congratulations 👏 (:

@kaduartur
Copy link
Contributor

/merge qa

@ritchie-bot
Copy link
Contributor

ritchie-bot bot commented Mar 16, 2021

👌 Merged branch feature/adding-contains-conditional into qa

Signed-off-by: Finzi <andressa.abreu@zup.com.br>
pkg/formula/input/input.go Outdated Show resolved Hide resolved
pkg/formula/input/input.go Outdated Show resolved Hide resolved
pkg/formula/input/input.go Show resolved Hide resolved
pkg/formula/input/input.go Show resolved Hide resolved
pkg/formula/input/input.go Outdated Show resolved Hide resolved
pkg/formula/input/input.go Show resolved Hide resolved
Signed-off-by: Finzi <andressa.abreu@zup.com.br>
@kaduartur
Copy link
Contributor

/merge qa

@ritchie-bot
Copy link
Contributor

ritchie-bot bot commented Mar 17, 2021

👌 Merged branch feature/adding-contains-conditional into qa

Copy link
Contributor

@kaduartur kaduartur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@kaduartur kaduartur merged commit f0e6b60 into ZupIT:master Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 documentation Improvements or additions to documentation ✔️ ready-for-review ready for review ✨ 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 a "contains" operator to the conditional input (config.json file)
5 participants