Here is a round up of the latest highlights from our repository that add improvements to Forem.
Editable Published Dates in Admin for Articles List
This PR adds functionality to posts by making published_at
an editable datetime select option in the admin side of articles.
Added published date as editable in admin articles list/show #11124
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
Adds post published_at
as an editable datetime select option in the admin side articles index/show views
Related Tickets & Documents
Closes #10871
QA Instructions, Screenshots, Recordings
#QA
Check out a published article in admin/articles list/show. Update the published_at date to something else and hit Submit
. Confirm it has changed
#Additional changes
- Because
published_at
is added as a rails datetime_select field to fulfil all kinds of datetime requirements, the #update logic in admin/articles controller had to be changed. The existing logic picked up individual values from permitted params, changing a few of them, before saving them But datetime select pushes params asparam(1i)
,param(2i)
and so on, which doesn't sit well with extracting params. It is custom made to work withmodel.create(permitted_params)
ormodel.update(permitted_params)
. Now, the code directly runsarticle.update(article_params)
for checking successful update - Because params are not cleaned up anymore, had to make sure all checkboxes return the correct boolean from the form. Converted all checkboxes to
rails form check_box fields
to ensure right matching to form object. - Only co author ids needs special treatment for conversion to array from comma joined string before saving. To ensure smooth input from the form without changing the UI, added a model attribute
co_author_ids_list
which acts as a form field, and then parses it back to array at model level instead of controller, before saving
Added tests?
- [x] Yes
- [ ] No, and this is why: please replace this line with details on why tests have not been included
- [ ] I need help with writing tests
Added to documentation?
- [ ] Docs.forem.com
- [ ] README
- [x] No documentation needed
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?
API Improvement for Organizations
This PR adds new API endpoints to get a list of an organization's users.
In the future we will also include an endpoint for an organization's articles and listings.
API: Endpoint to get an organization's users #11514
What type of PR is this? (check all applicable)
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
This would provide an api endpoint dev.to/api/organizations/{org_username}/users
to get a list of an organization's users.
As discussed in issue 9212, This is the 2nd of 4 related endpoints that will include:
dev.to/api/organizations/{org_username}/articles
dev.to/api/organizations/{org_username}/listings
Related Tickets & Documents
#9212 #10931
Added tests?
- [x] Yes
- [ ] No, and this is why: please replace this line with details on why tests have not been included
- [ ] I need help with writing tests
Added to documentation?
- [x] Developer Docs and/or Admin Guide
- [ ] README
- [ ] No documentation needed
Bug Fix and Optimization for Deploys
In the past when we deployed Forem Cloud we did not retain assets for old versions of the platform, and service workers did not seem to reliably retain the in-memory cached version of asset.
This caused flashes of unstyled content and a few other frontend issues for people.
This PR adds more static assets to help with the frontend issues while also adding functionality to periodically flush the component of the serviceworker cache to make sure we don't over-cache.
Include core assets in serviceworker cache #11559
What type of PR is this? (check all applicable)
- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [x] Optimization
- [ ] Documentation Update
Description
Currently when we deploy Forem Cloud we do not retain assets for old versions of the platform, and service workers do not seem to reliably retain the in-memory cached version of assets, so we sometimes get flashes of unstyled content and other frontend issues.
This adds more static assets to the serviceworker cache, and also adds functionality to periodically flush that component of the serviceworker cache to make sure we don't over-cache.
QA Instructions, Screenshots, Recordings
Things should continue to work as normal. If you open up the application tab of chrome tools and view Cache Storage you'll see static 1.2 cache including a bunch of assets.
Update Admin βBanβ and βSuspendβ Language for Clarity
This PR renames "ban" to "suspend" throughout the /admin/ space. In the past we used βbanβ and βbanishβ which caused some confusion.
Suspend more clearly implies a temporary nature.
You can see a full video walkthrough of the changes by one of our developers Arit Amana here.
[EOY 2020] Replace "ban" with "suspend" in Admin #11581
What type of PR is this? (check all applicable)
- [X] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
Renames "ban" to "suspend" throughout the /admin/
space.
closes https://github.com/forem/InternalProjectPlanning/issues/298
NOTE: ππ½
I stopped short of changing banned
and comment_banned
to suspended
and comment_suspended
(respectively) within app > models > role.rb
, as I am not sure how that move will affect current role assignments in production. I welcome feedback/corrections on my decision.
QA Instructions, Screenshots, Recordings
- Navigate to
localhost:xxxx/admin/users
as asuper_admin
role - Edit any user and give them either
Suspend
orComment Suspend
roles - Check that their show page reflects the role changes made
https://www.loom.com/share/6c764ef0ff724b8e8c73433681a2edf1
UI accessibility concerns?
Changes were made just to certain text, depending on the user's role; there are no UI accessibility concerns introduced, in my humble opinion
Added tests?
- [X] Yes, tests were modified according to code changes made
- [ ] No, and this is why:
- [ ] I need help with writing tests
Added to documentation?
- [X] Developer Docs and/or Admin Guide https://app.gitbook.com/@forem/s/forem-admin-guide/admin/users/user-roles
- [ ] README
- [ ] No documentation needed
[optional] Are there any post deployment tasks we need to perform?
None
[optional] What gif best describes this PR or how it makes you feel?
Initial Accessibility Fixes
Forem is working with Marcy Sutton to improve accessibility on DEV and Forem in general.
This PR includes some of the initial accessibility issues encountered upon setup and improves color contrast on the site.
Accessibility: initial onboarding fixes #11408
What type of PR is this? (check all applicable)
- [ ] Refactor
- [ ] Feature
- [X] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
This PR includes some of the initial accessibility issues I encountered upon setup. It primarily updates color contrast to pass WCAG 2.0 AA but there's also one bit of missing alt text. Additional accessibility items will be addressed in future PRs.
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
- Run the axe extension on DEV.to
- See the color contrast issues that come up
- Run axe again on this PR
- Compare it to the list of accessibility violations
Added tests?
- [ ] Yes
- [X] No, and this is why: Not applicable
- [ ] I need help with writing tests
Added to documentation?
- [ ] Developer Docs and/or Admin Guide
- [ ] README
- [X] No documentation needed
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?
Fix For FaceBook Login
This PR fixes a bug with Facebook Login where you can't create an account because the profile image download process fails.
Fix Facebook Login profile image download failure #11478
What type of PR is this? (check all applicable)
- [x] Bug Fix
Description
This fixes a bug with Facebook Login where you can't create an account because the profile image download process fails. The workaround is:
- Grab the user's Facebook UID and OAuth access token
- Request the photo directly via a separate call
- From that JSON response, grab the direct link to the requested profile image
- Pass along to Carrierwave to download as normal
Related Tickets & Documents
Closes https://github.com/forem/InternalProjectPlanning/issues/238
QA Instructions, Screenshots, Recordings
- Make a Facebook OAuth app https://docs.forem.com/backend/auth-facebook/
- Add your Facebook keys to your config
- Try to login via Facebook
- See that your user creates successfully
UI accessibility concerns?
Nope!
Added tests?
- [x] No, and this is why: it's hard to stub this, and I think this is more of an implementation detail
Added to documentation?
- [x] No documentation needed
[optional] Are there any post deployment tasks we need to perform?
Nope
[optional] What gif best describes this PR or how it makes you feel?
Improvement to Tag Mod Filtering
A Tag Mod pointed out that when filtering to their tag while in /mod
they were not seeing the latest posts there. This PR removes the score filter for articles to the moderator's article index so they can view all articles including showing the newest posts first. This will make it easier for Tag Mods to moderate their tags.
Bug Fix:Remove Score Filter From Tag Mod Index #11599
What type of PR is this? (check all applicable)
- [x] Bug Fix
Description
Remove score filter for articles for the moderator's article index so they can view all articles.
Related Tickets & Documents
Closes https://github.com/forem/tech-private/issues/420
Added tests?
- [x] No, they already exist
Top comments (2)
Loving these recaps!
Agree, they are great!