Edit Initial Value of SimpleState per TemplateElement
Some checks failed
E2E Testing / test (push) Failing after 1m30s
Some checks failed
E2E Testing / test (push) Failing after 1m30s
This commit is contained in:
parent
743af8c0a1
commit
2e6363e090
@ -79,6 +79,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
TemplateSpecificatorComponent
|
TemplateSpecificatorComponent
|
||||||
} from "./editor/gamesystem-editor/template-specificator/template-specificator.component";
|
} from "./editor/gamesystem-editor/template-specificator/template-specificator.component";
|
||||||
|
import {
|
||||||
|
StateInitialCellComponent
|
||||||
|
} from "./editor/gamesystem-editor/state-editor/simple-state-editor/state-initial-cell/state-initial-cell.component";
|
||||||
|
|
||||||
// AoT requires an exported function for factories
|
// AoT requires an exported function for factories
|
||||||
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
||||||
@ -103,71 +106,72 @@ const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new Transl
|
|||||||
ScriptaccountConditionEditorComponent,
|
ScriptaccountConditionEditorComponent,
|
||||||
CharacterOverviewComponent,
|
CharacterOverviewComponent,
|
||||||
CharacterEditorComponent,
|
CharacterEditorComponent,
|
||||||
TemplateSpecificatorComponent
|
TemplateSpecificatorComponent,
|
||||||
],
|
StateInitialCellComponent
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
FormsModule,
|
|
||||||
HttpClientModule,
|
|
||||||
CoreModule,
|
|
||||||
SharedModule,
|
|
||||||
TranslateModule.forRoot({
|
|
||||||
loader: {
|
|
||||||
provide: TranslateLoader,
|
|
||||||
useFactory: httpLoaderFactory,
|
|
||||||
deps: [HttpClient]
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
BrowserAnimationsModule,
|
|
||||||
MatIcon,
|
|
||||||
MatToolbar,
|
|
||||||
MatButton,
|
|
||||||
MatFormField,
|
|
||||||
MatInput,
|
|
||||||
MatDrawerContainer,
|
|
||||||
MatDrawer,
|
|
||||||
MatIconButton,
|
|
||||||
MatMenuTrigger,
|
|
||||||
MatMenu,
|
|
||||||
MatMenuItem,
|
|
||||||
MatListItem,
|
|
||||||
MatActionList,
|
|
||||||
MatTabGroup,
|
|
||||||
MatTab,
|
|
||||||
MatTabLabel,
|
|
||||||
MatLabel,
|
|
||||||
MatFormField,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
MatError,
|
|
||||||
MatDialogTitle,
|
|
||||||
MatDialogContent,
|
|
||||||
MatDialogActions,
|
|
||||||
MatMiniFabButton,
|
|
||||||
MatTreeModule,
|
|
||||||
MatTable,
|
|
||||||
MatColumnDef,
|
|
||||||
MatHeaderCell,
|
|
||||||
MatHeaderCellDef,
|
|
||||||
MatCellDef,
|
|
||||||
MatCell,
|
|
||||||
MatHeaderRow,
|
|
||||||
MatRow,
|
|
||||||
MatHeaderRowDef,
|
|
||||||
MatRowDef,
|
|
||||||
MatCheckbox,
|
|
||||||
MatSelect,
|
|
||||||
MatOption,
|
|
||||||
MatHint,
|
|
||||||
MatTooltip,
|
|
||||||
MatCard,
|
|
||||||
MatCardContent,
|
|
||||||
MatCardHeader,
|
|
||||||
MatAccordion,
|
|
||||||
MatExpansionPanel,
|
|
||||||
MatExpansionPanelTitle,
|
|
||||||
MatCardTitle,
|
|
||||||
MatExpansionPanelHeader
|
|
||||||
],
|
],
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
FormsModule,
|
||||||
|
HttpClientModule,
|
||||||
|
CoreModule,
|
||||||
|
SharedModule,
|
||||||
|
TranslateModule.forRoot({
|
||||||
|
loader: {
|
||||||
|
provide: TranslateLoader,
|
||||||
|
useFactory: httpLoaderFactory,
|
||||||
|
deps: [HttpClient]
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
MatIcon,
|
||||||
|
MatToolbar,
|
||||||
|
MatButton,
|
||||||
|
MatFormField,
|
||||||
|
MatInput,
|
||||||
|
MatDrawerContainer,
|
||||||
|
MatDrawer,
|
||||||
|
MatIconButton,
|
||||||
|
MatMenuTrigger,
|
||||||
|
MatMenu,
|
||||||
|
MatMenuItem,
|
||||||
|
MatListItem,
|
||||||
|
MatActionList,
|
||||||
|
MatTabGroup,
|
||||||
|
MatTab,
|
||||||
|
MatTabLabel,
|
||||||
|
MatLabel,
|
||||||
|
MatFormField,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
MatError,
|
||||||
|
MatDialogTitle,
|
||||||
|
MatDialogContent,
|
||||||
|
MatDialogActions,
|
||||||
|
MatMiniFabButton,
|
||||||
|
MatTreeModule,
|
||||||
|
MatTable,
|
||||||
|
MatColumnDef,
|
||||||
|
MatHeaderCell,
|
||||||
|
MatHeaderCellDef,
|
||||||
|
MatCellDef,
|
||||||
|
MatCell,
|
||||||
|
MatHeaderRow,
|
||||||
|
MatRow,
|
||||||
|
MatHeaderRowDef,
|
||||||
|
MatRowDef,
|
||||||
|
MatCheckbox,
|
||||||
|
MatSelect,
|
||||||
|
MatOption,
|
||||||
|
MatHint,
|
||||||
|
MatTooltip,
|
||||||
|
MatCard,
|
||||||
|
MatCardContent,
|
||||||
|
MatCardHeader,
|
||||||
|
MatAccordion,
|
||||||
|
MatExpansionPanel,
|
||||||
|
MatExpansionPanelTitle,
|
||||||
|
MatCardTitle,
|
||||||
|
MatExpansionPanelHeader
|
||||||
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
|
@ -39,12 +39,7 @@
|
|||||||
<ng-container matColumnDef="initial">
|
<ng-container matColumnDef="initial">
|
||||||
<th mat-header-cell *matHeaderCellDef>Initial</th>
|
<th mat-header-cell *matHeaderCellDef>Initial</th>
|
||||||
<td mat-cell *matCellDef="let state">
|
<td mat-cell *matCellDef="let state">
|
||||||
<div *ngIf="editedElement !== state">
|
<app-state-initial-cell [templateElement]="templateElement" [editedState]="editedElement" [state]="state"></app-state-initial-cell>
|
||||||
<mat-icon *ngIf="state.initial">done</mat-icon>
|
|
||||||
<mat-icon *ngIf="!state.initial">close</mat-icon>
|
|
||||||
</div>
|
|
||||||
<mat-checkbox *ngIf="editedElement === state" [(ngModel)]="state.initial" (ngModelChange)="onStateChange()"></mat-checkbox>
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -35,11 +35,14 @@ export class SimpleStateEditorComponent implements OnInit{
|
|||||||
|
|
||||||
editedStateLabelError: boolean = false;
|
editedStateLabelError: boolean = false;
|
||||||
|
|
||||||
|
testState: SimpleState | undefined = undefined
|
||||||
|
|
||||||
constructor(private snackbar: MatSnackBar) {
|
constructor(private snackbar: MatSnackBar) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.dataSource.data = this.states;
|
this.dataSource.data = this.states;
|
||||||
|
this.testState = this.states[0]
|
||||||
this.dataSource.filterPredicate = (data: SimpleState, filter: string) => {
|
this.dataSource.filterPredicate = (data: SimpleState, filter: string) => {
|
||||||
return data.stateLabel.toLowerCase().includes(filter);
|
return data.stateLabel.toLowerCase().includes(filter);
|
||||||
}
|
}
|
||||||
@ -127,4 +130,6 @@ export class SimpleStateEditorComponent implements OnInit{
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,12 @@ import {ScriptAccountCondition} from "../../gamesystems/conditions/ScriptAccount
|
|||||||
export class SimpleTemplateState extends SimpleState {
|
export class SimpleTemplateState extends SimpleState {
|
||||||
|
|
||||||
conditionMap: Map<TemplateElement, ScriptAccountCondition[]> = new Map();
|
conditionMap: Map<TemplateElement, ScriptAccountCondition[]> = new Map();
|
||||||
|
initialMap: Map<TemplateElement, boolean> = new Map<TemplateElement, boolean>();
|
||||||
|
|
||||||
addTemplateElement(templateElement: TemplateElement) {
|
addTemplateElement(templateElement: TemplateElement) {
|
||||||
if(!this.conditionMap.has(templateElement)) {
|
if(!this.conditionMap.has(templateElement)) {
|
||||||
this.conditionMap.set(templateElement, this.conditions)
|
this.conditionMap.set(templateElement, this.conditions)
|
||||||
|
this.initialMap.set(templateElement, this.initial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user