Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release dev to master #390

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Release dev to master #390

wants to merge 14 commits into from

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Feb 15, 2025

RecNet auto-release action

This is an auto-generated PR by recnet-release-action 🤖
Please make sure to test your changes in staging before merging.

Related Issues

Related PRs

Staging links

recnet-web: https://vercel.live/link/recnet-git-dev-recnet-542617e7.vercel.app
recnet-api: https://dev-api.recnet.io/api

mistydqwq and others added 7 commits February 4, 2025 15:00
changed month field to dropdown list

fixed the article link update issue

fixed several code norm issue
# [Feature] Add Admin Panel Article Management

## **Background**
This PR adds a new **Article Management** feature to the admin panel,
allowing administrators to search for articles in the database by URL
and modify their fields.

## **Changes Introduced**
### **Frontend Changes**
- Added a new **`article/management/`** folder under
`recnet/src/app/admin/`.
  - Created `article/management/page.tsx` for the main page.
- Created `article/management/ArticleManagementForm.tsx` for the article
editing form.
- Updated `AdminPanelNav` to include the new **Article Management**
section.
- Modified `src/serve/routers/article.ts`:
- Modified the `getArticleByLink` logic for fetching articles based on
URL and using digital library or not .

### **Backend Changes**
- Added a new API: **`adminUpdateArticle`** to update article fields in
the database.
- Modified `getArticleByLink` API:
  - Introduced a new request parameter:  
    ```ts
    boolean useDigitalLibrary
    ```
- **Purpose**: Determines whether to fetch articles using the
`digitalLibrary` service.
  - **Default Value**: `true` (ensuring no impact on existing behavior).
- **If set to `false`**: The API retrieves articles directly from the
database without using `digitalLibrary`.
- Updated related backend components:
  - **DTOs**  
  - **Repository layer**  
  - **Service layer**  
  - **`libs/recnet-api-model`**


## **How to Test**
1. Navigate to the **Admin Panel**.
2. Go to the newly added **Article Management** section.
3. Enter a **URL** to search for an article in the database.
4. Modify the necessary fields and submit the changes.
5. Verify that:
   - The article updates correctly in the database.
- The new `useDigitalLibrary` parameter works as expected (retrieves
articles correctly when set to `false`).
Copy link

vercel bot commented Feb 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
recnet ❌ Failed (Inspect) Mar 3, 2025 3:41pm
recnet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2025 3:41pm

CamileTong and others added 5 commits February 16, 2025 14:46
… Image component in ProfileEditForm.tsx to main square ratio
## Description

Make the admin panel graph clickable. When clicking, a list of recs
during the time period will show up under the graph. The list can be
toggled off by clicking again. The list contains recommender (with link
to their profile) and the recommended paper (with link)

## Related Issue

