Repository navigation
Add project management feature - #1360
Merged
Yicong-Huang merged 24 commits intoFeb 4, 2022
Merged
Conversation
- Update texera_db schema to include projects - Regenerate JOOQ files - Create ProjectResource Scala model - Add ability to get, create, delete, update projects - Add ability to get / delete workflows and files of a project - Add new API endpoint '/project' in TexeraWebApplication.scala
Contributor
Author
|
closed on accident |
shengquan-ni
reviewed
Nov 9, 2021
shengquan-ni
reviewed
Nov 9, 2021
Contributor
|
Group discussion 1/11: @shengquan-ni will ask @ethanwong16 to finish it soon |
…it / add projects & files of a project
- Backend Changes 1) check for creating projects with duplicated names 2) creating a project returns new Project object - Changed Frontend Features 1) User Projects Page (lists a user's projects) - error message when renaming / creating project with duplicate names - utilize front end cache to minimize need to refresh list of projects after creating / deleting a project 2) Single Project Page (a project and all of its files / workflows) - files are no longer stored in cache, modeled off of UserFileService and refreshing after an update - finish implementation for deleting file from this page - finish implementation of adding workflows created on this page to the project as well
Contributor
Author
|
Full List of Changes / Features Backend Changes
Frontend Changes
|
shengquan-ni
approved these changes
Jan 21, 2022
shengquan-ni
left a comment
Contributor
There was a problem hiding this comment.
LGTM, left minor comments but I think this PR can be merged directly.
Yicong-Huang
requested changes
Jan 25, 2022
Contributor
There was a problem hiding this comment.
Thanks for the PR. I see most of logics make good sense. I have not tested the GUI, but will do it in the next round. Some comments and suggestions:
- use
UserFileinstead offileorFilein all occurrences. This is to avoid confusion asUserFileis a specific term. - use
UserProjectinstead ofprojectin all occurrences.projectis quite general and could be ambiguous when referred. - remove frontend caches of data. this is to reduce the un-synchronization situation when we use those services in co-editing context.
- reduce the number of db queries in each backend endpoints. pay attention to complexity of those backend endpoints as project content can scale up in the long run.
- many of the logics are completely duplicate from
WorkflowSectionComponentandUserFileSectionComponent. please make sure to leave one copy only. we do not want to maintain two copies of logics.
- in texera_db, renamed 'project' table into 'user_project' table - regenerated JOOQ tables and data access objects for 'user_project' - updated ProjectResource.scala API endpoint paths as requested - updated frontend user-project.service.ts to call updated endpoints - added @permitAll to ProjectResource.scala to allow all users to access - updated logic for ProjectResource.scala listProjectWorkflows and listProjectFiles to use DB join - updated logic for ProjectResource.scala createProject to use try / catch and minimize number of queries - updated logic for ProjectResource.scala updateProjectName to use try / catch to validate name
- now performs name validation for whitespace or empty renaming - also checks for renaming to an already existing project name
- rename ownerId to use 'ID' instead of 'Id' - created utility function to validate project names - utilized NotificationService to display error messages
- UserProjectSection --> UserProjectList : this component lists a user's projects - ProjectPage --> UserProjectSection : this component is for a single user project - updated some routing / variables to use user project instead of project
Yicong-Huang
reviewed
Feb 2, 2022
Yicong-Huang
reviewed
Feb 2, 2022
Yicong-Huang
reviewed
Feb 2, 2022
Yicong-Huang
requested changes
Feb 2, 2022
Yicong-Huang
left a comment
Contributor
There was a problem hiding this comment.
Looks better now!
Some comments:
- when backend return a non-200 status code, frontend
observablewill break. make sure you handle those cases to show error messages correctly to users. One example is when renaming a project, if failed on backend, we should send notification to user. - some
'sare"s, are they typo, or intentional?
- updated UserProjectList component functions for create / rename project to handle error messages from server - removed minor typos in comments - minor update to backend API endpoint for rename project to perform name validation first
Yicong-Huang
reviewed
Feb 2, 2022
Yicong-Huang
reviewed
Feb 2, 2022
Yicong-Huang
approved these changes
Feb 4, 2022
1 of 6 tasks
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
### Introduction --- This PR introduces a "user project" feature which acts as a label to help organize a user's workflows and files. As the number of workflows and files of a user begins to grow too large to manage individually, the user may group them into various, easier-to-manage projects. The main goals of this PR are to allow a user to: - Create / rename / delete projects - View a list of their projects - Add workflows / files to a project - Remove workflows / files from a project - View a particular project and its workflows / files ### Solution --- The main design goal is to minimize cluttering in the UserDashboard component by having each project display only relevant information, such as only the workflows and files that belong to that project. Also, rather than displaying all project information in a single component, there are two components that separate seeing a user's list of projects from seeing what a single project contains. To address these requirements, a new feature has been added to the User Dashboard, and a typical use case is as follows: - Navigate to the User Dashboard - Click on "User Projects" from the Feature Bar - View / rename / delete / sort the user's list of projects - Click on a particular project - View / add / remove workflows and files of that particular project - Manage the workflows / files themselves from within a project Currently, projects are backward compatible with workflows and files (workflows / files features function completely independently of projects). Workflows and files do not have to be associated with a user project. On the database layer, a new `user_project` table was created to store information about each project: a project's id, a project owner's id, the name of the project, and its time of creation. New tables `workflow_of_project` and `file_of_project` were also created to store mappings between a project and the workflows / files it contains. These mapping tables have dependencies on the `user_project`, `workflow`, and `user_file` tables, and any deletions will cascade to the mappings as well. A new backend API endpoint was created at 'api/project' in `ProjectResource.scala` handling requests from the frontend. On the frontend, the following were created to implement the user project feature: - `UserProjectListComponent`: a child component of `UserDashboard` which lists all the projects of a user - `UserProjectSectionComponent` : another child component of `UserDashboard` listing a single project and the workflows / files it contains - `UserProjectService`: handling requests to backend API - `NgbdModalAddProjectFileComponent`, `NgbdModalRemoveProjectFileComponent`, `NgbdModalAddProjectWorkflowComponent`, `NgbdModalRemoveProjectWorkflowComponent` : modals to enable adding / removing workflows / files of project ### Demo --- https://user-images.githubusercontent.com/57075492/151860398-487346e4-0588-410b-88e4-538e024e4228.mov ### Current Issues --- Currently, there is some usage of non read-only data structures to enable sorting of projects / workflows, but ideally, it should be fixed to be ReadOnly. There are also some instances of duplicate logic introduced such as in the `UserProjectSectionComponent` to avoid updating the `SavedWorkflowSectionComponent` and `UserFileSectionComponent`. However, to improve maintainability such components should be modified to support user projects and reused. ### Future TODOs --- The basic features of a user project are included in this PR, but other immediate goals include refactoring the current code to reduce duplicate logic and switching to purely read-only data structures. Enhancements to the user project feature also include introducing colors to projects to allow for clearer visual indication of organization and potentially introducing sharing of projects. Co-authored-by: Shengquan Ni <[email protected]> Co-authored-by: Yicong Huang <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduction
This PR introduces a "user project" feature which acts like a label to help organize a user's workflows and files. As the number of workflows and files of a user begins to grow too large to manage individually, the user may group them into various, easier-to-manage projects. The main goals of this PR are to allow a user to:
Solution
The main design goal is to minimize cluttering in the UserDashboard component by having each project display only relevant information, such as only the workflows and files that belong to that project. Also, rather than displaying all project information in a single component, there are two components that separate seeing a user's list of projects from seeing what a single project contains.
To address these requirements, a new feature has been added to the User Dashboard, and a typical use case is as follows:
Currently projects are backwards compatible with workflows and files (workflows / files features function completely independently of projects). Workflows and files do not have to be associated with a user project.
On the database layer, a new
user_projecttable was created to store information about each project: a project's id, a project owner's id, the name of the project, and its time of creation. New tablesworkflow_of_projectandfile_of_projectwere also created to store mappings between a project and the workflows / files it contains. These mapping tables have dependencies on theuser_project,workflow, anduser_filetables, and any deletions will cascade to the mappings as well.A new backend API endpoint was created at 'api/project' in
ProjectResource.scalahandling requests from the frontend.On the frontend, the following were created to implement the user project feature:
UserProjectListComponent: a child component ofUserDashboardwhich lists all the projects of a userUserProjectSectionComponent: another child component ofUserDashboardlisting a single project and the workflows / files it containsUserProjectService: handling requests to backend APINgbdModalAddProjectFileComponent,NgbdModalRemoveProjectFileComponent,NgbdModalAddProjectWorkflowComponent,NgbdModalRemoveProjectWorkflowComponent: modals to enable adding / removing workflows / files of projectDemo
user-project-demo.mov
Current Issues
Currently there is some usage of non read-only data structures to enable sorting of projects / workflows, but ideally it should be fixed to be ReadOnly. There are also some instances of duplicate logic introduced such as in the
UserProjectSectionComponentto avoid updating theSavedWorkflowSectionComponentandUserFileSectionComponent. However, to improve maintainability such components should be modified to support user projects and reused.Future TODOs
The basic features of a user project are included in this PR, but other immediate goals include refactoring the current code to reduce duplicate logic and switching to purely read-only data structures. Enhancements to the user project feature also include introducing colors to projects to allow for clearer visual indication of organization and potentially introducing sharing of projects.