feat: Add Projects and Folders UI (SimpleNote v2)
- New Projects view (projects.js): Lists all projects with cards - New ProjectView (projectView.js): Project dashboard with folder tree - Updated API client: Projects and Folders CRUD methods - New modals: NewProjectModal, NewFolderModal, MoveToFolderModal - Edit/Delete project functionality - Updated navigation: ProjectList -> ProjectView -> FolderView - Consistent dark theme styling Changes: - public/js/views/projects.js (NEW) - public/js/views/projectView.js (NEW) - public/js/api.js (added Projects/Folders API methods) - public/js/app.js (added navigation routes) - public/js/components/sidebar.js (added Projects link) - public/css/style.css (added project/folder styles)
This commit is contained in:
@@ -115,6 +115,54 @@ class ApiClient {
|
||||
getTags() {
|
||||
return this.get('/tags');
|
||||
}
|
||||
|
||||
// ===== PROJECTS =====
|
||||
getProjects() {
|
||||
return this.get('/projects');
|
||||
}
|
||||
|
||||
getProject(id) {
|
||||
return this.get(`/projects/${id}`);
|
||||
}
|
||||
|
||||
createProject(data) {
|
||||
return this.post('/projects', data);
|
||||
}
|
||||
|
||||
updateProject(id, data) {
|
||||
return this.put(`/projects/${id}`, data);
|
||||
}
|
||||
|
||||
deleteProject(id) {
|
||||
return this.delete(`/projects/${id}`);
|
||||
}
|
||||
|
||||
getProjectTree(id) {
|
||||
return this.get(`/projects/${id}/tree`);
|
||||
}
|
||||
|
||||
// ===== FOLDERS =====
|
||||
getFolders(projectId, parentId = null) {
|
||||
const query = parentId ? `?parentId=${parentId}` : '';
|
||||
return this.get(`/projects/${projectId}/folders${query}`);
|
||||
}
|
||||
|
||||
createFolder(data) {
|
||||
return this.post('/folders', data);
|
||||
}
|
||||
|
||||
updateFolder(id, data) {
|
||||
return this.put(`/folders/${id}`, data);
|
||||
}
|
||||
|
||||
deleteFolder(id) {
|
||||
return this.delete(`/folders/${id}`);
|
||||
}
|
||||
|
||||
// ===== Move document to folder =====
|
||||
moveDocumentToFolder(documentId, folderId) {
|
||||
return this.put(`/documents/${documentId}`, { folderId });
|
||||
}
|
||||
}
|
||||
|
||||
export const api = new ApiClient();
|
||||
|
||||
Reference in New Issue
Block a user