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

COMPASS-360: cancel empty validation rule #732

Merged
merged 2 commits into from Jan 6, 2017

Conversation

satyasinha
Copy link

No description provided.

@satyasinha satyasinha changed the title check editState differently if server validation doc is blank COMPASS-360: cancel empty validation rule Jan 5, 2017
@satyasinha
Copy link
Author

satyasinha commented Jan 5, 2017

This commit fixes the issue in the ticket but there are other problems in the zero state for the Validation tab. The examples below show that the undefined and Example collections both have the same state in the UI.
undefined json
example json

However, collectioninfo outputs for these collections via shell shows that they're not quite the same:
undefined vs example validation options

Should this be clearer to the user?

@samweaver-zz
Copy link

@KeyboardTsundoku just to check I understand: are you demonstrating here that a collection that doesn't have doc validation enabled appears the same in the UI as a collection that has it enabled with no rules?

@satyasinha
Copy link
Author

Yes, exactly!
Sorry it looks like I can't grammar and my wording should be a bit clearer, I'll fix that now.

@satyasinha
Copy link
Author

We can try something like this (with better styling) to represent blank option, maybe with a dash or completely blank option.
screen shot 2017-01-06 at 10 41 24 am

@samweaver-zz
Copy link

Something similar would work - but lets not worry about it too much for now, the amount of times someone will encounter this is small. Lets close this out and open a new ticket for making OFF vs ON with no rules easier to interpret.

if (!_.has(this.lastFetchedValidatorDoc, 'validationAction')
&& !_.has(this.lastFetchedValidatorDoc, 'validationLevel')
&& _.isEmpty(this.lastFetchedValidatorDoc.validator)) {
state.editState = _.isEqual(this.lastFetchedValidatorDoc.validator,
Copy link
Member

Choose a reason for hiding this comment

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

since we just confirmed that this.lastFetchedValidatorDoc.validator is empty in the line above, it would be easier to just check if validatorDoc.validator is also empty, rather than compare the two. Makes it more readable, too.

@satyasinha satyasinha force-pushed the COMPASS-360-cancel-empty-validation-rule branch from 8ffe819 to 1ddb062 Compare January 6, 2017 01:04
@rueckstiess
Copy link
Member

LGTM. Will address the minor issue of empty validator doc vs. no rules present when the issue comes up. I don't think in practice it makes a difference.

@rueckstiess rueckstiess merged commit 6eac632 into master Jan 6, 2017
@rueckstiess rueckstiess deleted the COMPASS-360-cancel-empty-validation-rule branch January 6, 2017 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants