Closed aminlatifi closed 3 weeks ago
The recent changes introduce a description_summary
column to the project
table, allowing for concise summaries of project descriptions. The html-to-text
library is added to generate these summaries. GraphQL schema and TypeScript models are updated to include the new field. Additionally, constants and helper functions are introduced to manage the summary generation, ensuring a streamlined process from project data import to database storage.
File(s) | Change Summary |
---|---|
db/migrations/1718005314786-Data.js |
Added migration to introduce description_summary column to project table. |
package.json |
Added dependencies: html-to-text and @types/html-to-text . |
schema.graphql |
Added descriptionSummary field to Project type. |
src/constants.ts |
Introduced DESCRIPTION_SUMMARY_LENGTH constant. |
src/.../giveth/constants.ts , service.ts , type.ts |
Updated descriptionField from descriptionSummary to description . |
src/features/import-projects/helpers.ts |
Added summary generation function and updated project creation to include descriptionSummary . |
src/model/generated/project.model.ts |
Added descriptionSummary property to Project class. |
sequenceDiagram
participant Importer as Importer
participant GivethService as Giveth Service
participant Helper as Helper
participant DB as Database
Importer->>GivethService: fetchGivethProjectsBatch(limit, skip)
GivethService-->>Importer: Project Data (with description)
Importer->>Helper: getHtmlTextSummary(description)
Helper-->>Importer: descriptionSummary
Importer->>DB: Insert/Update Project (with descriptionSummary)
In the land of code, a change so bright,
Summaries born from HTML's light.
With constants and helpers, we now see,
Projects described with brevity.
A rabbit's joy, in lines so neat,
Our database now feels complete.
🌟🐇✨
[!WARNING]
Review ran into problems
Problems (1)
* Git: Failed to clone repository. Please contact CodeRabbit support.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
76
Summary by CodeRabbit
New Features
descriptionSummary
field to theProject
type, providing a concise text summary of project descriptions.Enhancements
description
field instead ofdescriptionSummary
.Dependencies
html-to-text
package for converting HTML content to text.