Commit graph

65 commits

Author SHA1 Message Date
Mac Siri
afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00
Daniel M Brasil
212ddf0265
Fix: prevent users from changing the author when a post is part of a post series (#20259)
* disable authors and co-authors selectors for series posts

* add translations

* fix constrant issues

* add alternative text for icon

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-10-25 17:39:58 +03:00
Joshua Wehner
6fe9d7d7a6
Allow org admins to add members as co-authors (#20008)
* Basics might be working?

* Stop propagating button clicks in autocomplete pills

* Better blank slate

* Better location to stop propagation

* Remove author_id from org co-authors

* Move UserStore and try testing it

* Remove extraneous comments

* OH... that's what that does!

* Very basic testing

* Re-organize javascripts

* Rename & re-org for testing

* Cleanup

* More tests

* Remove unnecessary nesting

* Coninuing to try to bump coverage

* Include /packs/ in code coverage metric

* Try tweaking jest coverage more?

We probably can't collect coverage from all of packs/* (because coverage is too low) but maybe we can try to opt-in for newer areas as we go?

* Relocate JS tests, for build & coverage

* User ID exception on search, not fetch

* Remove commented-out console.log

---------

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-09-15 08:12:41 -04:00
Ben Halpern
ec7adf56fe
Allow admins to set cover image height configs (#19936)
* Initial basic work

* Bulk of related work, including find/replace on the inputs

* Adjust some tests

* Adjust some specs

* Fix a few more tests

* Clean up tests

* Adjust tests

* Test fiddle

* Adjust crop back to be a param

* Update tests

* Set proper defaults

* Fix some styling

* Adjust enrichment logic and tests

* Adjust form JS

* Update test snapshot

* Clean up formatting

* Fix spec name

* Adjust some css and defaults

* Adjust translation for image provider options

* Switch from fill to fill-down

* Proper fallback image

* Fix tests

* Update app/services/images/optimizer.rb

Co-authored-by: Mac Siri <mac@forem.com>

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-08-21 13:25:16 -04:00
Ridhwana
16f678cebd
feat: move the initializer to a pack file (#19279) 2023-03-31 15:33:41 +02:00
Jeremy Friesen
e2618c50f5
Adding logic to hide Create Post on empty dashboard (#17149)
* Adding logic to hide Create Post on empty dashboard

As implemented, folks won't see this page if they can't create a post.
However, as our implementation drifts, we should continue to apply the
same policy.

See forem/forem#16999 for the conditional logic that redirects users.

* Adding a hack to fix a unit test
2022-04-11 13:52:35 -04:00
yheuhtozr
e88d1adb47
views/dashboards i18n (#15069)
* views/dashboards etc i18n

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update index.html.erb

* Update index.html.erb

* Update _dashboard_article.html.erb

* Update subscriptions.html.erb

* Update dashboard_spec.rb

* Update _actions.html.erb
2021-11-29 07:19:16 -07:00
ludwiczakpawel
88a3b573ea
Page headers unified (#15158)
* fix; remove the bottom 100%

* dashboard

* fixes + magic border-radius

* everything

* fix

* fix

* spec

* split PRs

* Update app/assets/stylesheets/views/listings.scss

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2021-10-25 21:41:29 +02:00
Bervianto Leo Pratama
acbda16b8a
Translate some texts from Dashboard Page (#14963)
* Extract some text from dashboard

* Fix template code

Signed-off-by: Bervianto Leo Pratama <bervianto.leo@gmail.com>

* Update translation for upload_a_video

* Fix wrong link

* Fix missing keys

* Seperate plural posts & followers
2021-10-08 13:55:21 +02:00
Mohamed Asan N
cceb175d5d
Use section instead of header in dashboard pages (#14873)
* Use section instead of header

* Trigger Build

* Move section inside main

* Fix test case

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2021-10-06 17:12:43 +02:00
zeotuan
989bc21b3f
Fix inappropriate landmark nesting dashboard 10873 (#14308)
* change dashboard landmark nesting

* switch to main db/schema.rb

* remove unnecessary div

* revert scema.rb to main

* fix user_visits_dashboard test

* change aside to nav, put nav back into main-content

* remove unnecessary file

* remove duplicate nav

* add id to main

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-07-27 16:03:59 -05:00
Suzanne Aitchison
be15f31122
Optimise dropdowns for accessibility: Dashboard and Manage pages (#13909)
* use dropdownutils in dashboard and manage pages

* add tests for the toggle menu on dashboard

* add test for archiving from manage post view

* small tweak to avoid unhandled errors

* small tweaks to form methods
2021-06-04 10:19:56 +01:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Michael Kohl
111b7316d9
Remove mascot footer image (#13642)
* Remove footer mascot image

* Move remaining mascot settings back to SiteConfig

* Add data update script

* Update usages

* Fix path

* Remove dead route

* Update tests

* Fix view and spec

* Fix e2e test

* Fix DUS
2021-05-11 13:55:18 +02:00
Michael Kohl
f2f5e911cf
Add Settings::Mascot (#13451)
* Add Settings::Mascot

* Add DUS

* Update usage

* Fix e2e test and controller

* Fix specs

* Fix remaining spec
2021-04-26 11:39:19 +07:00
Suzanne Aitchison
e382a086bc
Add skip link functionality to dashboard pages (#13115)
* add skip link functionality to dashboard pages

* add skip link to listings dashboard

* add missed follow users dashboard
2021-03-25 09:45:01 +01:00
Mac Siri
30fa3b79a3
Default to Imgproxy on Forem-cloud (#10819) 2020-10-14 12:54:59 -04:00
ludwiczakpawel
bf8e2e53f1
Titles & subtitles cleanup (#10508)
* .

* .

* .
2020-10-02 12:37:39 +02:00
Mac Siri
b5be5990e4
[deploy] Expand Images::Optimizer to support imgproxy (#9909)
* Create _comment.html.erb spec

* Add imgproxy.rb

* Setup imgproxy MVP

* Expand Images::Optimizer to support imgproxy

* Enable imgproxy in dashboards/show WIP

* Create view spec

* Fix typo

* Also check for Imgproxy.config.endpoint

* Use ApplicationConfig instead of ENV

* Update Images::Optimizer#call
2020-08-25 16:00:40 -04:00
Mac Siri
a081810946
[deploy] Migrate ImageResizer to Images::Optimizer (#9720) 2020-08-14 09:44:30 -04:00
rhymes
b94dea9b70
Upgrade erb_lint to support latest Rubocop and fix violations (#9663)
* Upgrade erb_lint to support latest Rubocop and fix violations

* Wrong template name
2020-08-07 15:36:48 +02:00
Michael Kohl
fb27f52ed0
[deploy] Display banner if site hasn't been configured (PRE DEPLOYMENT TASKS) (#8435) 2020-07-07 07:37:04 -05:00
Michael Kohl
25622fa1ff
Show org dropdown for postless users (#9069)
* Show org dropdown for postless users

* sorting and gap

* Fix typo

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2020-07-02 14:46:20 +02:00
ludwiczakpawel
c9c88c7cc1
[deploy] Dashboard updates (#8879)
* flare tag line height

* .

* .

* .

* .

* specs

* spec

* .

* init

* .

* .

* js refactor

* js

* update spec

* Fix infinite scroll

* typo

* move IF

* pro analytics link fix

* Clean up tests

* Refactor adding of html

Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-06-25 13:10:17 -04:00
rhymes
9cdd03f0dc
Fix typo in dashboard sort element (#8875) 2020-06-24 08:03:27 -04:00
Ben Halpern
2219366af6
[deploy] Paginate /dashboard posts (#8868)
* Paginate /dashboard

* Fix awkward pagination
2020-06-23 17:29:24 -04:00
ludwiczakpawel
8c83aa3365
Table component & Dashboard update (#8778)
* flare tag line height

* .

* .

* .

* .

* specs

* spec

* .

* spec
2020-06-22 18:47:17 +02:00
Jacob Herrington
ad9c7797ec
Fix accessibility warnings from axe (#8718) 2020-06-17 10:48:38 +02:00
Ben Halpern
3c840610a1
[deploy] Remove unnecessary bulk from image assets (#8306)
* Remove unnecessary bulk from image assets

* Swap background-image

* Fix test

* Fix test
2020-06-05 17:51:06 -04:00
Mario See
fda048dc12 Listing Drafts and Deletion (#3540)
* wip init handle draft class and styling

* add draft button

* start splitting up listing row into multile files

* separate tag links

* split location

* fix location

* separate listing row action buttons

* update listing row proptypes to describe listing object

* contact via connect to jsx

* fix default checked

* init draft creation and first publish charge

* fix first publish logic and credit charging

* handle drafts in dashboard filtering

* adjust isDraft bool statement

* hide drafts from main listings feed

* fix expired and draft bools in listing row

* adjust create listing org credits

* internally handle drafts

* adjust listing row

* break down update method

* remove unnecessary logic and shorten lines

* fix logic again woops

* convert input hidden value + submit into one form button submit with corresponding name and value

also adds clear message that drafts do not cost credits

* handle insufficient org credits on first publish

- uses user credits to publish
- similar to bump implementation

* fix sorting for personal and all orgs

* space out some elements

* don't spend original users credit for them

* add delete buttons and delete_confirm and destroy methods

* remove notification removal since listings dont trigger notifications

* move draft message and add draft_params to tests

* Update classified_listings_controller.rb

* update tests

* update snapshot

* add del tests

* add guard preventing free draft publish

* fix draft filter

* update from master and resolve merge conflict in listing preact

* Revert "update from master and resolve merge conflict in listing preact"

This reverts commit 0a34fccf334a2ca0902644b486cb26ead6bef664.

* update column spec

instead of setting and saving

* separate two expectations into their own tests

* split more tests into single expectations

* change to unless bumped_at? instead of if nil

* Fix listing draft edge cases and styling

* Add title tags to listings pages
2019-09-01 13:54:54 -04:00
Ben Halpern
119d0f69d6
Finalize multi-org features (#3041)
* Finalize multi-org features

* Fix credits count issues

* Only show org list if multiple orgs on dashboard

* Add check for organizations to JS
2019-06-04 13:56:22 -04:00
Andy Zhao
47d9ec27fb Allow users to belong to multiple orgs (#2583)
* Allow user to have many orgs

* Allow users to handle multi orgs in settings

* Make rounded buttons inline

* Add multi org function to dashboards

* Fix merge conflicts

* Fix mistake in merge conflict fix oops

* Display the correct membership level

* Fix accessibility issues

* Display organizations for article editors

* Handle submitting org id with preact editors

* Make listings work with multiple organizations

* Allow listings to have multiple orgs on create

* Display the correct number of credits for each org

* Move script tag to Webpack

* Allow multi orgs for purchasing and viewing credits

* Use OrganizationMembership as authorization check

* Display multiple organizations for notifications

* Allow dashboard to be viewable under multi-orgs

* Remove unused method

* Add multi-org functionality for article editors

* Show pro dashboard buttons for member+ org levels

* Leave the correct organization

* Allow article API to change org id

* Add left-out authorization method oops

* Make nav buttons a bit more clear

* Fix merge conflict

* Fix adding org id for /api/articles and tests

* Fix tests for org policy

* Use proper logic for displaying org members

* Update org actions with new authorization

* Use correct org when creating a listing

* Remove additional payment charge oops

* Mark org notifications as read with authorization

* Remove deprecated post_as_organization attribute

* Use new org_admin syntax

* Remove deprecated org logic for article create and update

* Default all RSS posts to not belong to any org

* Render org_member page for guest users

* Update org policy spec to work with multi orgs

* Use org_membership for org traits and move identity code

* Use org_member trait

* Update to work with multi-orgs

* Validate article's org_id if param org_id is blank

* Make  a let variable

* Remove unnecessary eager load for credits

* Fix HTML structure and org logic for non-org users

* Update credits spec for multi-org

* Add test for failed payment when purchased by org

* Lint listings_spec

* Test that the listing was created under the user

* Add tests for POST /listings multi-org

* Use double quotes for classes

* Fix /manage and a few other multi-org bugs

* Fix test for multi org

* Use correct method SQL exists? not Rails exist?

* Fix reads spec for multi-org

* Fix org_controller actions to work with multi org

* Test only multi org and not old usage and fix leave_org

* Fix org showing user profile img test for multi-org

* Fix org logic for users with no orgs

* Remove switch org functionality

* Update tests and add hidden param for org id

* Redirect to the specific organization

* Test other org button actions

* Use settings_notice instead of legacy notice and refactor

* Fix weird extra end issue prob from merge conflicts

* Test for with new flash key

* Fix user_views_org tests for multi-org

* Test for new flash message

* Update snapshot with new a11y html

* Move styling to stylesheet

* Add site admins functionality

* Move org_member? method in user model and refactor

* Use unspent_credits_count for organizations

* Add tests for /listings/new and minor bug fixes

* Use .present? in case of empty array

* Fix a lingering deprecated method

* Use greater than 1 for random numbers

* Add tests for counting spent and unspent credits
2019-06-04 09:30:52 -04:00
rhymes
6a626e819d Refactor: fix issues raised by bullet (#2965)
* Preload organization, not user

* Preload users only when needed

* Pre-load podcasts for podcast episodes in API

* Avoid eager loading error by loading rating votes separately

* Preload associations for moderation

* Preload user comments in trees

* Preload organization for non org dashboard and cleanup queries

* Optimize ArticleSuggester to only load N articles at need

* Remove eager loading and pass variables to partials for easier debug

* Reorganize tags validation code and ignore actsastaggableon eager loading issues

* Remove unused eager loading and bring up comments relation

* Preload podcasts when loading podcast episodes

* Fix views specs

* Make sure ArticleSuggester never returns duplicates

* Remove commented code

* Re-trigger build

* Move suggested articles back to view to respect fragment caching
2019-05-28 17:32:53 -04:00
Dana Scheider
b2a8f69f83 Allow archiving of posts (#2798)
* This commit adds the "archived" attribute to the Article model, which will
enable users to automatically filter archived articles/drafts from appearing
on their dashboard. It also adds an ellipsis menu with a link to archive the
article. I've also moved the Mute Notifications button into the ellipsis menu
as well.

* Add ellipsis menu and make it work

* Fix logic error

* Hide ellipsis menus when you click elsewhere on the body

* Extract function to remove duplication

* Ensure that menu is hidden when the ellipsis button is clicked on an open menu

* Ensure that archiving post button works and that 'archived' param is accepted by the controller

* Enable link to toggle showing/hiding archived articles

* Make 'mute' and 'archive' buttons in ellipsis dropdown list work

* Refactor to make Code Climate happy

* Minor JS refactors
2019-05-13 15:40:52 -04:00
rhymes
e626002260 Add alternative texts to images (#2771) [ci skip] 2019-05-09 11:16:03 -04:00
Ben Halpern
158f56bc9d
Add page for users to "manage" their posts after publication (distribution, etc.) (#2627)
* Set up basic /manage route

* Add basic article manage page

* Add tips and finalize permissions for /manage

* Add final test and add manage button to article show

* Update failing specs
2019-05-01 09:00:09 -04:00
Mohammadjavad Raadi
c4f177c72f Fixes Dashboard UI Positioning Bug #2506 (#2522)
* Removed clear fix div
* Removed floating properties
* Added Flexbox properties to parent container
* Added media queries for screens smaller than 426px and adjusting styles accordingly
* Stretched and centered `upload a video` & `sort` select. Tested on Chrome and Firefox.
* Adjust `sort` select box's font-family according to other elements.
2019-04-24 18:16:14 -04:00
Ben Halpern
4b1b137c0f
Fix/augment dashboard and article view count issues (#2449) 2019-04-15 10:24:38 -04:00
Andrew Brown
1168b926c7 be able to sort dashboard articles (#1837) (#2337)
* be able to sort dashboard articles (#1837)

* remember to escape order clause is arel (#1837)

* add back in missing character for created_at (#1837)

* use case statement to avoid threat of injection (#1837)

* write specs to ensure sorting works for dashboard articles (#1837)

* add publish sort options, refactor sort options into articles helper (#1837)

* refactor to use model scope (#1837)
2019-04-15 08:30:09 -04:00
Tim Lange
6daec136bf UX: Fix draft in nightmode (#2382) 2019-04-12 10:30:42 -04:00
Filip Defar
512c9ee8a0 Extract "followers" action from "show" in DashboardsController (#2270) 2019-04-01 18:43:44 -04:00
Filip Defar
7a3b16c1e5 Extract "following" action from "show" in DashboardsController (#2212) 2019-03-27 17:03:53 -04:00
Filip Defar
88fc2a66d3 Remove /dashboard/following_users route (#2191) 2019-03-25 14:49:09 -04:00
Andy Zhao
1b4c50574a Update pro dashboard permissions for organization members (#2173) 2019-03-22 12:40:31 -04:00
Filip Defar
937bc63bbb Add list of followed organizations to dashboard (#2157) 2019-03-21 15:16:23 -04:00
Andy Zhao
8a3d3ae765 Enable Org Pro Dashboard View (#2060) 2019-03-18 11:58:44 -04:00
rhymes
6a9b97b30d Use numerical input for tags points (#2057) 2019-03-13 15:34:37 -04:00
Andy Zhao
be8e139e3e Fix charts and add nav buttons (#2044)
* Add navigation links for pro dashboard

* Move styles to stylesheet

* Use the correct dates for charts
2019-03-12 13:31:00 -07:00
Glenn Carremans
323c6628ca Fix linting issues in app/views/dashboards (#1854) [ci skip] 2019-02-26 17:38:23 -05:00
Ben Halpern
bce0b4fff6
Remove harsh video restriction and add video duration (#1811)
* Remove harsh video restriction and add video duration

* Fix video meta data and tests

* Modify video tests

* Rescue video duration fetch error

* Change log to puts in test
2019-02-16 17:42:44 -04:00