Skip to content

Commit

Permalink
AH - Fix label creation UI (#4510)
Browse files Browse the repository at this point in the history
* fix add label modal

* remove duplicate ngif
  • Loading branch information
kflemin authored Jan 29, 2024
1 parent aa41bf8 commit e761b02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ angular.module('BE.seed.controller.update_item_labels_modal', []).controller('up
// in this modal...
createdLabel.is_checked_add = true;

$scope.newLabelForm.$setPristine();
form.$setPristine();
$scope.labels.unshift(createdLabel);
$scope.initialize_new_label();
},
Expand Down
6 changes: 3 additions & 3 deletions seed/static/seed/js/services/simple_modal_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ angular.module('BE.seed.service.simple_modal', []).factory('simple_modal_service
// Map modal.html $scope custom properties to defaults defined in service
angular.extend(tempModalOptions, modalOptions, customModalOptions);

tempModalDefaults.controller = ($scope, $uibModalInstance) => {
tempModalDefaults.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {
$scope.modalOptions = tempModalOptions;
$scope.modalOptions.ok = () => {
$uibModalInstance.close(tempModalOptions.okResult);
};
$scope.modalOptions.cancel = () => {
$uibModalInstance.dismiss('cancel');
};
};

}];
return $uibModal.open(tempModalDefaults).result;
};

Expand All @@ -96,6 +95,7 @@ angular.module('BE.seed.service.simple_modal', []).factory('simple_modal_service
*/
function showModal(customModalOptions, customModalDefaults) {
if (customModalOptions && customModalOptions.type !== null) {

if (!_.includes(validModalTypes, customModalOptions.type)) {
throw new Error('Invalid modal type');
}
Expand Down

0 comments on commit e761b02

Please sign in to comment.