Skip to content

Sheetal - reddit auto poster frontend#4478

Open
sheetalmangate wants to merge 7 commits intodevelopmentfrom
sheetal-reddit-auto-poster-frontend
Open

Sheetal - reddit auto poster frontend#4478
sheetalmangate wants to merge 7 commits intodevelopmentfrom
sheetal-reddit-auto-poster-frontend

Conversation

@sheetalmangate
Copy link
Copy Markdown
Contributor

@sheetalmangate sheetalmangate commented Nov 30, 2025

Description

Implements the frontend interface for the Reddit Auto Poster feature. This update adds a basic UI for creating Reddit text and link posts, scheduling posts for future publication, and managing scheduled jobs (view and cancel). The component is currently placed under the Announcements section for testing purposes. This feature is not yet styled for production and is intended for internal review and testing only.

Related PRS (if any):

This frontend PR is related to the #1928 backend PR.
To test this backend PR you need to checkout the #1928 frontend PR.

Main changes explained:

  • Added Reddit tab under Announcement. To access Announcement go to option Other Links -> Send Emails.
  • Reddit Auto poster provides UI for 1) Submitting text or link post to Reddit 2) Schedule Reddit posts.
  • Schedule Reddit post provides the ability to create and/or upload content used to schedule posts 6 months in advance.
  • Post History display the list of all scheduled posts those are submitted.
  • Create Reddit App : use below URL to create reddit app and use your CLIENT_ID AND CLIENT_SECRET.
    https://www.reddit.com/prefs/apps
    -- While creating app in reddit use below link as redirect url
    http://localhost:5173/announcements/platforms/reddit/redirect

How to test:

  1. check into current branch
  2. add below environment variables in .env file
   REACT_APP_REDDIT_CLIENT_ID=YOUR_REDDIT_CLIENT_ID
   REACT_APP_REDDIT_CLIENT_SECRET=YOUR_REDDIT_CLIENT_SECRET
   REACT_APP_REDDIT_REDIRECT_URL="http://localhost:5173/announcements/platforms/reddit/redirect"
  1. do yarn install and yarn start:local to run this PR locally
  2. Clear site data/cache
  3. log as admin user
  4. go to Dashboard→ Other Links → Send Emails → Reddit.
  5. To submit scheduled post use end point api/autoposter/reddit/posts/action/auto-submit from postman

Screenshots or videos of changes:

Autoposter_work_flow.mp4

…odNetworkApp into sheetal-reddit-auto-poster-frontend

updating local branch
…odNetworkApp into sheetal-reddit-auto-poster-frontend

taking update from remote branch
…odNetworkApp into sheetal-reddit-auto-poster-frontend

updating local repo
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 30, 2025

Deploy Preview for highestgoodnetwork-dev failed.

Name Link
🔨 Latest commit e1a5959
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/692ba5209b809800083e9389

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Feb 8, 2026
Copy link
Copy Markdown

@naznin07 naznin07 left a comment

Choose a reason for hiding this comment

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

Missing dependency in useEffect.

PR # 4478

import SubmitPost from './SubmitPost';

export default function RedditPanel() {
const [hasToken, setHasToken] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Currently hasToken initializes as false, which means authenticated users will briefly see the "Connect to Reddit" button while the token validation request is in progress. Consider using null as a third state to represent loading, so nothing renders until the validation is complete.

const res = await axios.get(`${ENDPOINTS.AP_REDDIT_AUTH_TOKEN}`);
setHasToken(res.data.exists);
} catch (error) {
setHasToken(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Currently if the token validation request fails, the catch block silently sets hasToken to false, which means a network error looks exactly the same as "not connected" to the user. Worth adding a separate error state so we can show something more helpful in that case rather than just defaulting to the connect button.

@SharadhaKasiviswanathan
Copy link
Copy Markdown
Contributor

Tested the changes at http://localhost:5173 as an Owner. I can see the Reddit tab under Other Links -> Send Emails, but I'm unable to test the full functionality as Reddit is currently denying new 'API Access' registrations for developer apps. Without a CLIENT_ID, the tab remains in a persistent loading state. Any suggestions for an alternative way to test this without requiring individual Reddit API keys would be helpful.
Screenshot 2026-03-14 at 10 01 11 PM

@one-community one-community added Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it. do not review Do not review or look at code without full context and removed High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible labels Apr 5, 2026
@rajanidi1999
Copy link
Copy Markdown

rajanidi1999 commented Apr 11, 2026

Hi,
Screenshot 2026-04-11 025432

Screenshot 2026-04-11 030242

I tested the changes locally at http://localhost:5173 as an Owner and confirmed that the Reddit tab appears under Other Links → Send Emails. However, I couldn’t fully verify its functionality because Reddit is currently restricting new API access registrations, leaving the feature stuck in a loading state without a valid CLIENT_ID.
Additionally, the current error handling could be improved when token validation fails, network issues are treated the same as a missing connection, which may confuse users. Introducing a distinct error state would provide clearer feedback instead of defaulting to the connect button.

Copy link
Copy Markdown

@rajanidi1999 rajanidi1999 left a comment

Choose a reason for hiding this comment

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

I verified the Reddit tab appears correctly under Other Links → Send Emails, but full functionality couldn’t be tested due to Reddit API access restrictions (missing CLIENT_ID causes a persistent loading state). Additionally, the current error handling needs improvement network failures during token validation are treated the same as a “not connected” state, which can mislead users. A separate error state should be introduced to provide clearer feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants