Skip to content

Commit

Permalink
Merge fix (SQLite & Repository Modal) (#3578)
Browse files Browse the repository at this point in the history
* Migrate to SQLite (#3577)

* Install electron-rebuild package

* Create database.js file

* Install sqlite3 package

* Update postinstall script command

postinstall command install all the electron app native deps.

* Remove rebuild script command

* Export the open database connection

* Create repository database table

Repository db table will store repository added to Thermal application

* Rename variable to repository.path

* Add unique repositoryId and rename db table column names

* Rename local variable repository.path

* Dynamic routes (#176)

* Add params to repository routes

Add projectId and branchName params to repository routes.

* Rename route name to project

Rename the repository routes from repository to project

* projectWorkspace
* projectCommits

* Remove workspaceRepository from vuex

No longer using vuex for storing active repository.

* Change git status parameter to path

* Mixin to fetch data of active repository

* Change git diff argument to path

* Use navigation guard beforeRouteEnter()

* Update repository data property name

* Change git commit argument to path

* Import repositoryData mixin to navbar

* Use repositoryData property and inline dynamic class names

Replace this.currentRepository with this.repositoryData and compute the dynamic css class inline

* Pass route params to vue router

* Remove mutation of commits and stage files from navbar

* Remove updateCurrentRepository method

Remove the method which updates the workspace to selected repository.

* Fetch active branch name & pass as route params with projectId

* Pass projectId as route params

* Validate repositoryRoute starts with /repository

* Split history page to commits & commit

Show commit logs in commits page and commit detail in commit page

* Change function argument to path

Instead of passing repository object, pass path as string.

* Remove vuex from commits and commit page

Store data locally inside component

* Add warning style to TButton

* Initialize git repository on welcome page

Move the process of initializing git repository from repository to welcome page.

* Add border color to danger button

* Fix spelling mistake "Initialize"

* Pass branchName as params to commit route

Changing to other view (for example: workspace) from sidebar, it shows error, as the route doesn't have any branchName.

That's why passing brachName as params to commit route is important.

* Update route name & pass branchName as params in sidebar

* Fix: Click on thermal logo redirect to welcome page

* Import repositoryDataMixin to commitMessage

* Change to repositoryData in commitMessage

* Rename component name to CommitMessageBox

* Pass branchName as params to settings page

* Update: currentRepository to repositoryData mixin

* Open repository settings from menubar

* Remove vuex action from switch repository method

* Run updateRepositoryData method on mounted & beforeUpdate

Menubar was unable to read data from repositoryData before it is already mounted, that's why it is important to add beforeupdate lifecycle hook.

* Update: RepositoryDataMixin data property

* Update: Use repositoryDataMixin for fetch repository data

* Update: Pass projectId as payload for modify vuex state

* Remove workspace store reference and use projectId route params

* Update local storage data after running repository mutation

* Import repositoryDataMixin for repository data

* Rename method openRepositorySettings()

* Add params to repository settings menubar

* Remove duplicate openRepositorySettings() method

* Change repository vuex state property name

* Query repo from db & display on welcome page

* Rename database file to thermal.sqlite

* Remove isGitRepo from repository db table

* Repository database colums NOT NULL

* Create gitRepository & repositorySettings db table

* Ignore .sqlite database files

* Remove repository mutations & actions

* Add updateRepositoryList mutation

* Create local repository data property

* Update getRepositoryName() method

* Insert data to repository db table

* Valid git repository and getRemote URL

* Import database

* Insert data to repositorySettings & gitRepository

* Query all data from repository table

* Method addRepositoryToDatabase()

* Query selective data from repository database

Selecting repositoryId, repositoryName, repositoryPath, and isGit.

* Allow click on settings button regardless of isGit

* Rename repository to newRepository

newRepository local data property is used for adding repository (addNewRepository)

* Query all repo after adding entry to db table

* Change valid git repo key value `isGit`

isGit is a column in gitRepository db table.

* Add repository to db on dropHandler

* Fetch projectId data from on mounted

* Update local data property to settings

* Switch vuex to settings local data property

* Remove repository method

* Update input fields label & input

* Remove repository mutation beforeCreated()

* Query selective data from repository, gitRepository db table

Update local data property from addRepository.js mixin `this.newRepository`.

* Split queryAllRepository into mixin

* repository (directoryPath) & repositorySettings (repositoryName)

Update and simplify database columns

* Use queryAllRepository mixin

* Update settings data to database (onClick button)

* gitCommands database table

Switch from vuex to sqlite database.

* Added repository list modal (#3570)

* Added repository list modal.

* fix: repositoryItem filters expected value is object

* Add close button to modal footer

* Removed repeated if-condition.

* Format the code

* Add new props to repositoryItem

Get all repository list from database and pass further to `repositoryItem.vue` as props  (repositoryId, repositoryName, isGit)

* Close selectRepository modal on select other repo

* Add height props to repositoryList

* Add initialize git repo button

Pass directoryPath as props for initialize git repository button

* Use repositoryList component

* Remove openWorkspace & openSettings methods

* Query all repository on app mounted()

* Move styles to repositoryItem.vue

* Remove styles for example repository modal

* Remove drag and drop from welcome.vue

Moving the drag and drop feature to select.vue page

* Remove truncateFilter import

* Add type and path to repositoryItem.vue

Add repository type icon and repository path

* selectRepository page

A page for adding and opening repository

Later more functionality will be added like github and gitlab integration

* Search repository option

* Pass source & path props to repositoryList & repositoryItem

* Add source column to repositorySettings db

* Pass source & path props to repositorylist comp.

* Hide repositoryPath and sourceIcon based props

* open select page from menubar

* fix: change welcome page component to welcome.vue

* Rename from to SwitchRepository modal

* Toggle switchRepository from navbar

* Drop and drop only 1 repository

Temporarily limit add repository count to 1 on drag and drop

* Remove switch repository button from menubar

* Hide source icon and path from welcome page repository list
  • Loading branch information
mittalyashu committed Oct 15, 2019
1 parent e8b3596 commit 30b66b9
Show file tree
Hide file tree
Showing 41 changed files with 1,185 additions and 869 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ npm-debug.log
npm-debug.log.*
thumbs.db
!.gitkeep
*.sqlite
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
"postinstall": "npm run lint:fix"
"postinstall": "electron-builder install-app-deps"
},
"build": {
"productName": "Thermal",
Expand Down Expand Up @@ -93,6 +93,7 @@
"axios": "^0.19.0",
"chart.js": "^2.8.0",
"simple-git": "1.113.0",
"sqlite3": "^4.0.9",
"vue": "2.6.10",
"vue-chartjs": "^3.4.2",
"vue-electron": "^1.0.6",
Expand Down
4 changes: 4 additions & 0 deletions src/database/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const sqlite3 = require("sqlite3").verbose();
const database = new sqlite3.Database("thermal.sqlite");

export default database;
8 changes: 7 additions & 1 deletion src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import menubar from "./components/menubar";
import TModal from "./components/TModal/TModal";
import * as Sentry from "@sentry/electron";
import queryAllRepository from "./mixins/queryAllRepository";
// modals
import newRepository from "./modal/newRepository";
Expand All @@ -51,6 +52,7 @@ import exportCommitData from "./modal/exportCommitData";
import newRemote from "./modal/newRemote";
import initializeGitRepository from "./modal/initializeGitRepository";
import cloneRepository from "./modal/cloneRepository";
import switchRepository from "./modal/switchRepository";
// help widget
import packageJson from "../../package.json";
Expand All @@ -75,10 +77,12 @@ export default {
newRemote,
initializeGitRepository,
cloneRepository,
switchRepository,
DropdownList,
DropdownItem,
DropdownDivider
},
mixins: [queryAllRepository],
data() {
return {
helpWidget: false
Expand Down Expand Up @@ -109,9 +113,11 @@ export default {
}
},
beforeCreate() {
this.$store.commit("repository/getRepositoryList");
this.$store.commit("settings/getSettingsList");
},
mounted() {
this.queryAllRepository();
},
methods: {
websiteUrl() {
shell.openExternal(
Expand Down
10 changes: 10 additions & 0 deletions src/renderer/components/TButton/TButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class="t-button"
:class="{
't-button__primary': !outline,
't-button__primary-warning': !outline && warning,
't-button__primary-danger': !outline && danger,
't-button__disabled': disabled,
't-button__outline': outline,
Expand Down Expand Up @@ -32,6 +33,10 @@ export default {
type: Boolean,
default: false
},
warning: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
Expand Down Expand Up @@ -71,8 +76,13 @@ export default {
border-color: #00adb5
background-color: #00adb5
&-warning
background-color: #e5d570
border-color: #e5d570
&-danger
background-color: #f04747
border-color: #f04747
&__outline
border-color: #00adb5
Expand Down
Loading

0 comments on commit 30b66b9

Please sign in to comment.