search epics
parent
f60b411934
commit
f5db7a7a40
|
@ -76,6 +76,7 @@ urls = {
|
|||
"project-epics": "/project/:project/epics"
|
||||
"project-search": "/project/:project/search"
|
||||
|
||||
"project-epic-detail": "/project/:project/epic/:ref"
|
||||
"project-userstories-detail": "/project/:project/us/:ref"
|
||||
"project-tasks-detail": "/project/:project/task/:ref"
|
||||
"project-issues-detail": "/project/:project/issue/:ref"
|
||||
|
|
|
@ -765,6 +765,16 @@ module.directive("tgEditableWysiwyg", ["tgAttachmentsService", "tgAttachmentsFul
|
|||
## completely bindonce, they only serves for visualization of data.
|
||||
#############################################################################
|
||||
|
||||
ListItemEpicStatusDirective = ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
epic = $scope.$eval($attrs.tgListitemEpicStatus)
|
||||
bindOnce $scope, "epicStatusById", (epicStatusById) ->
|
||||
$el.html(epicStatusById[epic.status].name)
|
||||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgListitemEpicStatus", ListItemEpicStatusDirective)
|
||||
|
||||
ListItemUsStatusDirective = ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
us = $scope.$eval($attrs.tgListitemUsStatus)
|
||||
|
|
|
@ -88,6 +88,8 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
return @rs.projects.getBySlug(@params.pslug).then (project) =>
|
||||
@scope.project = project
|
||||
@scope.$emit('project:loaded', project)
|
||||
|
||||
@scope.epicStatusById = groupBy(project.epic_statuses, (x) -> x.id)
|
||||
@scope.issueStatusById = groupBy(project.issue_statuses, (x) -> x.id)
|
||||
@scope.taskStatusById = groupBy(project.task_statuses, (x) -> x.id)
|
||||
@scope.severityById = groupBy(project.severities, (x) -> x.id)
|
||||
|
@ -194,7 +196,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
|||
return selectedSection
|
||||
|
||||
if data
|
||||
for name in ["userstories", "issues", "tasks", "wikipages"]
|
||||
for name in ["userstories", "epics", "issues", "tasks", "wikipages"]
|
||||
value = data[name]
|
||||
|
||||
if value.length > maxVal
|
||||
|
@ -222,6 +224,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
|||
activeSectionName = section.name
|
||||
|
||||
templates = {
|
||||
epics: $templatecache.get("search-epics")
|
||||
issues: $templatecache.get("search-issues")
|
||||
tasks: $templatecache.get("search-tasks")
|
||||
userstories: $templatecache.get("search-userstories")
|
||||
|
|
|
@ -1388,6 +1388,7 @@
|
|||
"SEARCH": {
|
||||
"PAGE_TITLE": "Search - {{projectName}}",
|
||||
"PAGE_DESCRIPTION": "Search anything, user stories, issues, tasks or wiki pages, in the project {{projectName}}: {{projectDescription}}",
|
||||
"FILTER_EPICS": "Epics",
|
||||
"FILTER_USER_STORIES": "User Stories",
|
||||
"FILTER_ISSUES": "Issues",
|
||||
"FILTER_TASKS": "Tasks",
|
||||
|
|
|
@ -1,4 +1,13 @@
|
|||
ul.search-filter
|
||||
li.epics(data-name="epics")
|
||||
a(
|
||||
href="#"
|
||||
title="{{ 'SEARCH.FILTER_EPICS' | translate }}"
|
||||
)
|
||||
tg-svg(svg-icon="icon-epics")
|
||||
span.num
|
||||
span.name(translate="SEARCH.FILTER_EPICS")
|
||||
|
||||
li.userstories(data-name="userstories")
|
||||
a.active(
|
||||
href="#"
|
||||
|
|
|
@ -21,6 +21,25 @@ script(type="text/ng-template", id="search-issues")
|
|||
div.empty-large(ng-class="{'hidden': issues.length}")
|
||||
include ../components/empty-search-results
|
||||
|
||||
script(type="text/ng-template", id="search-epics")
|
||||
div.search-result-table-container(ng-class="{'hidden': !epics.length}", tg-bind-scope)
|
||||
div.search-result-table-header
|
||||
div.row.title
|
||||
div.ref(translate="COMMON.FIELDS.REF")
|
||||
div.user-stories(translate="SEARCH.FILTER_EPICS")
|
||||
div.status(translate="COMMON.FIELDS.STATUS")
|
||||
div.search-result-table-body
|
||||
div.row.table-main(ng-repeat="epic in epics track by epic.id")
|
||||
div.ref(tg-bo-ref="epic.ref")
|
||||
div.user-stories
|
||||
div.user-story-name
|
||||
a(href="", tg-nav="project-epic-detail:project=project.slug,ref=epic.ref",
|
||||
tg-bo-bind="epic.subject")
|
||||
div.status(tg-listitem-epic-status="epic")
|
||||
|
||||
div.empty-search-results(ng-class="{'hidden': epics.length}")
|
||||
include ../components/empty-search-results
|
||||
|
||||
|
||||
script(type="text/ng-template", id="search-userstories")
|
||||
div.search-result-table-container(ng-class="{'hidden': !userstories.length}", tg-bind-scope)
|
||||
|
|
Loading…
Reference in New Issue