Repository navigation
Refactor User Project Section Workflows - #1461
Merged
shengquan-ni merged 40 commits intoMay 13, 2022
Merged
shengquan-ni merged 40 commits into
shengquan-ni merged 40 commits into
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
…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
- 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
- Pass input to SavedWorkflowSectionComponent to track project ID, if any - Update SavedWorkflowSectionComponent service calls to also change project/workflow mappings, if needed - Pass project ID to Workspace and Navigation component to enable saving workflow to project - Update Navigation component persistWorkflow() to also save workflow into user project - Update ProjectResource.scala endpoint to check for duplicates before adding workflow to project
- integrate modals for add / remove workflow(s) from project - update margins between workflow action buttons (sort, create, add workflow to project, remove workflow from project)
shengquan-ni
reviewed
Apr 8, 2022
shengquan-ni
reviewed
Apr 8, 2022
shengquan-ni
requested changes
Apr 8, 2022
shengquan-ni
left a comment
Contributor
There was a problem hiding this comment.
Left some minor comments.
- update refactoring to reflect changes to virtual scrolling
Contributor
|
Discussion 2022.05.12: @shengquan-ni will merge this PR. |
Yicong-Huang
added a commit
that referenced
this pull request
Jul 27, 2023
This PR fixes an issue where manually persisting a workflow would throw
an `[object object]` issue. The root of the problem lies in the
invocation of `project/{pid}/workflow/{wid}/add` (introduced in #1461)
during the persistence process. The issue arises when the project id is
missing, leading to the request parameter being set as `NaN`. As a
consequence, an error occurs, and it is not being handled appropriately.
Now this faulty logic has been fixed.
---------
Co-authored-by: Shengquan Ni <[email protected]>
1 of 6 tasks
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
* Add project management API endpoint + data schema - 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 * reformat files * Update JobResultService.scala * added basic features of project management : view projects, view / edit / add projects & files of a project * Finished basic project management features - 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 * Modified front end file formatting and removed unused test files * added missing semicolons for fixing frotend format * updated schema spacing for project tables * Added requested fixes to backend API and data layer - 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 * scalafmtcheck for ProjectResource.scala * Updated renaming project logic for backend API - now performs name validation for whitespace or empty renaming - also checks for renaming to an already existing project name * Added requested changes to frontend - rename ownerId to use 'ID' instead of 'Id' - created utility function to validate project names - utilized NotificationService to display error messages * reformat string to use double quotes * Renamed frontend components - 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 * Refactor UserProjectSection to reuse SavedWorkflowSection component - Pass input to SavedWorkflowSectionComponent to track project ID, if any - Update SavedWorkflowSectionComponent service calls to also change project/workflow mappings, if needed - Pass project ID to Workspace and Navigation component to enable saving workflow to project - Update Navigation component persistWorkflow() to also save workflow into user project - Update ProjectResource.scala endpoint to check for duplicates before adding workflow to project * Finalize reusing SavedWorkflowSection component + ran yarn reformatting - integrate modals for add / remove workflow(s) from project - update margins between workflow action buttons (sort, create, add workflow to project, remove workflow from project) * Fix add / remove workflow CSS + make SavedWorkflowSection component CSS shrinkable * Fixed frontend format with yarn format:fix * Revert removal of notificationService comments * Reformat whitespace * Added comments to explain variables in add / delete worklows to project modals * Format frontend workflow / project modal files Co-authored-by: Shengquan Ni <[email protected]> Co-authored-by: Shengquan Ni <[email protected]>
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
This PR fixes an issue where manually persisting a workflow would throw
an `[object object]` issue. The root of the problem lies in the
invocation of `project/{pid}/workflow/{wid}/add` (introduced in apache#1461)
during the persistence process. The issue arises when the project id is
missing, leading to the request parameter being set as `NaN`. As a
consequence, an error occurs, and it is not being handled appropriately.
Now this faulty logic has been fixed.
---------
Co-authored-by: Shengquan Ni <[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 refactors the code in the
UserProjectSectioninvolving a particular project's workflows. The goal is to improve the maintainability of the user project feature and keep the design of workflow sections consistent.Solution
Previously the
UserProjectSectioncomponent created new HTML and Typescript logic for managing the list of workflows belonging to a particular project. The issue with this was that it introduced duplicate code and updates to theSavedWorkflowSectionwould not propagate to theUserProjectSection. As a solution, I modified theSavedWorkflowSectioncomponent to enable features relevant to user projects and reused this component within theUserProjectSection.Changes Made
Frontend
user-project-section.component.ts: makepidfield public to pass it toSavedWorkflowSectionuser-project-section.component.html: reuse theSavedWorkflowSectioncomponent and passpidsaved-workflow-section.component.ts: use optionalpidinput field to determine whether to load workflows belonging to a specific project or load all workflows + add logic for create / duplicate / refresh workflows to account for user projectssaved-workflow-section.component.html: if rendering within aUserProjectSection, also add additional buttons for add / remove workflow(s) from projectsaved-workflow-section.component.scss: even out margin between sort / create/ add / remove buttons + allow component to collapse when workflows are removed from projectworkspace.component.ts: it now extracts a passed inpidfield from the route snapshot in ngOnInit, this is used for adding newly created workflows to projectsworkspace.component.html: pass thepidfield to theNavigationcomponent which persists workflowsnavigation.component.ts: when persisting workflows, also add workflow to a project if given a validpidfieldngbd-modal-add-project-workflow.component.html,ngbd-modal-add-project-workflow.component.scss,ngbd-modal-remove-project-workflow.component.html,ngbd-modal-remove-project-workflow.component.scss: fix CSS to allow for scrolling and keep text overflow within tableBackend
ProjectResource.scala: modify endpoint adding workflow to a project to first check if mapping already exists before addingDemo
In the demo below, we can see the
UserProjectSectioncomponent workflows now are consistent with theSavedWorkflowSectioncomponent and still maintains the ability to add / remove workflows from projects.refactor-user-project-workflow.mov
Future TODOs
Address deprecated usage of .subscribe() with more than one parameter
Refresh user projects upon log out / log in
Enable creating files / workflows from SavedWorkflow and UserFile section components
Update CSS to add scrolling and control max modal width for popup to add/remove files from projects
Refactor
UserFileServiceto remove local cacheUse newly refactored
UserFileServiceto modify / reuseUserFileSectioncomponent withinUserProjectSectionAdd color indicators for each user project
Add exported sink operator CSV to current project