Skip to content

Commit

Permalink
Merge pull request #35 from Commandos-app/develop
Browse files Browse the repository at this point in the history
Release 0.7.6
  • Loading branch information
domiSchenk authored Sep 16, 2021
2 parents c1dde79 + 4937d72 commit a571df4
Show file tree
Hide file tree
Showing 43 changed files with 546 additions and 153 deletions.
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commandos",
"version": "0.7.5",
"version": "0.7.6",
"description": "Commandos is a multi git repo client",
"scripts": {
"preinstall": "npx only-allow yarn",
Expand All @@ -21,15 +21,15 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.3",
"@angular/cdk": "^12.2.2",
"@angular/common": "~12.2.3",
"@angular/compiler": "~12.2.3",
"@angular/core": "~12.2.3",
"@angular/forms": "~12.2.3",
"@angular/platform-browser": "~12.2.3",
"@angular/platform-browser-dynamic": "~12.2.3",
"@angular/router": "~12.2.3",
"@angular/animations": "^12.2.4",
"@angular/cdk": "^12.2.4",
"@angular/common": "~12.2.4",
"@angular/compiler": "~12.2.4",
"@angular/core": "~12.2.4",
"@angular/forms": "~12.2.4",
"@angular/platform-browser": "~12.2.4",
"@angular/platform-browser-dynamic": "~12.2.4",
"@angular/router": "~12.2.4",
"@cds/angular": "^5.5.2",
"@cds/city": "^1.1.0",
"@cds/core": "^5.5.2",
Expand All @@ -43,6 +43,7 @@
"dayjs": "^1.10.4",
"diff2html": "^3.4.0",
"gitdiff-parser": "ecomfe/gitdiff-parser#7/head",
"marked": "^3.0.2",
"ngx-autosize": "^1.8.4",
"ngx-scrollbar": "^7.5.4",
"ngx-tippy-wrapper": "^3.0.1",
Expand All @@ -55,12 +56,13 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.2",
"@angular/cli": "~12.2.2",
"@angular/compiler-cli": "~12.2.3",
"@angular-devkit/build-angular": "~12.2.4",
"@angular/cli": "~12.2.4",
"@angular/compiler-cli": "~12.2.4",
"@tauri-apps/cli": "^1.0.0-beta.9",
"@types/hogan.js": "^3.0.0",
"@types/jasmine": "~3.6.0",
"@types/marked": "^3.0.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "app"
version = "0.7.5"
version = "0.7.6"
description = "Commandos is a multi git repo client"
authors = [ "Dominik Schenk" ]
license = ""
Expand Down
5 changes: 2 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"package": {
"productName": "Commandos",
"version": "0.7.5"
"productName": "Commandos"
},
"build": {
"distDir": "../dist/commandos",
Expand Down Expand Up @@ -51,7 +50,7 @@
"endpoints": [
"https://updater.commandos.dev/{{target}}/{{current_version}}"
],
"dialog": true,
"dialog": false,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDY5QzE0QTk4NjlBODA5NjAKUldSZ0NhaHBtRXJCYWRRaGhUanovZGxkM296ZWQ1dmhCam8yVk5Lc2REMjdFd2F5TnpkL0V0TUgK"
},
"allowlist": {
Expand Down
4 changes: 4 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
</footer> -->
</div>
<app-commander-modal *ngIf="commanderModalService.open"></app-commander-modal>
<commandos-update-modal *ngIf="hasUpdate" [update]="update" (close)="closeUpdate()"></commandos-update-modal>
<div class="commandos-notification-container">
<commandos-notification></commandos-notification>
</div>
14 changes: 14 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
padding: 2px 5px;
border-radius: 3px;
cursor: pointer;

&:hover {
background-color: rgba(0, 0, 0, 0.1);
}
Expand All @@ -18,39 +19,52 @@
.commander-layout {
height: 100vh;
overflow: hidden;

.commander-header {
background: var(--cds-global-color-blue-900);
color: var(--cds-global-color-gray-0);
height: var(--commander-header-height);
flex-grow: initial;
border-left: 1px solid var(--cds-global-color-blue-900);
border-right: 1px solid var(--cds-global-color-blue-900);

&.dev {
background: var(--cds-global-color-red-900);
border-left: 1px solid var(--cds-global-color-red-900);
border-right: 1px solid var(--cds-global-color-red-900);
}
}

.commander-navigation {
border-left: 1px solid var(--cds-alias-object-border-color);
border-right: 1px solid var(--cds-alias-object-border-color);
}

.commander-global-content {
border-bottom: 1px solid var(--cds-alias-object-border-color);
border-left: 1px solid var(--cds-alias-object-border-color);
border-right: 1px solid var(--cds-alias-object-border-color);
}

.commander-footer {
height: var(--commander-footer-height);
flex-grow: initial;
border-bottom: 1px solid var(--cds-alias-object-border-color);
border-left: 1px solid var(--cds-alias-object-border-color);
border-right: 1px solid var(--cds-alias-object-border-color);
}

.commander-scrollable-content {
overflow-y: auto;
justify-content: start;
align-items: start;
height: 100%;
}
}


.commandos-notification-container {
position: absolute;
right: 10px;
bottom: 10px;
}
26 changes: 19 additions & 7 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CommanderModalService } from '@shared/services';
import { DOCUMENT } from '@angular/common';
import { Component, Inject, Renderer2 } from '@angular/core';
import { Router } from '@angular/router';
import { ErrorService, LoggerService, GitService, StoreService, SplashScreenResolver } from '@core/services';
import { TranslateService } from '@ngx-translate/core';
import { CommanderService, ICommand } from '@shared/services';
import { listen } from "@tauri-apps/api/event";
import { ErrorService, GitService, LoggerService, StoreService, TauriService } from '@core/services';
import { environment } from '@env/environment';
import { TranslateService } from '@ngx-translate/core';
import { CommanderModalService, CommanderService, ICommand } from '@shared/services';
import { listen } from '@tauri-apps/api/event';
import { UpdateResult } from '@tauri-apps/api/updater';

@Component({
selector: 'commander-root',
Expand All @@ -15,6 +15,8 @@ import { environment } from '@env/environment';
})
export class AppComponent {
devEnv: boolean = !environment.production;
update: UpdateResult;
hasUpdate: boolean = false;

constructor(
private translate: TranslateService,
Expand All @@ -27,6 +29,7 @@ export class AppComponent {
private renderer: Renderer2,
public commanderModalService: CommanderModalService,
private storeService: StoreService,
private tauriService: TauriService

) {
this.load();
Expand Down Expand Up @@ -56,11 +59,20 @@ export class AppComponent {
this.registerSettingsCommand();
this.registerNewRepoCommand();

listen("tauri://update-available", function (res) {
console.log("New version available: ", res);
listen<UpdateResult>("tauri://update-available", (res) => {
console.log(`TCL: ~ file: app.component.ts ~ line 63 ~ AppComponent ~ load ~ res`, res);

});

this.update = await this.tauriService.checkUpdate();
console.log(`TCL: ~ file: app.component.ts ~ line 68 ~ AppComponent ~ load ~ this.update`, this.update);
this.hasUpdate = this.update.shouldUpdate;

}

closeUpdate() {
this.hasUpdate = false;
}

private setDarkMode() {
if (this.storeService.DarkMode) {
Expand Down
5 changes: 2 additions & 3 deletions src/app/core/services/store/store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Injectable } from '@angular/core';
import { createDir, readDir, readTextFile, writeFile } from '@tauri-apps/api/fs';
import { localDataDir } from '@tauri-apps/api/path';
import { DiffFormate, GroupByOptions, RepositoriesSettings, Settings } from './store.types';
import { sortByProperty } from '@shared/functions';
import { Store } from './store.decorator';
import { sortByProperty, Store } from '@shared/functions';

@Injectable({
providedIn: 'root'
Expand Down Expand Up @@ -68,7 +67,7 @@ export class StoreService {
this.logger.warn(`Tring to create the settings folder ${e}`);
this.createDir(path);
}
catch (e2) {
catch (e2: any) {
this.logger.error(e2);
}
}
Expand Down
18 changes: 16 additions & 2 deletions src/app/core/services/tauri/tauri.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { BehaviorSubject } from 'rxjs';
import { Injectable } from '@angular/core';
import { getVersion } from '@tauri-apps/api/app';
import { checkUpdate, UpdateResult } from "@tauri-apps/api/updater";
import { appWindow, getCurrent } from '@tauri-apps/api/window';

import { BehaviorSubject } from 'rxjs';

type WindowState = 'maximized' | 'minimized' | 'windowed';

Expand Down Expand Up @@ -49,4 +50,17 @@ export class TauriService {
this.isPinned = !this.isPinned;
appWindow.setAlwaysOnTop(this.isPinned);
}

async getVersion(): Promise<string> {
return getVersion();
}

async checkUpdate(): Promise<UpdateResult> {
try {
return checkUpdate();
} catch (error) {
console.log(error);
return null;
}
}
}
4 changes: 2 additions & 2 deletions src/app/git/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function addOriginUrl(url: string, repository: string): Promise<Git
'remote',
'add',
'origin',
url
url.trim()
];

return await runGit(args, repository, 'getOriginUrl');
Expand All @@ -74,7 +74,7 @@ export async function changeOriginUrl(url: string, repository: string): Promise<
'remote',
'set-url',
'origin',
url
url.trim()
];

return await runGit(args, repository, 'getOriginUrl');
Expand Down
14 changes: 11 additions & 3 deletions src/app/routes/about/about.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { environment } from '@env/environment';
import { TauriService } from '@core/services';
import { Component, OnInit } from '@angular/core';

@Component({
Expand All @@ -8,10 +8,18 @@ import { Component, OnInit } from '@angular/core';
})
export class AboutComponent implements OnInit {
version = 'not set!';
constructor() { }
constructor(
public tauriService: TauriService
) { }

ngOnInit(): void {
this.version = environment.version;
this.loadVersion();
}

async loadVersion() {
const version = await this.tauriService.getVersion();
this.version = `v${version}`;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RepositoryService } from '../repository.service';
import { filter, first } from 'rxjs/operators';
import { interval } from 'rxjs';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { basename, sleep, LoadingState } from '@shared/functions';
import { basename, sleep, LoadingState, LocalStorage } from '@shared/functions';

@UntilDestroy()
@Component({
Expand All @@ -22,7 +22,8 @@ export class RepositoryCommitComponent implements OnInit {

fileTree: GroupedChangedFiles = [];
formDisabled = false;
commitMessage = '';

@LocalStorage('commitMessage') commitMessage: string;
private hasStaged = false;
isDiffLoading = false;
isLoading: LoadingState = 'default';
Expand Down
2 changes: 1 addition & 1 deletion src/app/routes/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<div cds-layout="horizontal gap:sm">
<cds-button (click)="save()" [loadingState]="saveState" [disabled]="form.invalid || !form.dirty">Save
</cds-button>
<cds-button status="success" (click)="openDevTools()">Open DevTools</cds-button>
<cds-button status="success" (click)="openDevTools()" *ngIf="devMode">Open DevTools</cds-button>
</div>
</form>

Expand Down
2 changes: 2 additions & 0 deletions src/app/routes/settings/settings.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { environment } from '@env/environment';

import { Component, Inject, OnInit, Renderer2, ViewChild } from '@angular/core';
import { ErrorService, StoreService } from '@core/services';
Expand All @@ -15,6 +16,7 @@ import { selectFolder } from '@shared/functions';
export class SettingsComponent implements OnInit {

@ViewChild('form') settingsForm: NgForm;
devMode = !environment.production;

gridCounts = [25, 50, 100];
gridCount: number;
Expand Down
3 changes: 3 additions & 0 deletions src/app/shared/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
<div (click)="goto('/settings')" cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">
Settings
</div>
<div (click)="checkUpdate()" cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">
Check for updates
</div>
<cds-divider></cds-divider>
<div (click)="goto('/about')" cds-text="secondary" cds-layout="p:sm" class="clickable contextmenu-action">
About
Expand Down
Loading

0 comments on commit a571df4

Please sign in to comment.