docbrown/app/assets/javascripts
Jeremy Friesen 07983e38be
Adjusting conditional create post rendering (#17132)
* Revert "conditionally render create post button for admins #16490 (#16606)"

This reverts commit 1cb45995cb.

* Adding conditional create post rendering

This pull request does two things:

- Reverts the forem/forem#16606
- Replaces the conditional rendering with the approach from forem/forem#17076

What to consider:

- How does this impact Cumulative Layout Shift (CLS).  Prior to this
  commit, we didn't "flicker" the "Create Post" button into view if the
  site didn't have the conditional.
- In reverting forem/forem#16606 we remove a dependency on Turbo.
- We reduce one network call, relying instead on the async_info to carry
  the visible/hidden logic.

If the "flicker" is a problem we could add a conditional in the page for
if the site has enabled that feature.  However, that's a place holder as
we're looking at possible other reasons for allowing/disabling the
create a post.

This is a non-blocking PR, as in we can merge or not merge this and
proceed with what we have.  Instead the main goal is to "unify" our approach.

* Update cypress/integration/seededFlows/policyFlows/limitPostCreationToAdmins.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Leveraging change from forem/forem#17143

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-07 09:11:37 -04:00
..
initializers Implement new color picker in listings category form, cleanup old code (#16770) 2022-03-08 12:43:18 +00:00
lib pullToRefresh adjustments - fixing scrolling hijacking (#15644) 2021-12-02 17:00:02 +01:00
utilities Fix error in feed follow buttons where user name has apostrophe (#16758) 2022-03-02 15:53:48 -05:00
.eslintrc.js Use a single listener for all follow buttons on a page (#14246) 2021-07-27 10:45:50 +01:00
base.js.erb Adjusting conditional create post rendering (#17132) 2022-04-07 09:11:37 -04:00
initializePage.js Implement new color picker in listings category form, cleanup old code (#16770) 2022-03-08 12:43:18 +00:00
jquery_s3_upload.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00