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 Nested Anchor Tags #1397

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Fix Nested Anchor Tags #1397

merged 1 commit into from
Mar 4, 2024

Conversation

adamgall
Copy link
Member

@adamgall adamgall commented Mar 1, 2024

Closes #1396

The ProposalAction buttons, which show up in proposal list cards, no longer needs to be a link.

Testing:

On dev load up any DAO that has proposals. Notice that when the proposal list populates, there's an error in the console talking about how nested anchor tags are not allowed.

Then do the same on this branch, and notice how that error does not appear.

@mudrila I would love your eyes on this, specifically. There are three files where the ProposalAction component is instantiated:

  • src/components/Activity/ActivityGovernance.tsx
  • src/components/Proposals/AzoriusDetails/index.tsx
  • src/components/Proposals/SnapshotProposalDetails/index.tsx

The first file, ActivityGovernance.tsx is the proposal card that shows up on the DAO Home and Proposals pages. That seems good.

But I'm not sure about these other two files. It seems like AzoriusDetails and SnapshotProposalDetails are both the actual details pages for the various types of proposals. The ProposalAction button, in these pages, is being used to display the various "Vote" buttons, when those are relevant? So I probably don't want to just straight up disable their links, as I'm doing in this PR?

I'm thinking that's the case, just want to get your take on it.

@adamgall adamgall requested review from mudrila and Da-Colon March 1, 2024 22:15
@adamgall adamgall self-assigned this Mar 1, 2024
Copy link

netlify bot commented Mar 1, 2024

Deploy Preview for fractal-framework-dev ready!

Name Link
🔨 Latest commit 3bc074c
🔍 Latest deploy log https://app.netlify.com/sites/fractal-framework-dev/deploys/65e253925881620008eb4668
😎 Deploy Preview https://deploy-preview-1397.app.dev.fractalframework.xyz
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@adamgall adamgall linked an issue Mar 1, 2024 that may be closed by this pull request
Copy link
Contributor

@mudrila mudrila left a comment

Choose a reason for hiding this comment

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

Looks good for me, sir!

{t('details')}
</Button>
);
return <Button variant="secondary">{t('details')}</Button>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Effectively, this expandedView thingy says that ProposalAction is used within actual details page, where we need not only button but like exact components with hooks and logic. So this specific button supposed to be shown only on the list. That being said - this change looks good

</Button>
</Link>
);
return <Button variant={showActionButton && canVote ? 'primary' : 'secondary'}>{label}</Button>;
Copy link
Contributor

Choose a reason for hiding this comment

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

The code is supposed to get to this return statement only while rendering ProposalAction in the proposals list - so this change looks good for me

@adamgall adamgall requested a review from tomstuart123 March 4, 2024 19:03
@adamgall
Copy link
Member Author

adamgall commented Mar 4, 2024

Thank you for the review @mudrila !

@tomstuart123 @Da-Colon when you get a chance, please :)

Given that @mudrila said this implementation looks good, I just went ahead and tested more thoroughly. The issues that I though would pop up, didn't! So yeah, this seems good to go from my end as well.

The things to test:

  • No console errors on the Proposals List page complaining of nested anchor tags.
  • Clicking the various Vote buttons within the Proposal Details page do what they're supposed to do.

Copy link
Contributor

@Da-Colon Da-Colon left a comment

Choose a reason for hiding this comment

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

Nicely done 👍

@adamgall adamgall merged commit 78cf343 into develop Mar 4, 2024
5 checks passed
@adamgall adamgall deleted the bug/#1396-nested-anchor-tags branch March 4, 2024 22:22
@adamgall adamgall mentioned this pull request Mar 7, 2024
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.

Browser complaining about nested anchor tags on Proposal List page
3 participants