Repository navigation
Purav takeover- collaboration ads creation page (clean re-port onto development) - #5629
pixelpix13 wants to merge 10 commits into
Conversation
Add Job Ads Creation, Job Details, and Apply Link screens with questionnaire follow-ups (hide degree major, Submit now, technology years/full-time). Co-authored-by: Cursor <cursoragent@cursor.com>
- Introduced new routes for job ads creation, job details, and job application links. - Implemented actions and reducer for managing collaboration ads state. - Created components for job ads creation, job details, and job application. - Enhanced collaboration component to handle job categories and image URLs. - Updated styles for new components and improved existing styles for better layout. - Added validation for Dropbox image URLs and document uploads. - Integrated permission checks for creating collaboration job ads.
- Updated the Job Ads Creation route to restrict access to users with 'Owner' and 'Administrator' roles. - Simplified permission checks in the Job Ads Creation component by removing unnecessary asynchronous permission checks. - Added a new dropdown item in the Header for Job Ads Creation, visible only to authorized roles. - Improved the description in Permissions.json to clarify the purpose of the 'createCollabJobAds' permission. - Ensured ProtectedRoute component enforces role-based access control for protected routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
vidiyala99
left a comment
There was a problem hiding this comment.
Tested 3e7fb9e with backend OneCommunityGlobal/HGNRest#2385 (070055f) as Administrator on a test server, in light and dark mode. The create request was blocked in the browser, so no job ad was written to the shared dev database.
What works:
- Tests: the Collaboration suites pass (9 files, 89/89), and #2385's suites pass on the same server (
collaborationController.collabAds,jobsController,jobs.preValidate,middleware.jobforms: 4 suites, 57/57). - Navigation and access: "Job Ads Creation" appears under Other Links for an Administrator and opens
/jobAdsCreation. - Form: choosing a category loads its positions (Administrative & Support: Administrative Assistant, Fundraising-outreach Help), the four editors, Image URL, the fixed "remote" location and the Apply Link list (42 job forms) all work, and validation stops the submit with a clear message per field. With everything filled in, Submit sends
POST /api/jobswith title, category, description, requirements, projects, ourCommunity, imageUrl, location and applyLink. - Dark mode: labels, selects and editors are readable (screenshot 2).
-
A failed save wipes the whole form.
createCollaborationAdscatches its own error (it only shows the toast) and never rethrows, sosubmitJobAdsalways runssetFormData({ ...initialState }), success or not. When I made the create request fail, the toast said "Error updating the details. Please try again." and every field was cleared: category, title, all four editors, image URL and apply link (screenshot 1). An admin who just wrote 30+ words in each of three editors loses all of it on any server or network error. Rethrowing from the action (or returning a success flag) and resetting only on success would fix it. -
The description error message says "characters" but the rule counts words.
validateJobAdsFormchecksgetWordCount(description) < 30but the message is "Description must be at least 30 characters long", so a 200-character, 25-word description gets a confusing error. The other three fields correctly say "words". -
Design note: the Apply Link option value is the backend address
${APIEndpoint}/jobforms/<id>(on this serverhttp://localhost:4500/api/jobforms/692231d7bcba075ed0de3991), and the detail/apply pages later split it onjobforms/to get the id. Saving just the form id (or a frontend route) would keep the stored ads independent of which environment created them.
Requesting changes for item 1.
Screenshot 1: the form after a failed save (every field cleared)
Screenshot 2: Collaboration Ads Creation in dark mode
RichaSapre
left a comment
There was a problem hiding this comment.
I reviewed the collaboration job-ad creation flow, role-based routing, validation, dark mode, and listing updates. Most functionality works as expected.
I found that a failed create request clears the entire form because the form resets after dispatch regardless of whether the API call succeeds. The form should reset only after a confirmed successful submission.
I also found that the description validation checks for 30 words but displays an error stating “30 characters.”
|



Description
Clean re-port of the collaboration job ads creation frontend onto latest
development. This supersedes the older/conflicted frontend work on #4307 by rebuilding the feature-scoped changes cleanly (not continuing the old messy merge history).Adds Admin/Owner job-ad creation UI, job details and apply-link pages, collaboration listing image/category fixes, and the
createCollabJobAdspermission entry.Pair with backend: HGNRest#2385 (
manoj-collaboration-ads-creation-pageon HGNRest). Check out both branches together for end-to-end create ���� list ���� details ���� apply flows (Dropbox upload + application email need the backend PR env vars).Related PRS (if any):
Main changes explained:
/jobAdsCreation) ���� New form to create collaboration job ads (category, position, description, projects, requirements, Our Community, Dropbox image URL, apply-link / job form). Protected route: Owner and Administrator only.createCollabJobAds���� Added toPermissions.json/ route permissions (intended for Owner/Administrator)./jobDetailsLink/:id) ���� Dev/test route only (renders saved ad fields + form questions). Not part of production UX; use/job-applicationfor the real apply flow./jobApplyLink/:formId) ���� Dev/test route only for form wiring checks. Do not test responsiveness or dark mode on this route or on/jobDetailsLink/:id(covered by the main job application page).imageUrlwith category-image fallback; normalizes Dropbox share links toraw=1so images render.Architecture, Landscape & Environment) are JSON-encoded in the query so they are not split incorrectly.isValidDropboxImageUrlrequires a Dropbox host and an image extension (jpg/jpeg/png/gif/webp). Prefer links ending inraw=1(notdl=0) so listing/details images load.How to test:
Setup
manoj-collaboration-ads-creation-pageon HighestGoodNetworkApp and the matching branch on HGNRest for backend PR #2385.npm install/yarnif needed on each repo.BASE_FRONTEND_URL+ job-application email env vars from Peterson implement the create project feature in the user profile section and in the project tab #2385, thennpm run buildandnpm start(APIhttp://localhost:4500).npm run start:local���� http://localhost:5173devadmin@hgn.net/DeveloperPassword100%!(or an Owner account).A) Nav + route access (Owner / Administrator only)
/jobAdsCreation���� expect redirect / access denial (ProtectedRoute allows only Administrator and Owner).B) Create a job ad
/jobAdsCreation, fill required fields: Category, Position, Description, Projects, Requirements, Our Community, Image URL, Apply Link (job form).https://www.dropbox.com/scl/fo/817lsk8fmvx5cdexbk07x/APOLV_TrgXHFLJATnj1xVFg?rlkey=rgs3pfrbav2hf6a2el6dtblnf&e=1&dl=0
Change
dl=0����raw=1(or ensure the link is a Dropbox image URL the validator accepts).C) Collaboration listing + category filter
imageUrl(Dropboxraw=1), or category fallback if missing/unusable.D) Job details + apply (optional dev smoke only)
/jobDetailsLink/<jobId>and confirm saved fields match the create form./jobApplyLink/<formId>to sanity-check form load (no responsiveness/dark-mode testing required on these routes).E) UI polish + dark mode
/collaboration, confirm Show Summaries is fully visible (no clipped overflow)./jobAdsCreationand/collaboration���� logo sizing matches collaboration, TinyMCE fields use dark styling, labels/errors remain readable./jobDetailsLink/:idand/jobApplyLink/:formId(test-only routes; job application page covers apply UX).Screenshots or videos of changes:
Note:
development, not a continuation of the conflicted history from #4307.<img>���� preferraw=1instead ofdl=0. Suggested folder: https://www.dropbox.com/scl/fo/817lsk8fmvx5cdexbk07x/APOLV_TrgXHFLJATnj1xVFg?rlkey=rgs3pfrbav2hf6a2el6dtblnf&e=1&dl=0createCollabJobAdsis registered in Permissions.json for permission management alignment with the backend./jobDetailsLink/:idand/jobApplyLink/:formIdare test-only routes; reviewers do not need to test responsiveness or dark mode on them because/job-applicationis the supported apply experience.pr.5629_video.mp4