Commit 820fe3f4 authored by Evren Kutar's avatar Evren Kutar

version tag 0.6.1

resolves #58
resolves #54
parent 8becd820
0.6.0 0.6.1
\ No newline at end of file \ No newline at end of file
...@@ -45,13 +45,13 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -45,13 +45,13 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
id: scope.param_id || routeParams.param_id, id: scope.param_id || routeParams.param_id,
wf: routeParams.wf, wf: routeParams.wf,
object_id: routeParams.key, object_id: routeParams.key,
filters: [] filters: {}
}; };
if (scope.param_id) { if (scope.param_id) {
scope.form_params.filters.push({field: scope.param, values: [scope.param_id], type: 'check'}); scope.form_params.filters[scope.param] = {values: [scope.param_id], type: 'check'};
// do not use selected user, get and broadcast data of user in param_id // do not use selected user, get and broadcast data of user in param_id
$rootScope.$broadcast('selectedUserTrigger', [scope.param, scope.param_id]); //$rootScope.$broadcast('selectedUserTrigger', [scope.param, scope.param_id]);
} }
scope.model = scope.form_params.model; scope.model = scope.form_params.model;
...@@ -277,26 +277,40 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -277,26 +277,40 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
} }
}) })
.directive('crudFilters', function() { .directive('crudFilters', function(Generator) {
return { return {
templateUrl: 'components/crud/templates/filter.html', templateUrl: 'components/crud/templates/filter.html',
restrict: 'E', restrict: 'E',
replace: true, replace: true,
link: function ($scope) { link: function ($scope) {
$scope.filters = {}; $scope.form_params.filters = $scope.form_params.filters || {};
angular.forEach($scope.listFilters, function (value, key) { $scope.filterList = {};
$scope.filters[value.field] = {field: value.field, values: [], type: value.type}; $scope.$watch('list_filters', function () {
//if (value.type === 'date') { angular.forEach($scope.list_filters, function (value, key) {
// $scope.form_params.filters.push({field: value.field, values: [$scope.filterStartDate, $scope.filterEndDate], type: value.type}); $scope.filterList[value.field] = {values: value.values || [], type: value.type};
//} });
}); });
$scope.filterStartDate;
$scope.filterEndDate;
$scope.status = {startOpened: false, endOpened: false}; $scope.status = {startOpened: false, endOpened: false};
$scope.dateFilterOpen = function ($event, which) { $scope.dateFilterOpen = function ($event, which) {
this.status[which] = true; this.status[which] = true;
}; };
$scope.format = 'dd.MM.yyyy' $scope.format = 'dd.MM.yyyy';
$scope.filterSubmit = function () {
angular.forEach($scope.filterList, function (value, key) {
if (value.model) {
if (value.type === 'date') {
var dateValues = [null, null];
angular.forEach(value.model, function (v, k) {
dateValues[k] = Generator.dateformatter(v);
});
$scope.form_params.filters[key] = {values: dateValues, type: value.type};
} else {
$scope.form_params.filters[key] = {values: Object.keys(value.model), type: value.type || 'check'};
}
}
});
Generator.get_wf($scope);
}
} }
}; };
}) })
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<div ng-if="filter.type==='check' || !filter.type"> <div ng-if="filter.type==='check' || !filter.type">
<div class="checkbox" ng-repeat="filterItem in filter.values"> <div class="checkbox" ng-repeat="filterItem in filter.values">
<label class="checkbox-inline"> <label class="checkbox-inline">
<input type="checkbox" name="filter_group[]" value="{{filterItem.value}}"/> <input type="checkbox" name="filter_group[]" ng-model="filterList[filter.field].model[filterItem.value]"
value="{{filterItem.value}}"/>
{{filterItem.name}} {{filterItem.name}}
</label> </label>
</div> </div>
...@@ -36,7 +37,8 @@ ...@@ -36,7 +37,8 @@
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</button> </button>
</span> </span>
<input type="text" name="startDate" class="form-control" ng-model="filterStartDate" <input type="text" name="startDate" class="form-control"
ng-model="filterList[filter.field].model[0]"
uib-datepicker-popup="{{format}}" uib-datepicker-popup="{{format}}"
is-open="status.startOpened" is-open="status.startOpened"
close-text="Kapat" close-text="Kapat"
...@@ -53,7 +55,8 @@ ...@@ -53,7 +55,8 @@
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</button> </button>
</span> </span>
<input type="text" name="endDate" class="form-control" ng-model="filterEndDate" <input type="text" name="endDate" class="form-control"
ng-model="filterList[filter.field].model[1]"
uib-datepicker-popup="{{format}}" uib-datepicker-popup="{{format}}"
is-open="status.endOpened" is-open="status.endOpened"
close-text="Kapat" close-text="Kapat"
......
...@@ -5,4 +5,4 @@ angular.module('ulakbus.version', [ ...@@ -5,4 +5,4 @@ angular.module('ulakbus.version', [
'ulakbus.version.version-directive' 'ulakbus.version.version-directive'
]) ])
.value('version', '0.6.0'); .value('version', '0.6.1');
...@@ -5,7 +5,7 @@ describe('ulakbus.version module', function() { ...@@ -5,7 +5,7 @@ describe('ulakbus.version module', function() {
describe('version service', function() { describe('version service', function() {
it('should return current version', inject(function(version) { it('should return current version', inject(function(version) {
expect(version).toEqual('0.6.0'); expect(version).toEqual('0.6.1');
})); }));
}); });
}); });
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
</div> </div>
</div> </div>
<alert-box></alert-box>
<script src="bower_components/angular/angular.min.js"></script> <script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-i18n/angular-locale_tr.js"></script> <script src="bower_components/angular-i18n/angular-locale_tr.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script> <script src="bower_components/jquery/dist/jquery.min.js"></script>
......
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
</div> </div>
</div> </div>
<alert-box></alert-box>
<!-- @if NODE_ENV == 'DEVELOPMENT' --> <!-- @if NODE_ENV == 'DEVELOPMENT' -->
<script src="bower_components/angular/angular.min.js"></script> <script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-i18n/angular-locale_tr.js"></script> <script src="bower_components/angular-i18n/angular-locale_tr.js"></script>
......
...@@ -473,6 +473,27 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -473,6 +473,27 @@ app.directive('logout', function ($http, $location, RESTURL) {
}; };
}) })
/**
* alert directive
*/
.directive('alertBox', function ($timeout) {
return {
templateUrl: 'shared/templates/directives/alert.html',
restrict: 'E',
replace: true,
link: function ($scope) {
$scope.$on('alertBox', function ($event, data) {
$timeout(function () {
delete $scope.alerts;
}, 5000);
$scope.alerts = [data];
});
}
};
})
/** /**
* search directive in sidebar * search directive in sidebar
*/ */
......
<div ng-repeat="alert in alerts" style="position: fixed; top:70px; right:20px; z-index: 999;">
<div class="alert" ng-class="{'info':'alert-info', 'error': 'alert-danger', 'warning': 'alert-warning'}[alert.type]">
<b>
{{alert.title}}
</b>
<p>{{alert.msg}}</p>
</div>
</div>
\ No newline at end of file
...@@ -14,70 +14,4 @@ ...@@ -14,70 +14,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
<!--<div class="row">-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-primary">-->
<!--<div class="panel-heading">-->
<!--Primary Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-green">-->
<!--<div class="panel-heading">-->
<!--Success Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.col-lg-4 &ndash;&gt;-->
<!--</div>-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-yellow">-->
<!--<div class="panel-heading">-->
<!--Warning Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.col-lg-4 &ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--<div class="row">-->
<!--<div class="col-lg-4">-->
<!--<div class="panel panel-red">-->
<!--<div class="panel-heading">-->
<!--Danger Panel-->
<!--</div>-->
<!--<div class="panel-body">-->
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt est vitae ultrices accumsan. Aliquam ornare lacus adipiscing, posuere lectus et, fringilla augue.</p>-->
<!--</div>-->
<!--<div class="panel-footer">-->
<!--Panel Footer-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.col-lg-4 &ndash;&gt;-->
<!--</div>-->
<!--</div>-->
\ No newline at end of file
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
<!--Hepsini Seç--> <!--Hepsini Seç-->
<!--</label>--> <!--</label>-->
</th> </th>
<th ng-repeat="(key,value) in node.items track by $index" ng-if="key!=='idx' && $index === 0">{{ value.verbose_name }}</th> <th ng-repeat="(key,value) in node.items track by $index" ng-if="key!=='idx' && $index === 0">
<span ng-if="value.verbose_name">{{ value.verbose_name }}</span>
<span ng-if="!value.verbose_name">{{value[0].key}}</span>
</th>
<th>İşlem</th> <th>İşlem</th>
</tr> </tr>
</thead> </thead>
......
...@@ -866,14 +866,21 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -866,14 +866,21 @@ angular.module('formService', ['ui.bootstrap'])
//} //}
} }
}); });
} else {
reformattedModel[key] = {
"key": key,
"unicode": value
};
} }
}); });
if (childmodel.edit) { if (childmodel.edit) {
listNodeItem.model[childmodel.edit] = childmodel.model; listNodeItem.model[childmodel.edit] = childmodel.model;
} else { } else {
listNodeItem.model.push(angular.copy(childmodel.model)); listNodeItem.model.push(angular.copy(childmodel.model));
if (reformattedModel !== {}) { if (Object.keys(reformattedModel).length > 0) {
listNodeItem.items.push(reformattedModel); listNodeItem.items.push(reformattedModel);
} else {
listNodeItem.items.push(angular.copy(childmodel.model));
} }
} }
listNodeItem.lengthModels += 1; listNodeItem.lengthModels += 1;
......
...@@ -94,7 +94,7 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -94,7 +94,7 @@ app.config(['$httpProvider', function ($httpProvider) {
rejection.status = 'Sunucu hatası' rejection.status = 'Sunucu hatası'
rejection.data = {title: "", description : 'Sunucu bağlantısında bir hata oluştu.' + rejection.data = {title: "", description : 'Sunucu bağlantısında bir hata oluştu.' +
'Lütfen yetkili personelle iletişime geçiniz.'}; 'Lütfen yetkili personelle iletişime geçiniz.'};
errorModal(); $rootScope.$broadcast('alertBox', {title: rejection.status, msg: rejection.data.description, type: 'error'});
} }
if (rejection.status === 400) { if (rejection.status === 400) {
......
This diff is collapsed.
...@@ -59,6 +59,8 @@ ...@@ -59,6 +59,8 @@
</div> </div>
</div> </div>
<alert-box></alert-box>
<script src="bower_components/jquery.min.js"></script> <script src="bower_components/jquery.min.js"></script>
<script src="bower_components/jquery-ui.min.js"></script> <script src="bower_components/jquery-ui.min.js"></script>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment