diff --git a/MMM-MealieMenu.css b/MMM-MealieMenu.css index fafd05e..8a3e7b3 100644 --- a/MMM-MealieMenu.css +++ b/MMM-MealieMenu.css @@ -46,7 +46,7 @@ "meal-header" "meal-name" "meal-description"; - gap: 0 0; + gap: 0; grid-area: meal-info; text-align: left; line-height: 24px; diff --git a/MMM-MealieMenu.js b/MMM-MealieMenu.js index 436832f..b9881f8 100644 --- a/MMM-MealieMenu.js +++ b/MMM-MealieMenu.js @@ -254,7 +254,8 @@ Module.register("MMM-MealieMenu", { weekStartsOnMonday: this.config.weekStartsOnMonday, currentWeek: this.config.currentWeek, dayLimit: this.config.dayLimit, - priorDayLimit: this.config.priorDayLimit + priorDayLimit: this.config.priorDayLimit, + mealSortOrder: this.config.mealSortOrder }); }, @@ -265,9 +266,6 @@ Module.register("MMM-MealieMenu", { const today = moment().startOf("day"); const {mealSortOrder} = this.config; - // Filter meal types not in mealSortOrder. - meals.filter((meal) => mealSortOrder.includes(meal.entryType)); - // Sort by date ascending, then by meal type order (can be user defined). // eslint-disable-next-line id-length meals.sort((a, b) => { diff --git a/eslint.config.js b/eslint.config.js index 94da9c2..0db158c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -29,7 +29,7 @@ const config = [ "max-lines-per-function": ["error", 120], "max-lines": "off", "max-params": "off", - "max-statements": ["error", 30], + "max-statements": ["error", 40], "multiline-comment-style": "off", "no-await-in-loop": "off", "no-inline-comments": "off", diff --git a/node_helper.js b/node_helper.js index 2693969..ca507df 100644 --- a/node_helper.js +++ b/node_helper.js @@ -144,8 +144,16 @@ module.exports = NodeHelper.create({ if (payload.groupId) { params.append("group_id", payload.groupId); } + if (payload.mealSortOrder && payload.mealSortOrder.length > 0) { + const mealSortOrder = payload.mealSortOrder.join("\", \""); + const entryType = `entryType in ["${mealSortOrder}"]`; + params.append("queryFilter", entryType); + } + url.search = params.toString(); + Log.debug(`[${this.name}] API Mealplan query: ${url.search}`); + // Get the full list of meals from Mealie. fetch(url, { method: "GET",