diff --git a/client/core/src/components/textfield/textfield.html b/client/core/src/components/textfield/textfield.html index 4f238c525..3c77c2ab8 100644 --- a/client/core/src/components/textfield/textfield.html +++ b/client/core/src/components/textfield/textfield.html @@ -23,7 +23,6 @@ translate-attr="{title: 'Clear'}" ng-show="!$ctrl.disabled && $ctrl.hasValue - && ($ctrl.hasFocus) && !$ctrl.unclearable" ng-click="$ctrl.clear()"> clear diff --git a/services/loopback/common/methods/ticket/isEditable.js b/services/loopback/common/methods/ticket/isEditable.js index 0edd3259d..ad3f6b7fd 100644 --- a/services/loopback/common/methods/ticket/isEditable.js +++ b/services/loopback/common/methods/ticket/isEditable.js @@ -20,9 +20,10 @@ module.exports = Self => { }); Self.isEditable = async ticketFk => { - let state = await Self.app.models.TicketState.findOne({where: {ticketFk: ticketFk}, fields: 'alertLevel'}); + let state = await Self.app.models.TicketState.findOne({where: {ticketFk: ticketFk}}); + let alertLevel = state ? state.alertLevel : null; let exists = await Self.app.models.Ticket.findOne({where: {id: ticketFk}, fields: 'isDeleted'}); - if (!exists || exists.isDeleted == 1 || state.alertLevel > 0) + if (!exists || exists.isDeleted == 1 || (alertLevel && alertLevel > 0)) return false; return true;