mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2025-12-31 22:53:16 +09:00
#52 selected a new trigger once created
This commit is contained in:
@@ -11,7 +11,6 @@ import {MatDialog} from '@angular/material/dialog';
|
||||
})
|
||||
export class TriggerListComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
newTriggers: Array<SimpleTrigger> = new Array<SimpleTrigger>();
|
||||
|
||||
loading = true;
|
||||
@@ -67,9 +66,15 @@ export class TriggerListComponent implements OnInit {
|
||||
else
|
||||
this.onNewTriggerClicked.emit();
|
||||
}
|
||||
|
||||
onNewTrigger(newTrigger: SimpleTrigger) {
|
||||
this.newTriggers = [newTrigger, ...this.newTriggers];
|
||||
this.selectedTrigger = newTrigger.triggerKeyDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: 'Multiple jobs not supported yet - Coming Soon...',
|
||||
})
|
||||
// tslint:disable-next-line:component-class-suffix
|
||||
export class UnsupportedMultipleJobsDialog {}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<div fxFlex="0 0 300px">
|
||||
<div fxLayout="row" fxLayoutAlign="stretch" fxFill>
|
||||
<qrzmng-trigger-list
|
||||
[newTriggers]="newTriggers"
|
||||
(onNewTriggerClicked)="onNewTriggerRequested()"
|
||||
[openedNewTriggerForm]="newTriggerFormOpened"
|
||||
(onSelectedTrigger)="setSelectedTrigger($event)"
|
||||
@@ -21,7 +20,7 @@
|
||||
<div fxLayout="column">
|
||||
<qrzmng-simple-trigger-config
|
||||
[triggerKey]="selectedTriggerKey"
|
||||
(onNewTrigger)="onNewTrigger($event)">
|
||||
(onNewTrigger)="onNewTriggerCreated($event)">
|
||||
</qrzmng-simple-trigger-config>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
import {SimpleTrigger} from '../../model/simple-trigger.model';
|
||||
import {TriggerKey} from '../../model/triggerKey.model';
|
||||
import {SimpleTriggerConfigComponent} from '../../components/simple-trigger-config';
|
||||
import {TriggerListComponent} from '../../components';
|
||||
|
||||
@Component({
|
||||
selector: 'manager',
|
||||
@@ -17,14 +18,14 @@ export class ManagerComponent implements OnInit {
|
||||
@ViewChild(SimpleTriggerConfigComponent)
|
||||
private triggerConfigComponent!: SimpleTriggerConfigComponent;
|
||||
|
||||
@ViewChild(TriggerListComponent)
|
||||
private triggerListComponent: TriggerListComponent;
|
||||
|
||||
newTriggerFormOpened = false;
|
||||
|
||||
newTriggers = new Array<SimpleTrigger>();
|
||||
selectedTriggerKey: TriggerKey;
|
||||
|
||||
constructor(
|
||||
private config: ConfigService,
|
||||
private userService: UserService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
@@ -34,15 +35,12 @@ export class ManagerComponent implements OnInit {
|
||||
this.triggerConfigComponent.openTriggerForm();
|
||||
}
|
||||
|
||||
onNewTrigger(newTrigger: SimpleTrigger) {
|
||||
this.newTriggers.push(newTrigger);
|
||||
onNewTriggerCreated(newTrigger: SimpleTrigger) {
|
||||
this.triggerListComponent.onNewTrigger(newTrigger);
|
||||
}
|
||||
|
||||
setSelectedTrigger(triggerKey: TriggerKey) {
|
||||
this.selectedTriggerKey = triggerKey;
|
||||
}
|
||||
|
||||
onTriggerFormToggled(formOpened: boolean) {
|
||||
this.newTriggerFormOpened = formOpened;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user