From be4b5c81b2fa22cc99092337caa9f5b066c3ef4d Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Thu, 15 Aug 2019 13:53:30 +0200 Subject: [PATCH] ixed that the delete button not always deleted the currently selected equipment item (fixes #307) --- changelog/52_UNRELEASED_2019-xx-xx.md | 3 +++ localization/strings.pot | 3 +++ public/viewjs/equipment.js | 2 ++ 3 files changed, 8 insertions(+) diff --git a/changelog/52_UNRELEASED_2019-xx-xx.md b/changelog/52_UNRELEASED_2019-xx-xx.md index 40b2c1fe..10c3717b 100644 --- a/changelog/52_UNRELEASED_2019-xx-xx.md +++ b/changelog/52_UNRELEASED_2019-xx-xx.md @@ -2,11 +2,14 @@ - You can now print a "Location Content Sheet" with the current stock per location - new button at the top of the stock overview page - Chores improvements - New option "Due date rollover" per chore which means the chore can never be overdue, the due date will shift forward each day when due +- Equipment improvements/fixes + - Fixed that the delete button not always deleted the currently selected equipment item - General improvements/fixes - Improved the handling which entry page to use with disabled feature flags (thanks @nielstholenaar) - Fixed that the Userfield type "Preset list" had always the caption "Product group" instead of the configured one (thanks @oncleben31) - API improvements - New endpoint `/stock/shoppinglist/remove-product` to remove a product from a shopping list (thanks @Forceu) - When adding a product (through `stock/product/{productId}/add` or `stock/product/{productId}/inventory`) with omitted best before date and if the given product has "Default best before days" set, the best before date is calculated based on that (so far always today was used which is still the case when no date is supplied and also the product has no "Default best before days set) (thanks @Forceu) + - Field `stock_amount` of endpoint `/stock/products/{productId}ยด now returns `0` instead of `null` when the given product is not in stock (thanks @Forceu) - New endpoint `/objects/{entity}/search/{searchString}` search for objects by name (contains search) - It's now also possible to provide the API key via a query parameter (same name as the header, so `GROCY-API-KEY`) diff --git a/localization/strings.pot b/localization/strings.pot index 0c52a459..74edb084 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1313,3 +1313,6 @@ msgstr "" msgid "Time of printing" msgstr "" + +msgid "Are you sure to delete equipment \"%s\"?" +msgstr "" diff --git a/public/viewjs/equipment.js b/public/viewjs/equipment.js index 9fc7ea50..6392aba5 100644 --- a/public/viewjs/equipment.js +++ b/public/viewjs/equipment.js @@ -41,6 +41,8 @@ function DisplayEquipment(id) $(".selected-equipment-name").text(equipmentItem.name); $("#description-tab-content").html(equipmentItem.description); $(".equipment-edit-button").attr("href", U("/equipment/" + equipmentItem.id.toString())); + $(".equipment-delete-button").attr("data-equipment-id", equipmentItem.id); + $(".equipment-delete-button").attr("data-equipment-name", equipmentItem.name); if (equipmentItem.instruction_manual_file_name !== null && !equipmentItem.instruction_manual_file_name.isEmpty()) {