Skip to content

Commit

Permalink
upgraded anhular-ui-routing
Browse files Browse the repository at this point in the history
  • Loading branch information
alirizaadiyahsi committed Feb 19, 2018
1 parent b3caeb1 commit 43a8199
Show file tree
Hide file tree
Showing 14 changed files with 12,056 additions and 5,710 deletions.
Expand Up @@ -14,8 +14,8 @@

//Configuration for Angular UI routing.
app.config([
'$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
'$stateProvider', '$urlRouterProvider', '$qProvider',
function ($stateProvider, $urlRouterProvider, $qProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('tasklist', {
Expand All @@ -28,6 +28,9 @@
templateUrl: '/App/Main/views/task/new.cshtml',
menu: 'NewTask' //Matches to name of 'NewTask' menu in SimpleTaskSystemNavigationProvider
});

//$qProvider settings
$qProvider.errorOnUnhandledRejections(false);
}
]);
})();
@@ -1,10 +1,10 @@
(function() {
(function () {
var app = angular.module('app');

var controllerId = 'sts.views.task.list';
app.controller(controllerId, [
'$scope', 'abp.services.tasksystem.task',
function($scope, taskService) {
function ($scope, taskService) {
var vm = this;

vm.localize = abp.localization.getSource('SimpleTaskSystem');
Expand All @@ -13,22 +13,22 @@

$scope.selectedTaskState = 0;

$scope.$watch('selectedTaskState', function(value) {
$scope.$watch('selectedTaskState', function (value) {
vm.refreshTasks();
});

vm.refreshTasks = function() {
vm.refreshTasks = function () {
abp.ui.setBusy( //Set whole page busy until getTasks complete
null,
taskService.getTasks({ //Call application service method directly from javascript
state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
}).success(function(data) {
vm.tasks = data.tasks;
}).then(function (data) {
vm.tasks = data.data.tasks;
})
);
};

vm.changeTaskState = function(task) {
vm.changeTaskState = function (task) {
var newState;
if (task.state == 1) {
newState = 2; //Completed
Expand All @@ -39,13 +39,13 @@
taskService.updateTask({
taskId: task.id,
state: newState
}).success(function() {
}).then(function () {
task.state = newState;
abp.notify.info(vm.localize('TaskUpdatedMessage'));
});
};

vm.getTaskCountText = function() {
vm.getTaskCountText = function () {
return abp.utils.formatString(vm.localize('Xtasks'), vm.tasks.length);
};
}
Expand Down
Expand Up @@ -16,16 +16,16 @@

vm.people = []; //TODO: Move Person combo to a directive?

personService.getAllPeople().success(function(data) {
vm.people = data.people;
personService.getAllPeople().then(function(data) {
vm.people = data.data.people;
});

vm.saveTask = function() {
abp.ui.setBusy(
null,
taskService.createTask(
vm.task
).success(function() {
).then(function() {
abp.notify.info(abp.utils.formatString(localize("TaskCreatedMessage"), vm.task.description));
$location.path('/');
})
Expand Down
Expand Up @@ -25,7 +25,7 @@ public override void SetNavigation(INavigationProviderContext context)
new MenuItemDefinition(
"NewTask",
new LocalizableString("NewTask", SimpleTaskSystemConsts.LocalizationSourceName),
url: "#/new",
url: "#!/new",
icon: "fa fa-asterisk"
)
);
Expand Down
Expand Up @@ -3,4 +3,113 @@
.ng-animate.item:not(.left):not(.right) {
-webkit-transition: 0s ease-in-out left;
transition: 0s ease-in-out left
}
}
.uib-datepicker .uib-title {
width: 100%;
}

.uib-day button, .uib-month button, .uib-year button {
min-width: 100%;
}

.uib-left, .uib-right {
width: 100%
}

.uib-position-measure {
display: block !important;
visibility: hidden !important;
position: absolute !important;
top: -9999px !important;
left: -9999px !important;
}

.uib-position-scrollbar-measure {
position: absolute !important;
top: -9999px !important;
width: 50px !important;
height: 50px !important;
overflow: scroll !important;
}

.uib-position-body-scrollbar-measure {
overflow: scroll !important;
}
.uib-datepicker-popup.dropdown-menu {
display: block;
float: none;
margin: 0;
}

.uib-button-bar {
padding: 10px 9px 2px;
}

[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,
[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,
[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,
[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,
[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,
[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,
[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,
[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,
[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,
[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,
[uib-popover-popup].popover.top-left > .arrow,
[uib-popover-popup].popover.top-right > .arrow,
[uib-popover-popup].popover.bottom-left > .arrow,
[uib-popover-popup].popover.bottom-right > .arrow,
[uib-popover-popup].popover.left-top > .arrow,
[uib-popover-popup].popover.left-bottom > .arrow,
[uib-popover-popup].popover.right-top > .arrow,
[uib-popover-popup].popover.right-bottom > .arrow,
[uib-popover-html-popup].popover.top-left > .arrow,
[uib-popover-html-popup].popover.top-right > .arrow,
[uib-popover-html-popup].popover.bottom-left > .arrow,
[uib-popover-html-popup].popover.bottom-right > .arrow,
[uib-popover-html-popup].popover.left-top > .arrow,
[uib-popover-html-popup].popover.left-bottom > .arrow,
[uib-popover-html-popup].popover.right-top > .arrow,
[uib-popover-html-popup].popover.right-bottom > .arrow,
[uib-popover-template-popup].popover.top-left > .arrow,
[uib-popover-template-popup].popover.top-right > .arrow,
[uib-popover-template-popup].popover.bottom-left > .arrow,
[uib-popover-template-popup].popover.bottom-right > .arrow,
[uib-popover-template-popup].popover.left-top > .arrow,
[uib-popover-template-popup].popover.left-bottom > .arrow,
[uib-popover-template-popup].popover.right-top > .arrow,
[uib-popover-template-popup].popover.right-bottom > .arrow {
top: auto;
bottom: auto;
left: auto;
right: auto;
margin: 0;
}

[uib-popover-popup].popover,
[uib-popover-html-popup].popover,
[uib-popover-template-popup].popover {
display: block !important;
}

.uib-time input {
width: 50px;
}

[uib-typeahead-popup].dropdown-menu {
display: block;
}

0 comments on commit 43a8199

Please sign in to comment.