fix(dailyPlanner): fix task suggestions

This commit is contained in:
Johannes Millan 2017-11-24 15:40:30 +01:00
parent 662e66578a
commit f97afaa258
5 changed files with 10 additions and 9 deletions

View file

@ -24,7 +24,7 @@
placeholder="Select or create a task">
<md-item-template>
<span md-highlight-text="vm.newTaskTitle"
md-highlight-flags="^i">{{task.title}}</span>
md-highlight-flags="i">{{task.title}}</span>
</md-item-template>
</md-autocomplete>
</form>

View file

@ -30,6 +30,8 @@
const _ = $window._;
vm.refreshRemoteTasks = () => {
vm.taskSuggestions = [];
if (IS_ELECTRON && Jira.isSufficientJiraSettings()) {
Jira.checkForNewAndAddToBacklog();
@ -49,9 +51,12 @@
}
};
vm.getFilteredTaskSuggestions = (searchText) => {
return searchText ? $filter('filter')(vm.taskSuggestions, searchText, false, 'title') : vm.taskSuggestions;
};
vm.init = () => {
vm.limitBacklogTo = 3;
vm.taskSuggestions = [];
vm.backlogTasks = Tasks.getBacklog();
vm.isRemoteTasks = (IS_ELECTRON && Jira.isSufficientJiraSettings() || $rootScope.r.git.isAutoImportToBacklog);
@ -59,10 +64,6 @@
};
vm.init();
vm.getFilteredTaskSuggestions = (searchText) => {
return searchText ? $filter('filter')(vm.taskSuggestions, searchText, false, 'title') : vm.taskSuggestions;
};
vm.addTask = () => {
if (vm.newTask) {
if (vm.newTask.originalType && vm.newTask.originalType === 'GITHUB' && $rootScope.r.git.isShowIssuesFromGit) {

View file

@ -81,7 +81,7 @@
placeholder="Select task">
<md-item-template>
<span md-highlight-text="vm.searchTaskText"
md-highlight-flags="^i">{{ task.title }}</span>
md-highlight-flags="i">{{ task.title }}</span>
</md-item-template>
<md-not-found>
No task found

View file

@ -19,7 +19,7 @@
placeholder="Select a task to start with">
<md-item-template>
<span md-highlight-text="vm.searchText"
md-highlight-flags="^i">{{ task.title }}</span>
md-highlight-flags="i">{{ task.title }}</span>
</md-item-template>
<md-not-found>
No states matching "<span ng-bind="vm.searchText"></span>" were found.

View file

@ -31,7 +31,7 @@
placeholder="Select a task to track the time">
<md-item-template>
<span md-highlight-text="vm.searchText"
md-highlight-flags="^i"
md-highlight-flags="i"
ng-bind="task.title"></span>
</md-item-template>
<md-not-found>