-
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.
- Loading branch information
1 parent
604bc47
commit 807f09e
Showing
13 changed files
with
120 additions
and
57 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
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: 8 additions & 4 deletions
12
src/app/components/characters/create-character/create-character.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
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
Empty file.
1 change: 1 addition & 0 deletions
1
src/app/components/headings/secondary-h1/secondary-h1.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 @@ | ||
<small class="ms-2 font-semibold text-gray-500 dark:text-gray-400"><ng-content></ng-content></small> |
11 changes: 11 additions & 0 deletions
11
src/app/components/headings/secondary-h1/secondary-h1.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 { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'pap-secondary-h1', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './secondary-h1.component.html', | ||
styleUrl: './secondary-h1.component.css', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class SecondaryH1Component {} |
8 changes: 5 additions & 3 deletions
8
src/app/components/inputs/text-input/text-input.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,8 +1,10 @@ | ||
<label [for]="id" class="mb-2 block text-sm font-medium">{{ label }}</label> | ||
<input | ||
[attr.id]="id" | ||
[autofocus]="autofocus" | ||
[autocomplete]="autoComplete" | ||
[formControl]="control" | ||
[min]="min" | ||
[placeholder]="placeholder" | ||
[autocomplete]="autoComplete" | ||
class="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500" | ||
type="text" /> | ||
[type]="valueType" | ||
class="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500" /> |
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,26 @@ | ||
import { inject, Injectable } from '@angular/core'; | ||
import { DatabaseService } from '../database.service'; | ||
import { CharacterEntity } from '../../models/character/character.entity'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class CharactersTable { | ||
private readonly databaseService = inject(DatabaseService); | ||
|
||
list(): Promise<CharacterEntity[]> { | ||
return this.databaseService.characters.toArray(); | ||
} | ||
|
||
async add(character: Omit<CharacterEntity, 'id'>) { | ||
const id = await this.databaseService.characters.add({ | ||
...character, | ||
id: 1, // prevent creating more than one character | ||
}); | ||
|
||
const newCharacter = await this.databaseService.characters.get(id); | ||
return newCharacter!; | ||
} | ||
|
||
update(character: CharacterEntity) { | ||
return this.databaseService.characters.update(character.id, character); | ||
} | ||
} |
Oops, something went wrong.