-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sai-editor): make linkable the timed-actionlist
- Loading branch information
Showing
4 changed files
with
23 additions
and
14 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
4 changes: 3 additions & 1 deletion
4
libs/shared/sai-editor/src/timed-actionlist/timed-actionlist.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
Empty file.
24 changes: 15 additions & 9 deletions
24
libs/shared/sai-editor/src/timed-actionlist/timed-actionlist.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 |
---|---|---|
@@ -1,33 +1,39 @@ | ||
import { ChangeDetectionStrategy, Component, inject, Input, OnChanges } from '@angular/core'; | ||
import { DTCFG } from '@keira/shared/config'; | ||
|
||
import { SmartScripts } from '@keira/shared/acore-world-model'; | ||
import { Observable } from 'rxjs'; | ||
import { AsyncPipe } from '@angular/common'; | ||
import { NgxDatatableModule } from '@siemens/ngx-datatable'; | ||
import { SmartScripts } from '@keira/shared/acore-world-model'; | ||
import { SelectComplexKeyComponent } from '@keira/shared/base-abstract-classes'; | ||
import { MysqlQueryService } from '@keira/shared/db-layer'; | ||
import { SaiSearchService } from '@keira/shared/selectors'; | ||
import { NgxDatatableModule } from '@siemens/ngx-datatable'; | ||
import { Observable } from 'rxjs'; | ||
import { SaiHandlerService } from '../sai-handler.service'; | ||
|
||
@Component({ | ||
selector: 'keira-timed-actionlist', | ||
templateUrl: './timed-actionlist.component.html', | ||
styleUrls: ['./timed-actionlist.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [NgxDatatableModule, AsyncPipe], | ||
}) | ||
export class TimedActionlistComponent implements OnChanges { | ||
export class TimedActionlistComponent extends SelectComplexKeyComponent<SmartScripts> implements OnChanges { | ||
@Input({ required: true }) creatureId!: string | number; | ||
|
||
private readonly queryService = inject(MysqlQueryService); | ||
|
||
readonly DTCFG = DTCFG; | ||
protected override readonly handlerService = inject(SaiHandlerService); | ||
readonly selectService = inject(SaiSearchService); | ||
|
||
private _timedActionLists$!: Observable<SmartScripts[]>; | ||
get timedActionlists$(): Observable<SmartScripts[]> { | ||
return this._timedActionLists$; | ||
} | ||
|
||
ngOnChanges() { | ||
ngOnChanges(): void { | ||
this._timedActionLists$ = this.queryService.getTimedActionlists(this.creatureId); | ||
} | ||
|
||
override onSelect(event: { selected: SmartScripts[] }): void { | ||
console.log('### event 2', event); | ||
this.handlerService.select(false, event.selected[0], `Timed Actionlist ID ${event.selected[0].entryorguid}`); | ||
} | ||
} |