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

fix: ensure "no flag" band always displays if no flags are present #3899

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Nov 1, 2024

Flagged here: https://opensystemslab.slack.com/archives/C01E3AC0C03/p1730462810086459

To recreate bug on staging/prod:

  • Add a question and assign flags to an option and another option without flags -> "create" -> color bands display as expected
  • Update that node and remove the flags from the option -> "update" -> no color band displays on updated option
    • Fix is to explicitly check for flags.length > 0 so that flags = [] doesn't evaluate to FlagBand option

@@ -46,9 +48,17 @@ const Option: React.FC<any> = (props) => {
imageAltText={props.data.text}
/>
)}
{flags ? flags.map((flag) => <FlagBand key={`${props.id}-${flag.value}`} flag={flag} />) : <NoFlagBand />}
{flags && flags.length > 0 ? (
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is the only logical change, otherwise linting !

@jessicamcinchak jessicamcinchak marked this pull request as ready for review November 1, 2024 14:02
@jessicamcinchak jessicamcinchak requested a review from a team November 1, 2024 14:02
Copy link

github-actions bot commented Nov 1, 2024

Removed vultr server and associated DNS entries

@jessicamcinchak jessicamcinchak merged commit 9546e09 into main Nov 1, 2024
12 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/fix-graph-flag-display branch November 1, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants