refactor application.yaml to become an os definition #40

This commit is contained in:
undergroundwires
2020-09-08 21:47:18 +01:00
parent e4b6cdfb18
commit f7557bcc0f
62 changed files with 1926 additions and 573 deletions

View File

@@ -32,8 +32,8 @@ export default class CardList extends StatefulVue {
public activeCategoryId?: number = null;
public async mounted() {
const state = await this.getCurrentStateAsync();
this.setCategories(state.app.actions);
const context = await this.getCurrentContextAsync();
this.setCategories(context.app.actions);
this.onOutsideOfActiveCardClicked((element) => {
if (hasDirective(element)) {
return;

View File

@@ -69,8 +69,8 @@ export default class CardListItem extends StatefulVue {
}
public async mounted() {
const state = await this.getCurrentStateAsync();
state.selection.changed.on(() => {
const context = await this.getCurrentContextAsync();
context.state.selection.changed.on(() => {
this.updateStateAsync(this.categoryId);
});
this.updateStateAsync(this.categoryId);
@@ -78,11 +78,12 @@ export default class CardListItem extends StatefulVue {
@Watch('categoryId')
public async updateStateAsync(value: |number) {
const state = await this.getCurrentStateAsync();
const category = !value ? undefined : state.app.findCategory(this.categoryId);
const context = await this.getCurrentContextAsync();
const category = !value ? undefined : context.app.findCategory(this.categoryId);
this.cardTitle = category ? category.name : undefined;
this.isAnyChildSelected = category ? state.selection.isAnySelected(category) : false;
this.areAllChildrenSelected = category ? state.selection.areAllSelected(category) : false;
const currentSelection = context.state.selection;
this.isAnyChildSelected = category ? currentSelection.isAnySelected(category) : false;
this.areAllChildrenSelected = category ? currentSelection.areAllSelected(category) : false;
}
}