[Issue 371](#371) Improve admin
graphs to show all recs for a cycle

## Changes

1. Added new API endpoint:

* GET /stats/recs?cutoff={timestamp} to fetch recommendations for a
specific time period
* Returns recommendations with cutoff dates in (periodStart, periodEnd]
range
* Includes user info (name, handle) and recommendation details (title,
link)

2. Updated bar chart component:

* Made bars clickable to show/hide recommendation details
* Added table view below chart to display period's recommendations
* Implemented truncation for long paper titles
* Added links to user profiles and paper URLs

## Notes

The time boundary logic uses exclusive start date (gt) and inclusive end
date (lte) to ensure recommendations are counted in exactly one weekly
period.

## Test

1. Visit the admin stats page. Click on any bar in the graph:
2. Verify the bar changes color when selected
3. Check that the recommendation list appears below
4. Confirm user names link to correct profiles. Confirm paper titles
link to correct URLs
5. Click the same bar again. Verify the list disappears. Check the bar
color returns to normal
6. Verify long paper titles are truncated

## Screenshots (if appropriate):
<img width="1154" alt="Screenshot 2025-02-16 at 2 38 21 PM"
src="https://github.com/user-attachments/assets/64695ab9-9130-4f67-ae0e-a7cd8e069f4a"
/>

## TODO

- [ ] Clear `console.log` or `console.error` for debug usage
- [ ] Update the documentation `recnet-docs` if needed
## Description

This PR adds a new edit profile photo feature. Prior to this, RecNet
displays a user's Google account profile photo and does not allow
changes. This feature allows any RecNet user to upload a profile photo,
which is stored in an AWS S3 bucket and make updates to the user profile
information in the database.

## Related Issue
* See [PR#392](#392) for previous
comments and requested changes. Reopening PR for the same issue to merge
to `dev` before `master`.

## Frontend Changes
* Modified
`/apps/recnet/src/components/setting/profile/ProfileEditForm.tsx` adding
new form element and function:
* Added profile photo `<input>` element with a photo preview image to
accept and display the selected photo.
* Added `handleUploadS3` function to get a secure uploadUrl from the
backend, put objects to the S3 bucket, and update the form data.
* Modified the `onSubmit` function to call the `handleUploadS3` function
when a user saves the form.
* Updated the `ProfileEditSchema`, `useForm` hook to include the
photoUrl field.
* Added a `generateUploadUrlMutation` hook to send a request to the
backend to get a secure S3 upload URL.
* Added new state hooks `[isUploading, setIsUploading]`, `[selectedFile,
setSelectedFile]`, `[photoPreviewUrl, setPhotoPreviewUrl]` ,
`[fileError, setFileError]` to manage the selected photo and upload
status.
* Created a new router `generateS3UploadUrl` in the
`/apps/recnet/src/server/routers/user.ts`
* Modified the router `updateUser` in
`/apps/recnet/src/server/routers/user.ts` to fetch the original photoUrl
and delete the corresponding S3 file if a new profile photo is uploaded.

## Backend Changes
* Added a new folder `photo-storage` under
`/apps/recnet-api/src/modules`
* Created a `photo-storage.controler.ts` to handle requests to the
`photo-storage` endpoint.
* Created a `photo-storage.service.ts`. Included a `generateS3UploadUrl`
method and a `deleteS3Object` method.
* Created a `photo-storage.module.ts` to package and export the s3
class.
* Modified `common.config.ts` under `/apps/recnet-api/src/config` to
register AWS S3 configuration.
* Updated `env.schema.ts` under `/apps/recnet-api/src/config` to include
the s3 environment variable data types.
* Updated `app.module.ts` under `/apps/recnet-api/src` to include and
import the `PhotoStorageModule`.

## Other Changes
* Added `photo-storage.ts` under `/libs/recnet-api-model/src/lib/api` to
document the new APIs related to `photo-storage`.
* Updated `package.json` to include `aws-sdk/client-s3` and
`aws-sdk/s3-request-presigner` .
* Install aws-sdk: `@aws-sdk/client-s3 @aws-sdk/s3-request-presigner`.
Make sure to use aws-sdk v3.

## How To Test
1. Log in to your account.
2. Navigate to the Profile page.
3. Click on the "Settings" button and open the first tab "Edit profile".
4. Click on "Choose file" to choose a file and attach to the form.
5. Click on the "Save" button and wait for the upload to complete.
6. Check your profile photo and it should be updated to the new photo
you uploaded.

## Screenshots (if appropriate):
<img width="863" alt="1_profile-photo-before"
src="https://github.com/user-attachments/assets/608bfba6-883f-4fbd-a50f-329434d920f3"
/>
<img width="783" alt="2_edit-photo"
src="https://github.com/user-attachments/assets/38ed449d-d572-4259-b7f6-fe42a4a44664"
/>
<img width="799" alt="3_photo-attached"
src="https://github.com/user-attachments/assets/94b94372-5dfa-4c7d-9dba-5586850799f0"
/>
<img width="739" alt="4_uploading"
src="https://github.com/user-attachments/assets/8c3bc13c-e06b-40d9-b254-5648e78bfd8f"
/>
<img width="851" alt="5_photo-updated"
src="https://github.com/user-attachments/assets/a8267cfa-dd82-45ba-a6d6-11908eed4dcd"
/>


## TODO
- Add AWS S3 configurations in the `.env` file under `/apps/recnet-api`
for the dev and prod environment for deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants