feature/new-feature-cleanup (#389)

* add json editor to theme editor

* add toolbars tools to recipe sections

* fix recipe yield

* add updated_date to recipe schema

* update time cards

* fix mobile buttons

* fix asset URL

* fix PG errors CRUD

* remove -d from docker-pro

* fix theme tests

* remvoe old typing

* abstract count function

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-05-05 14:08:13 -08:00
committed by GitHub
parent c1370afb16
commit 1b0de02b71
34 changed files with 263 additions and 132 deletions

View File

@@ -5,9 +5,8 @@
title-icon=""
:sortable="true"
:title="$t('page.all-recipes')"
:recipes="allRecipes"
@sort="sortAZ"
@sort-recent="sortRecent"
:recipes="shownRecipes"
@sort="assignSorted"
/>
</v-container>
</template>
@@ -22,6 +21,7 @@ export default {
data() {
return {
loading: false,
sortedResults: [],
};
},
async mounted() {
@@ -35,13 +35,17 @@ export default {
allRecipes() {
return this.$store.getters.getAllRecipes;
},
shownRecipes() {
if (this.sortedResults.length > 0) {
return this.sortedResults;
} else {
return this.allRecipes;
}
},
},
methods: {
sortAZ() {
this.allRecipes.sort((a, b) => (a.name > b.name ? 1 : -1));
},
sortRecent() {
this.allRecipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1));
assignSorted(val) {
this.sortedResults = val;
},
},
};