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

✨ Add operators documentation for response field components. #1387

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions apps/docs/editor/blocks/logic/condition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,62 @@ A condition can contain different comparisons that are evaluated in order and li
className="absolute top-0 left-0 w-full h-full"
/>
</div>

## Operators

<ResponseField name="Equal to">
Will match if the provided value is strictly equal to the value.
</ResponseField>

<ResponseField name="Not equal">
Will match if the provided value is not equal to the value.
</ResponseField>

<ResponseField name="Contains">
Will match if the provided value contains the value. If a list is provided, it
will match if the list has at least one element in common with the value.
</ResponseField>

<ResponseField name="Does not contain">
Same as `Contains` but will match the inverse.
</ResponseField>

<ResponseField name="Greater than">
Will match if the provided value is greater or equal than the value.
</ResponseField>

<ResponseField name="Less than">
Will match if the provided value is less or equal than the value.
</ResponseField>

<ResponseField name="Is set">
Will match if the provided value is not null or undefined and not an empty
string.
</ResponseField>

<ResponseField name="Is empty">
Will match if the provided value is null, undefined, or an empty string.
</ResponseField>

<ResponseField name="Starts with">
Will match if the provided value starts with the value.
</ResponseField>

<ResponseField name="Ends with">
Will match if the provided value ends with the value.
</ResponseField>

<ResponseField name="Matches regex">
Value should start and end with `/` and contain a valid regex pattern.

Example:

- `/^hello$/` will match if the string is strictly equal to "hello".
- `/hello/` will match if the string contains "hello". Like "hello world".

</ResponseField>

<ResponseField name="Does not match regex">
Same as `Matches regex` but will match if the provided value does not match
the regex pattern.
</ResponseField>