This PR is the refactoring of repo.ts into a repository service that is responsible for handling repository data.
Currently, the refactor is only of the service itself, and it has not been fully integrated into the view. Instead, global functions from repo.ts are used to update the view.
Closes #126.
Through this refactor, I concluded that there might be a need for some components that subscribe to a repo. e.g. The header component can subscribe to a repository, but this would probably need to be discussed.
Work done during this PR:
All functions in repo.ts have been moved to repository.service.ts, some still remain as git.ts and other files still use them.
drawGraph() has been modified to take in branch references as a parameter as previously it was using an import from a global variable in repo.ts.
file.service and git have been changed to use the export repo path in the repo service instead of repo.ts
The clone repository component has been deleted since it is a copy of add component and currently has no use.
Some features are still incomplete, however given the size of the PR I may split it into separate issues.
These include:
Writing tests for repository.service.
Finishing some functions for checking out local and remote branches. (These are marked with TODO)
Tested on:
Windows
Manually testing the service
repo.ts is mainly used in the addComponent to open, clone or init repositories.
The following should work and can be manually tested by clicking the view:
Successful clone of a git repo
Opening a local repo results in a graph being drawn, the headers being updated and a open successful messsage
The filediff panel should update when opening a local repo if there are changed files.
Refactor of repo.ts
This PR is the refactoring of repo.ts into a repository service that is responsible for handling repository data. Currently, the refactor is only of the service itself, and it has not been fully integrated into the view. Instead, global functions from repo.ts are used to update the view.
Closes #126.
Through this refactor, I concluded that there might be a need for some components that subscribe to a repo. e.g. The header component can subscribe to a repository, but this would probably need to be discussed.
Work done during this PR:
Some features are still incomplete, however given the size of the PR I may split it into separate issues. These include:
Tested on:
Manually testing the service
repo.ts is mainly used in the addComponent to open, clone or init repositories.
The following should work and can be manually tested by clicking the view: