update,
This commit is contained in:
104
002_source/cms/src/app/dashboard/cr/_GUIDELINES.md
Normal file
104
002_source/cms/src/app/dashboard/cr/_GUIDELINES.md
Normal file
@@ -0,0 +1,104 @@
|
||||
# Connective Revision Guidelines
|
||||
|
||||
## Files and component highlight
|
||||
|
||||
1. `_GUIDELINES.md` - this document
|
||||
1. categories
|
||||
|
||||
- list (page.tsx), also containing a button to delete record
|
||||
- read/view ([cat_id]/page.tsx)
|
||||
- create (create/page.tsx)
|
||||
- edit/update (edit/[cat_id]/page.tsx)
|
||||
- optional data for testing(lp-categories-sample-data.tsx)
|
||||
|
||||
1. questions
|
||||
|
||||
- list (page.tsx), also containing a button to delete record
|
||||
- read/view ([cat_id]/page.tsx)
|
||||
- create (create/page.tsx)
|
||||
- edit/update (edit/[cat_id]/page.tsx)
|
||||
- optional data for testing(lp-categories-sample-data.tsx)
|
||||
|
||||
## Prompt Documents
|
||||
|
||||
Each edit page contains `_PROMPT.md` file that provides guidance for editing.
|
||||
|
||||
## Sample Data
|
||||
|
||||
- `categories/lp-categories-sample-data.tsx`: Categories sample data
|
||||
- `questions/cr-categories-sample-data.tsx`: Questions sample data
|
||||
|
||||
## Assumptions & Requirements
|
||||
|
||||
1. Using PocketBase to handle ConnectiveRevision records
|
||||
2. Each ConnectiveRevision record has:
|
||||
- `id` (autogenerated)
|
||||
- `collectionId` (autogenerated)
|
||||
- `collectionName` (autogenerated)
|
||||
- `created` (autogenerated)
|
||||
- `updated` (autogenerated)
|
||||
- `title` (string)
|
||||
- `description` (string)
|
||||
- `category` (string)
|
||||
- `status` (string)
|
||||
- `priority` (number)
|
||||
- `dueDate` (string)
|
||||
- `assignee` (string)
|
||||
- `reporter` (string)
|
||||
- `comments` (array)
|
||||
- `attachments` (array)
|
||||
- `tags` (array)
|
||||
- `related` (array)
|
||||
- `history` (array)
|
||||
|
||||
## Assumption and Requirements
|
||||
|
||||
- the `@` sign refer to `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src`
|
||||
- assume `pb` is located in `@/lib/pb`
|
||||
- type information defined in `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/Customers/type.d.tsx`
|
||||
|
||||
## Component Development Guidelines
|
||||
|
||||
### Requirements
|
||||
|
||||
1. **Single Responsibility Principle**:
|
||||
|
||||
2. **File Organization**:
|
||||
|
||||
- One file per component
|
||||
- File name should match component name (PascalCase)
|
||||
- Place components in logical directories based on their purpose
|
||||
|
||||
3. **Type Safety**:
|
||||
|
||||
- Always use TypeScript types/interfaces
|
||||
- Import types from `@/db/Customers/type.d.tsx`
|
||||
|
||||
4. **PocketBase Integration**:
|
||||
- Use `pb` instance from `@/lib/pb`
|
||||
|
||||
### Component Example
|
||||
|
||||
```typescript
|
||||
'use client';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
import { COL_ExampleModel } from '@/constants';
|
||||
import type { ExampleType } from '@/db/ExampleModel/type';
|
||||
|
||||
// common reference to error display, Provide user-friendly error messages
|
||||
import ErrorDisplay from '@/components/dashboard/error';
|
||||
|
||||
// declare `Props` explicitively
|
||||
interface Props {
|
||||
initialData?: ExampleType;
|
||||
}
|
||||
|
||||
export default function ExampleForm({ initialData }: Props) {
|
||||
let { t } = useTranslate();
|
||||
|
||||
// Render form UI
|
||||
return <>helloworld</>
|
||||
}
|
||||
|
||||
```
|
3555
002_source/cms/src/app/dashboard/cr/_repomix.md
Normal file
3555
002_source/cms/src/app/dashboard/cr/_repomix.md
Normal file
File diff suppressed because it is too large
Load Diff
1772
002_source/cms/src/app/dashboard/cr/repomix-output.xml
Normal file
1772
002_source/cms/src/app/dashboard/cr/repomix-output.xml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user