-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add warning in inactive step block for mismatched options
- Loading branch information
1 parent
48f11b3
commit cd83b7f
Showing
3 changed files
with
37 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const checkMissingElement = (actual: string[], expected: Set<string>) => { | ||
return actual.some((option) => !expected.has(option)) | ||
} | ||
|
||
export const checkIsOptionsMismatched = ( | ||
optionsToRecipientsMapOptions: string[], | ||
selectedConditionalFieldOptions: string[], | ||
) => { | ||
return ( | ||
checkMissingElement( | ||
optionsToRecipientsMapOptions, | ||
new Set<string>(selectedConditionalFieldOptions), | ||
) || | ||
checkMissingElement( | ||
selectedConditionalFieldOptions, | ||
new Set<string>(optionsToRecipientsMapOptions), | ||
) | ||
) | ||
} |