This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add check that the directory exists * Build project path Before this change we would accept the path provided as the destination for the project to be set up. But since the user inputs a name it would be a better UX if they picked the base directory, i.e. some workspace, and the project's name serves as the directory. However, if the user is selecting a directory that already ends in the name, then we should just take that as the path. * Remove test_ prefixes In coco/peer.rs test module we're prefixing with 'test_'. This is redundant because of the 'mod test'. * Add test for creating a project where the path ends in the same name * Fix cannot_create_project_twice The test was checking if the existing remote path was the root repo_path rather than the project path. * Project Creation This commit splits project creation off from the peer logic. The change captures that there are two ways to create a project in Upstream. There's a completely new repository, or an existing repository. In the former we expect slightly different inputs, where we build the final directory from the supplied path and name. In the later, we expect the existing directory to already be a git repostiory and the last portion of the path is the name of the project. The intention now needs to be set when creating a project via the HTTP endpoint, instead of making guess work. Included in this is some general refactoring of the control code which seemed useful to have for testing. * Renaming and cleanup Renamed ProjectCreation to Create and RepoCreate to Repo. We then use qualified imports elsewhere. Run clippy and following suggestions for clean up and documentation. * Update frontend We match the API call on the front end to specify whether we want to create a new or existing repository. If existing is selected then we take the name of the folder as the name of the project and disable the input box. There's no behavioural change for creating a brand new project. * Add disabled input styles * Update spec * Add spec for clearing name input * RepoType enum To avoid the wild west of JS consts, we use a TS enum to represent the two types of Repos, existing and new. We can then use these values instead of the plain ol' strings. Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
- Loading branch information