generated from maximegris/angular-electron
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #11. add ids to everything for easier editor experience. add d…
…ebug view so json blobs can exist without causing ux problems long term.
- Loading branch information
Showing
45 changed files
with
713 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { v7 as uuid } from 'uuid'; | ||
|
||
export function id(): string { | ||
return uuid() as string; | ||
Check failure on line 4 in src/app/helpers/id.ts GitHub Actions / build (20)
Check failure on line 4 in src/app/helpers/id.ts GitHub Actions / build (20)
|
||
} |
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,2 +1,4 @@ | ||
export * from './constants'; | ||
export * from './droptable'; | ||
export * from './item'; | ||
export * from './recipe'; |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { IRecipe, TradeskillType } from '../../interfaces'; | ||
import { id } from './id'; | ||
|
||
export const defaultRecipe: () => IRecipe = () => ({ | ||
_id: id(), | ||
category: '', | ||
item: '', | ||
maxSkillForGains: 0, | ||
name: '', | ||
recipeType: undefined as unknown as TradeskillType, | ||
requireSkill: 0, | ||
skillGained: 1, | ||
xpGained: 1, | ||
copySkillToPotency: false, | ||
ingredients: [], | ||
ozIngredients: [], | ||
potencyScalar: 0, | ||
requireClass: [], | ||
requireLearn: false, | ||
requireSpell: undefined as unknown as string, | ||
transferOwnerFrom: '', | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { inject, Injectable, signal } from '@angular/core'; | ||
import { LocalStorageService } from 'ngx-webstorage'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class DebugService { | ||
private localStorage = inject(LocalStorageService); | ||
|
||
public isDebug = signal<boolean>(false); | ||
|
||
public toggleDebug() { | ||
this.isDebug.set(!this.isDebug()); | ||
this.localStorage.store('debug', this.isDebug()); | ||
} | ||
|
||
constructor() { | ||
this.isDebug.set(!!this.localStorage.retrieve('debug')); | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/app/shared/components/debug-view/debug-view.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,6 @@ | ||
@if(debugService.isDebug()) { | ||
<hr class="mt-3"> | ||
<pre> | ||
<ng-content></ng-content> | ||
</pre> | ||
} |
Empty file.
11 changes: 11 additions & 0 deletions
11
src/app/shared/components/debug-view/debug-view.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,11 @@ | ||
import { Component, inject } from '@angular/core'; | ||
import { DebugService } from '../../../services/debug.service'; | ||
|
||
@Component({ | ||
selector: 'app-debug-view', | ||
templateUrl: './debug-view.component.html', | ||
styleUrl: './debug-view.component.scss', | ||
}) | ||
export class DebugViewComponent { | ||
public debugService = inject(DebugService); | ||
} |
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
4 changes: 2 additions & 2 deletions
4
src/app/shared/components/input-damageclass/input-damageclass.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div class="relative"> | ||
<ng-select class="form-control" [items]="values" groupBy="category" [(ngModel)]="damageClass" | ||
placeholder="Select damage class..." (change)="change.emit($event?.value)"></ng-select> | ||
<ng-select class="form-control" [items]="values" [(ngModel)]="damageClass" placeholder="Select damage class..." | ||
(change)="change.emit($event)"></ng-select> | ||
|
||
<app-input-floating-label>Damage Class</app-input-floating-label> | ||
</div> |
Oops, something went wrong.