Skip to content

Commit b1fc268

Browse files
committed
Ajustes bug
1 parent 0fdb369 commit b1fc268

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

dist/lets.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controllers/lets-crud-edit-detail.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
var module = angular.module('letsAngular');
55

6-
module.controller('CRUDEditDetailController', function ($scope, $controller, Restangular, $stateParams, $timeout, headers, $rootScope, $modalInstance, ngToast) {
6+
module.controller('CRUDEditDetailController', function ($scope, $controller, Restangular, headers, $rootScope, $modalInstance) {
77
$controller('CRUDEditController', {$scope:$scope, module:module});
88

99
$scope.headers = headers;

src/controllers/lets-crud-form-modal.controller.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,22 @@
2020
}
2121
}
2222

23-
$scope.fetchData();
24-
2523
$scope.cancel = function () {
2624
$modalInstance.dismiss('cancel');
2725
}
2826

2927
$scope.submit = function () {
3028
if (this.crudForm.$valid) {
3129
$modalInstance.close($scope.data);
32-
} else {
33-
fwErrorService.emitFormErrors(this.crudForm)
3430
}
3531
};
3632

3733
$rootScope.$on('cancel-modal', function (event, res) {
3834
$modalInstance.dismiss('cancel');
3935
});
4036

37+
$scope.fetchData();
38+
4139
});
4240

4341
})();

src/directives/crud/lets-crud-list-table.directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
}
7979
}
8080
}else{
81-
if (record[field.name]){
81+
if (record[field.name]!==null && record[field.name]!==undefined){
8282
return record[field.name];
8383
}
8484
}
@@ -151,7 +151,7 @@
151151

152152
if($scope.sort.sortKey){
153153
var fld = headers.get($scope.sort.sortKey);
154-
if (fld.autocomplete && !fld.customOptions.list){
154+
if (fld && fld.autocomplete && !fld.customOptions.list){
155155
queries.sort_by +=".label";
156156
}
157157
}

src/views/crud/crud-form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
<tab ng-if="data.id != null && !tab.hide" ng-repeat="(tab_name, tab) in headers.tabs" heading="{{tab.label}}">
5050
<div ng-if="tab.fields && !tab.templateUrl">
51-
<section ng-if="!tab.new_grid" grid="{{tab_name}}" crud-list crud-list-settings="{url: headers.route + '/details/' + data.id + '/' + tab_name, fields: tab.fields, tab: true, settings: (tab.settings || headers.settings), filterScope: tab.filterScope, sort:tab.sort, tableClass: tab.tableClass}">
51+
<section ng-if="!appSettings.NEW_GRID && !tab.new_grid" grid="{{tab_name}}" crud-list crud-list-settings="{url: headers.route + '/details/' + data.id + '/' + tab_name, fields: tab.fields, tab: true, settings: (tab.settings || headers.settings), filterScope: tab.filterScope, sort:tab.sort, tableClass: tab.tableClass}">
5252

5353

5454
<div class="filter-tab" style="margin-top: 15px;">
@@ -80,7 +80,7 @@
8080
</div>
8181
</section>
8282

83-
<section ng-if="tab.new_grid" grid="{{tab_name}}" crud-list-table settings="{headers:tab, tab:true, url:headers.route+'/details/'+data.id+'/'+tab_name, getscope:getscope, tab_name:tab_name}"></section>
83+
<section ng-if="appSettings.NEW_GRID || tab.new_grid" grid="{{tab_name}}" crud-list-table settings="{headers:tab, tab:true, url:headers.route+'/details/'+data.id+'/'+tab_name, getscope:getscope, tab_name:tab_name}"></section>
8484
</div>
8585
<div ng-if="tab.templateUrl">
8686
<ng-include src="tab.templateUrl"></ng-include>

src/views/crud/crud-list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<a class="btn btn-primary outline-btn btn-block btn-new" ng-disabled="export_btn_is_disable" ng-click="export()"><span class="icon fa fa-share"></span>Exportar Dados</a>
1010
</div>
1111
</div>
12-
<section ng-if="!headers.new_grid" grid="main" class="widget" crud-list crud-list-settings="{url: headers.route, fields: headers.fields, tab: false, settings: headers.settings, filterScope: headers.settings.filterScope, sort:headers.settings.sort, tableClass: headers.tableClass}">
12+
<section ng-if="!appSettings.NEW_GRID && !headers.new_grid" grid="main" class="widget" crud-list crud-list-settings="{url: headers.route, fields: headers.fields, tab: false, settings: headers.settings, filterScope: headers.settings.filterScope, sort:headers.settings.sort, tableClass: headers.tableClass}">
1313
<header class='crud-list-header row hidden-xs' style='display: flex;'>
1414
<h4>{{headers.label}}</h4>
1515
</header>
@@ -21,4 +21,4 @@ <h4>{{headers.label}}</h4>
2121
</div>
2222
</section>
2323

24-
<section ng-if="headers.new_grid" grid="main" class="widget" crud-list-table settings="{headers:headers, tab:false}"></section>
24+
<section ng-if="appSettings.NEW_GRID || headers.new_grid" grid="main" class="widget" crud-list-table settings="{headers:headers, tab:false}"></section>

0 commit comments

Comments
 (0)