-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68764dd
commit 9489149
Showing
17 changed files
with
147 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
12 changes: 12 additions & 0 deletions
12
src/app/shared/components/update-modal/update-modal.component.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<cds-modal [closable]="false"> | ||
<cds-modal-header> | ||
<h3 cds-text="title">Command update version v{{version}}</h3> | ||
</cds-modal-header> | ||
<cds-modal-content> | ||
<div [innerHtml]="manifest"></div> | ||
</cds-modal-content> | ||
<cds-modal-actions> | ||
<cds-button action="flat" (click)="cancel()">Cancel</cds-button> | ||
<cds-button (click)="startUpdate()">Update Commandos</cds-button> | ||
</cds-modal-actions> | ||
</cds-modal> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/shared/components/update-modal/update-modal.component.spec.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { UpdateModalComponent } from './update-modal.component'; | ||
|
||
describe('UpdateModalComponent', () => { | ||
let component: UpdateModalComponent; | ||
let fixture: ComponentFixture<UpdateModalComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ UpdateModalComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(UpdateModalComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
src/app/shared/components/update-modal/update-modal.component.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Component, Input, OnInit, SecurityContext } from '@angular/core'; | ||
import { DomSanitizer } from '@angular/platform-browser'; | ||
import { relaunch } from "@tauri-apps/api/process"; | ||
import { installUpdate, UpdateResult } from '@tauri-apps/api/updater'; | ||
import marked from 'marked'; | ||
|
||
@Component({ | ||
selector: 'commandos-update-modal', | ||
templateUrl: './update-modal.component.html', | ||
styleUrls: ['./update-modal.component.scss'] | ||
}) | ||
export class UpdateModalComponent implements OnInit { | ||
|
||
|
||
version: string; | ||
manifest: string; | ||
|
||
|
||
@Input() | ||
public set update(value: UpdateResult) { | ||
this.version = value.manifest.version; | ||
const manifest = marked(value.manifest.body); | ||
this.manifest = this.domSanitizer.sanitize(SecurityContext.HTML, manifest); | ||
} | ||
|
||
|
||
constructor( | ||
private domSanitizer: DomSanitizer | ||
) { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
async startUpdate() { | ||
await installUpdate(); | ||
await relaunch(); | ||
} | ||
|
||
cancel() { | ||
|
||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
|
||
|
||
export const environment = { | ||
production: true, | ||
noGitLogging: true, | ||
splashDuration: 3000, | ||
version: `v${require('../../package.json').version}` | ||
versionPostfix: `` | ||
}; |
This file contains 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
This file contains 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
This file contains 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