From 93c2c45efbb3d078f37fb31227f3184215a3a8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Hermida?= Date: Wed, 4 Jul 2018 17:13:41 +0200 Subject: [PATCH] Add generic lightbox --- app/coffee/modules/backlog/main.coffee | 4 +- app/coffee/modules/common/lightboxes.coffee | 107 +++++++++++------- app/coffee/modules/issues/list.coffee | 7 +- app/coffee/modules/kanban/main.coffee | 3 +- app/coffee/modules/kanban/sortable.coffee | 2 +- app/coffee/modules/related-tasks.coffee | 4 +- app/coffee/modules/taskboard/main.coffee | 83 +++++++++++--- app/coffee/modules/taskboard/sortable.coffee | 4 +- .../modules/taskboard/taskboard-issues.coffee | 3 - .../resources/issues-resource.service.coffee | 1 - .../resources/tasks-resource.service.coffee | 1 - app/partials/backlog/backlog.jade | 1 - .../lb-create-edit-issue.jade | 6 +- .../lb-create-edit-task.jade | 0 .../lb-create-edit-us.jade | 0 .../lightbox-create-edit/lb-create-edit.jade | 8 +- .../includes/modules/kanban-table.jade | 2 +- .../includes/modules/related-tasks.jade | 2 +- .../includes/modules/taskboard-table.jade | 52 +++++---- app/partials/issue/issues.jade | 1 - app/partials/kanban/kanban.jade | 1 - app/partials/taskboard/taskboard.jade | 1 - .../modules/backlog/taskboard-table.scss | 64 +++++------ app/styles/modules/kanban/kanban-table.scss | 6 +- app/styles/shame/shame.scss | 2 +- app/themes/high-contrast/custom.scss | 2 +- app/themes/material-design/custom.scss | 2 +- app/themes/taiga/custom.scss | 2 +- 28 files changed, 214 insertions(+), 157 deletions(-) rename app/partials/{includes/modules => common/lightbox}/lightbox-create-edit/lb-create-edit-issue.jade (91%) rename app/partials/{includes/modules => common/lightbox}/lightbox-create-edit/lb-create-edit-task.jade (100%) rename app/partials/{includes/modules => common/lightbox}/lightbox-create-edit/lb-create-edit-us.jade (100%) rename app/partials/{includes/modules => common/lightbox}/lightbox-create-edit/lb-create-edit.jade (91%) diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index 8866a18f..0ad87010 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -543,7 +543,6 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F @rs2.attachments.list("us", us.id, projectId).then (attachments) => @rootscope.$broadcast("genericform:edit", { 'objType': 'us', - 'statusList': @scope.usStatusList, 'obj': us, 'attachments': attachments.toJS() }) @@ -574,8 +573,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F when "standard" then @rootscope.$broadcast("genericform:new", { 'objType': 'us', - 'project': @scope.project, - 'statusList': @scope.usStatusList + 'project': @scope.project }) when "bulk" then @rootscope.$broadcast("usform:bulk", @scope.projectId, @scope.project.default_us_status) diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index 15df7813..fbf305f6 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -773,9 +773,11 @@ module.directive("tgLbSetDueDate", ["lightboxService", "$tgLoading", "$translate ## Create/Edit Lightbox Directive ############################################################################# +groupBy = @.taiga.groupBy + CreateEditDirective = ( $log, $repo, $model, $rs, $rootScope, lightboxService, $loading, $translate, -$confirm, $q, attachmentsService) -> +$confirm, $q, attachmentsService, $template, $compile) -> link = ($scope, $el, attrs) -> form = null schemas = { @@ -783,50 +785,68 @@ $confirm, $q, attachmentsService) -> objName: 'User Story', model: 'userstories', params: { include_attachments: true, include_tasks: true }, - requiredAttrs: ['project'], + data: (project) -> + return { + statusList: _.sortBy(project.us_statuses, "order") + } initialData: (data) -> return { project: data.project.id + subject: "" + description: "" + tags: [] points : {} status: data.project.default_us_status is_archived: false - tags: [] - subject: "" - description: "" } } task: { objName: 'Task', model: 'tasks', params: { include_attachments: true }, - requiredAttrs: ['project', 'sprintId', 'usId'], + data: (project) -> + return { + statusList: _.sortBy(project.task_statuses, "order") + } initialData: (data) -> return { project: data.project.id - milestone: data.sprintId - user_story: data.usId - is_archived: false - status: data.project.default_task_status + subject: "" + description: "" assigned_to: null - tags: [], - subject: "", - description: "", + tags: [] + milestone: data.sprintId + status: data.project.default_task_status + user_story: data.us + is_archived: false } }, issue: { objName: 'Issue', model: 'issues', params: { include_attachments: true }, - requiredAttrs: ['project', 'typeList', 'typeById', 'severityList', 'priorityList'], + data: (project) -> + return { + project: project + statusList: _.sortBy(project.issue_statuses, "order") + typeById: groupBy(project.issue_types, (x) -> x.id) + typeList: _.sortBy(project.issue_types, "order") + severityById: groupBy(project.severities, (x) -> x.id) + severityList: _.sortBy(project.severities, "order") + priorityById: groupBy(project.priorities, (x) -> x.id) + priorityList: _.sortBy(project.priorities, "order") + } initialData: (data) -> return { - project: data.project.id - subject: "" - status: data.project.default_issue_status - type: data.project.default_issue_type + assigned_to: null + milestone: data.sprintId priority: data.project.default_priority + project: data.project.id severity: data.project.default_severity + status: data.project.default_issue_status + subject: "" tags: [] + type: data.project.default_issue_type } } } @@ -835,30 +855,26 @@ $confirm, $q, attachmentsService) -> attachmentsToDelete = Immutable.List() $scope.$on "genericform:new", (ctx, data) -> - if beforeMount('new', data, ['objType', 'statusList', ]) + if beforeMount('new', data, ['project']) mountCreateForm(data) afterMount() $scope.$on "genericform:edit", (ctx, data) -> - if beforeMount('edit', data, ['objType', 'statusList', 'obj', 'attachments']) + if beforeMount('edit', data, ['project', 'obj', 'attachments']) mountUpdateForm(data) afterMount() beforeMount = (mode, data, requiredAttrs) -> form.reset() if form - $el.find(".tag-input").val("") # Get form schema if !data.objType || !schemas[data.objType] return $log.error( "Invalid objType `#{data.objType}` for `genericform:#{mode}` event") + $scope.objType = data.objType $scope.schema = schemas[data.objType] - # Get required attrs for creation from objType schema - if mode == 'new' - requiredAttrs = $scope.schema.requiredAttrs.concat(requiredAttrs) - - # Check if required attrs for creating are present + # Get required attrs of the directive getAttrs(mode, data, requiredAttrs) return true @@ -867,25 +883,26 @@ $confirm, $q, attachmentsService) -> $scope.obj = $model.make_model($scope.schema.model, $scope.schema.initialData(data)) $scope.isNew = true $scope.attachments = Immutable.List() - - # Update texts for creation - $el.find(".button-green").html($translate.instant("COMMON.CREATE")) - $el.find(".title").html($translate.instant( - "LIGHTBOX.CREATE_EDIT.NEW", { objName: $scope.schema.objName })) - $el.find(".blocked-note").addClass("hidden") + $scope.text = { + title: $translate.instant("LIGHTBOX.CREATE_EDIT.NEW", { objName: $scope.schema.objName }) + action: $translate.instant("COMMON.CREATE") + } + render() mountUpdateForm = (data) -> $scope.isNew = false $scope.attachments = Immutable.fromJS($scope.attachments) - - # Update texts for edition - $el.find(".button-green").html($translate.instant("COMMON.SAVE")) - $el.find(".title").html($translate.instant( - "LIGHTBOX.CREATE_EDIT.EDIT", { objName: $scope.schema.objName })) + $scope.text = { + title: $translate.instant("LIGHTBOX.CREATE_EDIT.EDIT", { objName: $scope.schema.objName }) + action: $translate.instant("COMMON.SAVE") + } + render() afterMount = () -> resetAttachments() - setStatus($scope.obj.status) + setStatus($scope.obj?.status) + + $scope.createEditOpen = true lightboxService.open $el, () -> $scope.createEditOpen = false @@ -1073,6 +1090,16 @@ $confirm, $q, attachmentsService) -> $scope.isClientRequirement = () -> return $scope.obj?.client_requirement + render = () -> + templatePath = "common/lightbox/lightbox-create-edit/lb-create-edit-#{$scope.objType}.html" + template = $template.get(templatePath, true) + + _.map $scope.schema.data($scope.project), (value, key) -> + $scope[key] = value + + html = $compile(template($scope))($scope) + $el.html(html) + return { link: link } @@ -1088,6 +1115,8 @@ module.directive("tgLbCreateEdit", [ "$translate", "$tgConfirm", "$q", - "tgAttachmentsService" + "tgAttachmentsService", + "$tgTemplate", + "$compile", CreateEditDirective ]) \ No newline at end of file diff --git a/app/coffee/modules/issues/list.coffee b/app/coffee/modules/issues/list.coffee index 41f5a59a..c9063ff6 100644 --- a/app/coffee/modules/issues/list.coffee +++ b/app/coffee/modules/issues/list.coffee @@ -370,12 +370,7 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi project = @projectService.project.toJS() @rootscope.$broadcast("genericform:new", { 'objType': 'issue', - 'statusList': @scope.issueStatusList, - 'project': project, - 'severityList': @scope.severityList, - 'priorityList': @scope.priorityList, - 'typeById': groupBy(project.issue_types, (x) -> x.id), - 'typeList': _.sortBy(project.issue_types, "order") + 'project': project }) addIssuesInBulk: -> diff --git a/app/coffee/modules/kanban/main.coffee b/app/coffee/modules/kanban/main.coffee index f5c18ead..30f36254 100644 --- a/app/coffee/modules/kanban/main.coffee +++ b/app/coffee/modules/kanban/main.coffee @@ -167,8 +167,7 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi when "standard" then @rootscope.$broadcast("genericform:new", { 'objType': 'us', - 'project': @scope.project, - 'statusList': @scope.usStatusList + 'project': @scope.project }) when "bulk" then @rootscope.$broadcast("usform:bulk", @scope.projectId, statusId) diff --git a/app/coffee/modules/kanban/sortable.coffee b/app/coffee/modules/kanban/sortable.coffee index a9d32e03..3ae4019e 100644 --- a/app/coffee/modules/kanban/sortable.coffee +++ b/app/coffee/modules/kanban/sortable.coffee @@ -58,7 +58,7 @@ KanbanSortableDirective = ($repo, $rs, $rootscope) -> itemEl.off() itemEl.remove() - containers = _.map $el.find('.task-column'), (item) -> + containers = _.map $el.find('.taskboard-column'), (item) -> return item drake = dragula(containers, { diff --git a/app/coffee/modules/related-tasks.coffee b/app/coffee/modules/related-tasks.coffee index 5f6fa132..728b3c5c 100644 --- a/app/coffee/modules/related-tasks.coffee +++ b/app/coffee/modules/related-tasks.coffee @@ -30,8 +30,8 @@ module = angular.module("taigaRelatedTasks", []) RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $template, $translate, $emojis) -> - templateView = $template.get("task/related-task-row.html", true) - templateEdit = $template.get("task/related-task-row-edit.html", true) + templateView = $template.get("task/related-taskboard-row.html", true) + templateEdit = $template.get("task/related-taskboard-row-edit.html", true) link = ($scope, $el, $attrs, $model) -> @childScope = $scope.$new() diff --git a/app/coffee/modules/taskboard/main.coffee b/app/coffee/modules/taskboard/main.coffee index 363345b5..1b163305 100644 --- a/app/coffee/modules/taskboard/main.coffee +++ b/app/coffee/modules/taskboard/main.coffee @@ -314,21 +314,40 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga @.refreshTagsColors().then () => @taskboardTasksService.replaceModel(task) + @scope.$on "issueform:new:success", (event, issue) => + @.refreshTagsColors().then () => + @taskboardIssuesService.add(issue) + + @analytics.trackEvent("issue", "create", "create issue on taskboard", 1) + + @scope.$on "issueform:edit:success", (event, issue) => + @.refreshTagsColors().then () => + @taskboardIssuesService.replaceModel(issue) + @scope.$on "taskboard:task:deleted", (event, task) => @.loadTasks() @scope.$on("taskboard:task:move", @.taskMove) @scope.$on("assigned-to:added", @.onAssignedToChanged) - onAssignedToChanged: (ctx, userid, taskModel) -> - taskModel.assigned_to = userid + onAssignedToChanged: (ctx, userid, model) -> + if model.getName() == 'tasks' + model.assigned_to = userid + @taskboardTasksService.replaceModel(model) - @taskboardTasksService.replaceModel(taskModel) + @repo.save(model).then => + @.generateFilters() + if @.isFilterDataTypeSelected('assigned_to') || @.isFilterDataTypeSelected('role') + @.loadTasks() + if model.getName() == 'issues' + model.assigned_to = userid + @taskboardIssuesService.replaceModel(model) + + @repo.save(model).then => + @.generateFilters() + if @.isFilterDataTypeSelected('assigned_to') || @.isFilterDataTypeSelected('role') + @.loadIssues() - @repo.save(taskModel).then => - @.generateFilters() - if @.isFilterDataTypeSelected('assigned_to') || @.isFilterDataTypeSelected('role') - @.loadTasks() initializeSubscription: -> routingKey = "changes.project.#{@scope.projectId}.tasks" @@ -408,7 +427,6 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga params.include_attachments = 1 params = _.merge params, @location.search() - console.log '@scope.sprintId tasks', @scope.sprintId return @rs.tasks.list(@scope.projectId, @scope.sprintId, null, params).then (tasks) => @taskboardTasksService.init(@scope.project, @scope.usersById) @taskboardTasksService.set(tasks) @@ -462,13 +480,31 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga @rootscope.$broadcast("genericform:edit", { 'objType': 'task', 'obj': editingTask, - 'statusList': @scope.taskStatusList, + 'project': @scope.project, + 'sprintId': @scope.sprintId, 'attachments': attachments.toJS() }) - task = task.set('loading', false) + task = task.set('loading-edit', false) @taskboardTasksService.replace(task) + editIssue: (id) -> + issue = @.taskboardIssuesService.getIssue(id) + issue = issue.set('loading-edit', true) + + @rs.issues.getByRef(issue.getIn(['model', 'project']), issue.getIn(['model', 'ref'])) + .then (editingIssue) => + @rs2.attachments.list("issue", issue.get('id'), issue.getIn(['model', 'project'])) + .then (attachments) => + @rootscope.$broadcast("genericform:edit", { + 'objType': 'issue', + 'obj': editingIssue, + 'project': @scope.project, + 'sprintId': @scope.sprintId, + 'attachments': attachments.toJS() + }) + issue = issue.set('loading-edit', false) + deleteTask: (id) -> task = @.taskboardTasksService.getTask(id) task = task.set('loading-delete', true) @@ -525,14 +561,18 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga 'objType': 'task', 'project': @scope.project, 'sprintId': @scope.sprintId, - 'usId': us?.id, - 'status': @scope.project.default_task_status, - 'statusList': @scope.taskStatusList + 'usId': us?.id }) when "bulk" then @rootscope.$broadcast("taskform:bulk", @scope.sprintId, us?.id) addNewIssue: (type, us) -> switch type + when "standard" then @rootscope.$broadcast("genericform:new", + { + 'objType': 'issue', + 'project': @scope.project, + 'sprintId': @scope.sprintId + }) when "standard" then @rootscope.$broadcast("taskform:new", @scope.sprintId, us?.id) when "bulk" then @rootscope.$broadcast("taskform:bulk", @scope.sprintId, us?.id) @@ -544,6 +584,11 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga @rootscope.$broadcast("assigned-to:add", task) + changeIssueAssignedTo: (id) -> + issue = @taskboardIssuesService.getIssueModel(id) + + @rootscope.$broadcast("assigned-to:add", issue) + setRolePoints: () -> computableRoles = _.filter(@scope.project.roles, "computable") @@ -676,12 +721,14 @@ TaskboardSquishColumnDirective = (rs) -> $el.find('.taskboard-table-inner').css("width", totalWidth) - columnWidths.pop() - issuesRowWidth = _.reduce columnWidths, (total, width) -> - return total + width + issuesBoxWidth = $el.find('.issues-row .taskboard-row-title-box').outerWidth(true) + $el.find('.issues-row').css("width", totalWidth - columnWidths.pop()) - issuesBoxWidth = $el.find('.issues-row .taskboard-issues-box').outerWidth(true) - $el.find('.issues-row').css("width", issuesRowWidth) + issuesCardBoxMaxHeight = if $scope.ctrl.zoomLevel == '0' then 260 else 390 + $el.find('.issues-row .taskboard-cards-box').css("max-height", issuesCardBoxMaxHeight) + + issueCardMaxWidth = if $scope.ctrl.zoomLevel == '0' then 128 else 280 + $el.find('.issues-row .taskboard-cards-box .card').css("max-width", issueCardMaxWidth) recalculateStatusColumnWidth = (statusId) => #unassigned ceil diff --git a/app/coffee/modules/taskboard/sortable.coffee b/app/coffee/modules/taskboard/sortable.coffee index 2e5a291f..efc60290 100644 --- a/app/coffee/modules/taskboard/sortable.coffee +++ b/app/coffee/modules/taskboard/sortable.coffee @@ -62,13 +62,13 @@ TaskboardSortableDirective = ($repo, $rs, $rootscope, $translate) -> itemEl.off() itemEl.remove() - containers = _.map $el.find('.task-column'), (item) -> + containers = _.map $el.find('.taskboard-column'), (item) -> return item drake = dragula(containers, { copySortSource: false, copy: false, - accepts: (el, target) -> return !$(target).hasClass('taskboard-userstory-box') + accepts: (el, target) -> return !$(target).hasClass('taskboard-row-title-box') moves: (item) -> return $(item).is('tg-card') }) diff --git a/app/coffee/modules/taskboard/taskboard-issues.coffee b/app/coffee/modules/taskboard/taskboard-issues.coffee index de5c8ed3..4ebc87fa 100644 --- a/app/coffee/modules/taskboard/taskboard-issues.coffee +++ b/app/coffee/modules/taskboard/taskboard-issues.coffee @@ -46,7 +46,6 @@ class TaskboardIssuesService extends taiga.Service return _.find @.issuesRaw, (issue) -> return issue.id == id replaceModel: (issue) -> - console.log 'replacesModel' @.issuesRaw = _.map @.issuesRaw, (item) -> if issue.id == item.id return issue @@ -58,7 +57,6 @@ class TaskboardIssuesService extends taiga.Service refresh: -> issues = [] for issueModel in @.issuesRaw - console.log issueModel issue = {} model = issueModel.getAttrs() @@ -73,6 +71,5 @@ class TaskboardIssuesService extends taiga.Service issues.push(issue) @.milestoneIssues = Immutable.fromJS(issues) - console.log @.milestoneIssues, 'milestoneIssues' angular.module("taigaKanban").service("tgTaskboardIssues", TaskboardIssuesService) diff --git a/app/modules/resources/issues-resource.service.coffee b/app/modules/resources/issues-resource.service.coffee index 075f88a4..67386bbc 100644 --- a/app/modules/resources/issues-resource.service.coffee +++ b/app/modules/resources/issues-resource.service.coffee @@ -22,7 +22,6 @@ Resource = (urlsService, http) -> service.listInAllProjects = (params) -> url = urlsService.resolve("issues") - console.log 'resource issues url', url httpOptions = { headers: { "x-disable-pagination": "1" diff --git a/app/modules/resources/tasks-resource.service.coffee b/app/modules/resources/tasks-resource.service.coffee index bdb48255..1a25a3e4 100644 --- a/app/modules/resources/tasks-resource.service.coffee +++ b/app/modules/resources/tasks-resource.service.coffee @@ -22,7 +22,6 @@ Resource = (urlsService, http) -> service.listInAllProjects = (params) -> url = urlsService.resolve("tasks") - console.log 'resoruce tasks url', url httpOptions = { headers: { "x-disable-pagination": "1" diff --git a/app/partials/backlog/backlog.jade b/app/partials/backlog/backlog.jade index 713702b4..7f1347eb 100644 --- a/app/partials/backlog/backlog.jade +++ b/app/partials/backlog/backlog.jade @@ -124,7 +124,6 @@ div.wrapper(tg-backlog, ng-controller="BacklogController as ctrl", include ../includes/modules/sprints div.lightbox.lightbox-generic-form.lightbox-create-edit(tg-lb-create-edit) - include ../includes/modules/lightbox-create-edit/lb-create-edit-us div.lightbox.lightbox-generic-bulk(tg-lb-create-bulk-userstories) include ../includes/modules/lightbox-us-bulk diff --git a/app/partials/includes/modules/lightbox-create-edit/lb-create-edit-issue.jade b/app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-issue.jade similarity index 91% rename from app/partials/includes/modules/lightbox-create-edit/lb-create-edit-issue.jade rename to app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-issue.jade index e59fab80..43b9ae21 100644 --- a/app/partials/includes/modules/lightbox-create-edit/lb-create-edit-issue.jade +++ b/app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-issue.jade @@ -8,15 +8,15 @@ block options ) div.ticket-data-container tg-issue-type-button.ticket-status( - autosave="false" + not-auto-save="true" ng-model="obj" ) tg-issue-severity-button.ticket-status( - autosave="false" + not-auto-save="true" ng-model="obj" ) tg-issue-priority-button.ticket-status( - autosave="false" + not-auto-save="true" ng-model="obj" ) diff --git a/app/partials/includes/modules/lightbox-create-edit/lb-create-edit-task.jade b/app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-task.jade similarity index 100% rename from app/partials/includes/modules/lightbox-create-edit/lb-create-edit-task.jade rename to app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-task.jade diff --git a/app/partials/includes/modules/lightbox-create-edit/lb-create-edit-us.jade b/app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-us.jade similarity index 100% rename from app/partials/includes/modules/lightbox-create-edit/lb-create-edit-us.jade rename to app/partials/common/lightbox/lightbox-create-edit/lb-create-edit-us.jade diff --git a/app/partials/includes/modules/lightbox-create-edit/lb-create-edit.jade b/app/partials/common/lightbox/lightbox-create-edit/lb-create-edit.jade similarity index 91% rename from app/partials/includes/modules/lightbox-create-edit/lb-create-edit.jade rename to app/partials/common/lightbox/lightbox-create-edit/lb-create-edit.jade index d7c905ac..4d4d12bd 100644 --- a/app/partials/includes/modules/lightbox-create-edit/lb-create-edit.jade +++ b/app/partials/common/lightbox/lightbox-create-edit/lb-create-edit.jade @@ -1,7 +1,7 @@ tg-lightbox-close form - h2.title(translate="LIGHTBOX.CREATE_EDIT.TITLE_NEW") + h2.title {{ text.title }} div.form-wrapper main fieldset @@ -57,10 +57,6 @@ form block options - button.button-green.submit-button( - type="submit" - title="{{'COMMON.CREATE' | translate}}" - translate="COMMON.CREATE" - ) + button.button-green.submit-button(type="submit") {{ text.action }} div.lightbox.lightbox-select-user(tg-lb-assignedto) \ No newline at end of file diff --git a/app/partials/includes/modules/kanban-table.jade b/app/partials/includes/modules/kanban-table.jade index 3a478774..fc41d9bf 100644 --- a/app/partials/includes/modules/kanban-table.jade +++ b/app/partials/includes/modules/kanban-table.jade @@ -62,7 +62,7 @@ div.kanban-table( div.kanban-table-body div.kanban-table-inner - div.kanban-uses-box.task-column(ng-class='{vfold:folds[s.id]}', + div.kanban-uses-box.taskboard-column(ng-class='{vfold:folds[s.id]}', ng-repeat="s in ::usStatusList track by s.id", tg-kanban-wip-limit="s", tg-kanban-column-height-fixer, diff --git a/app/partials/includes/modules/related-tasks.jade b/app/partials/includes/modules/related-tasks.jade index 84f09df7..ef6b0c39 100644 --- a/app/partials/includes/modules/related-tasks.jade +++ b/app/partials/includes/modules/related-tasks.jade @@ -9,7 +9,7 @@ section.related-tasks( .row.single-related-task.js-related-task( ng-repeat="task in tasks" ng-class="{closed: task.is_closed, blocked: task.is_blocked, iocaine: task.is_iocaine}" - tg-related-task-row + tg-related-taskboard-row ng-model="task" ) div(tg-related-task-create-form) diff --git a/app/partials/includes/modules/taskboard-table.jade b/app/partials/includes/modules/taskboard-table.jade index 944500dd..9f03834f 100644 --- a/app/partials/includes/modules/taskboard-table.jade +++ b/app/partials/includes/modules/taskboard-table.jade @@ -31,8 +31,11 @@ div.taskboard-table( div.taskboard-table-body(tg-taskboard-table-height-fixer) div.taskboard-table-inner - div.task-row(ng-repeat="us in userstories track by us.id", ng-class="{blocked: us.is_blocked, 'row-fold':usFolded[us.id]}") - div.taskboard-userstory-box.task-column(tg-bo-title="us.blocked_note") + div.taskboard-row( + ng-repeat="us in userstories track by us.id", + ng-class="{blocked: us.is_blocked, 'row-fold':usFolded[us.id]}" + ) + div.taskboard-row-title-box.taskboard-column(tg-bo-title="us.blocked_note") tg-svg.vfold.fold-action( svg-icon="icon-fold-row", ng-click='foldUs(us.id)' @@ -65,7 +68,7 @@ div.taskboard-table( include ../components/addnewtask - div.taskboard-tasks-box.task-column( + div.taskboard-cards-box.taskboard-column( ng-repeat="st in ::taskStatusList track by st.id", class="squish-status-{{st.id}}", ng-class="{'column-fold':statusesFolded[st.id]}", @@ -90,8 +93,8 @@ div.taskboard-table( zoom-level="ctrl.zoomLevel" type="task" ) - div.task-row(ng-init="us = null", ng-class="{'row-fold':usFolded[null]}") - div.taskboard-userstory-box.task-column + div.taskboard-row(ng-init="us = null", ng-class="{'row-fold':usFolded[null]}") + div.taskboard-row-title-box.taskboard-column a.vfold( href="" title="{{'TASKBOARD.TABLE.TITLE_ACTION_FOLD_ROW' | translate}}" @@ -110,7 +113,7 @@ div.taskboard-table( span(translate="TASKBOARD.TABLE.ROW_UNASSIGED_TASKS_TITLE") include ../components/addnewtask.jade - div.taskboard-tasks-box.task-column( + div.taskboard-cards-box.taskboard-column( ng-repeat="st in ::taskStatusList track by st.id", class="squish-status-{{st.id}}", ng-class="{'column-fold':statusesFolded[st.id]}", @@ -136,8 +139,8 @@ div.taskboard-table( zoom-level="ctrl.zoomLevel" type="task" ) - div.issues-row - div.taskboard-issues-box.task-column + div.taskboard-row.issues-row(ng-class="{'row-fold':usFolded[0]}") + div.taskboard-row-title-box.taskboard-column a.vfold( href="" title="{{'TASKBOARD.TABLE.TITLE_ACTION_FOLD_ROW' | translate}}" @@ -155,20 +158,19 @@ div.taskboard-table( h3.task-colum-name(translate="TASKBOARD.TABLE.ROW_ISSUES_TITLE") include ../components/addnewissue.jade - div.taskboard-tasks-box.issues-cell - div - tg-card.card.ng-animate-disabled( - tg-repeat="issue in milestoneIssues" - ng-class="{'kanban-task-maximized': ctrl.isMaximized(s.id), 'kanban-task-minimized': ctrl.isMinimized(s.id)}" - tg-class-permission="{'readonly': '!modify_task'}" - tg-bind-scope, - on-toggle-fold="ctrl.toggleFold(id)" - on-click-edit="ctrl.editTask(id)" - on-click-delete="ctrl.deleteTask(id)" - on-click-assigned-to="ctrl.changeTaskAssignedTo(id)" - project="project" - item="issue" - zoom="ctrl.zoom" - zoom-level="ctrl.zoomLevel" - type="issue" - ) \ No newline at end of file + div.taskboard-cards-box + tg-card.card.ng-animate-disabled( + tg-repeat="issue in milestoneIssues" + class="kanban-task-minimized" + tg-class-permission="{'readonly': '!modify_issue'}" + tg-bind-scope, + on-toggle-fold="ctrl.toggleFold(id)" + on-click-edit="ctrl.editIssue(id)" + on-click-delete="ctrl.deleteTask(id)" + on-click-assigned-to="ctrl.changeIssueAssignedTo(id)" + project="project" + item="issue" + zoom="ctrl.zoom" + zoom-level="ctrl.zoomLevel" + type="issue" + ) \ No newline at end of file diff --git a/app/partials/issue/issues.jade b/app/partials/issue/issues.jade index 6ad5afcd..00b54e1f 100644 --- a/app/partials/issue/issues.jade +++ b/app/partials/issue/issues.jade @@ -34,7 +34,6 @@ div.wrapper.issues.lightbox-generic-form( div.lightbox.lightbox-select-user(tg-lb-assignedto) div.lightbox.lightbox-generic-form.lightbox-create-edit(tg-lb-create-edit) - include ../includes/modules/lightbox-create-edit/lb-create-edit-issue div.lightbox.lightbox-generic-bulk(tg-lb-create-bulk-issues) include ../includes/modules/lightbox-issue-bulk diff --git a/app/partials/kanban/kanban.jade b/app/partials/kanban/kanban.jade index 4ebc35c1..2a4e3d8b 100644 --- a/app/partials/kanban/kanban.jade +++ b/app/partials/kanban/kanban.jade @@ -41,7 +41,6 @@ div.wrapper( include ../includes/modules/kanban-table div.lightbox.lightbox-generic-form.lightbox-create-edit(tg-lb-create-edit) - include ../includes/modules/lightbox-create-edit/lb-create-edit-us div.lightbox.lightbox-generic-bulk(tg-lb-create-bulk-userstories) include ../includes/modules/lightbox-us-bulk diff --git a/app/partials/taskboard/taskboard.jade b/app/partials/taskboard/taskboard.jade index 667f50a1..bfb6a384 100644 --- a/app/partials/taskboard/taskboard.jade +++ b/app/partials/taskboard/taskboard.jade @@ -48,7 +48,6 @@ div.wrapper( include ../includes/modules/taskboard-table div.lightbox.lightbox-generic-form.lightbox-create-edit(tg-lb-create-edit) - include ../includes/modules/lightbox-create-edit/lb-create-edit-task div.lightbox.lightbox-generic-bulk.lightbox-task-bulk(tg-lb-create-bulk-tasks) include ../includes/modules/lightbox-task-bulk diff --git a/app/styles/modules/backlog/taskboard-table.scss b/app/styles/modules/backlog/taskboard-table.scss index c9b99985..124e8e2f 100644 --- a/app/styles/modules/backlog/taskboard-table.scss +++ b/app/styles/modules/backlog/taskboard-table.scss @@ -6,8 +6,6 @@ $column-shrink: 0; $column-margin: 0 $margin 0 0; $column-padding: .5rem 1rem; -$issues-column-width: $column-width - $margin * 4; - @mixin fold { .card { align-self: flex-start; @@ -30,8 +28,8 @@ $issues-column-width: $column-width - $margin * 4; } } } - &.task-column, - .task-column { + &.taskboard-column, + .taskboard-column { align-content: flex-start; display: flex; flex-direction: column; @@ -125,7 +123,7 @@ $issues-column-width: $column-width - $margin * 4; margin-bottom: 5rem; overflow: auto; width: 100%; - .task-column { + .taskboard-column { flex-basis: $column-width; flex-grow: $column-flex; flex-shrink: $column-shrink; @@ -137,17 +135,6 @@ $issues-column-width: $column-width - $margin * 4; } } - .issues-cell { - display: flex; - flex-direction: row; - max-width: inherit; - width: 100%; - .card { - flex-basis: $issues-column-width; - flex-grow: $column-flex; - flex-shrink: 1; - } - } .row-fold { @include fold; @@ -155,25 +142,25 @@ $issues-column-width: $column-width - $margin * 4; .column-fold { @include fold; } - .task-row { + .taskboard-row { display: flex; margin-bottom: .25rem; min-height: 10rem; width: 100%; &.blocked { - .taskboard-userstory-box { + .taskboard-row-title-box { background: rgba($red, .6); } - .taskboard-userstory-box svg, - .taskboard-userstory-box svg:hover, + .taskboard-row-title-box svg, + .taskboard-row-title-box svg:hover, .points-value, .points-value:hover { color: $white; fill: $white; transition: color .3s linear; } - .taskboard-tasks-box { + .taskboard-cards-box { background: rgba($red, .1); } } @@ -188,23 +175,36 @@ $issues-column-width: $column-width - $margin * 4; display: none; } } + &.issues-row { + .taskboard-cards-box { + align-content: flex-start; + align-items: flex-start; + display: flex; + flex-wrap: wrap; + max-height: 400px; + width: 100%; + } + .card { + cursor: default; + height: auto; + } + } + &.issues-row:not(.row-fold) { + .taskboard-cards-box { + flex-direction: column; + } + .card { + width: 280px; + } + } } - .issues-row { - display: flex; - margin-bottom: .25rem; - // margin-top: 1rem; - // border-top: 1rem solid; - // border-top-color: black; - min-height: 10rem; - width: auto; - } - .taskboard-userstory-box { + .taskboard-row-title-box { padding: .5rem .5rem .5rem 1.5rem; } } -.taskboard-userstory-box { +.taskboard-row-title-box { position: relative; .us-title { @include font-size(normal); diff --git a/app/styles/modules/kanban/kanban-table.scss b/app/styles/modules/kanban/kanban-table.scss index c997856c..c3392421 100644 --- a/app/styles/modules/kanban/kanban-table.scss +++ b/app/styles/modules/kanban/kanban-table.scss @@ -14,7 +14,7 @@ $column-padding: .5rem 1rem; overflow: hidden; width: 100%; &.zoom-0 { - .task-column, + .taskboard-column, .task-colum-name { max-width: $column-width / 2; } @@ -45,7 +45,7 @@ $column-padding: .5rem 1rem; } } &.task-colum-name, - &.task-column { + &.taskboard-column { flex-flow: 1; max-width: $column-folded-width; min-height: 2.5rem; @@ -129,7 +129,7 @@ $column-padding: .5rem 1rem; overflow: hidden; overflow-x: auto; width: 100%; - .task-column { + .taskboard-column { flex-basis: $column-width; flex-grow: $column-flex; flex-shrink: $column-shrink; diff --git a/app/styles/shame/shame.scss b/app/styles/shame/shame.scss index 18122cdd..23a5bea5 100644 --- a/app/styles/shame/shame.scss +++ b/app/styles/shame/shame.scss @@ -2,7 +2,7 @@ _:-ms-fullscreen, :root .taskboard-table-body { - .task-row { + .taskboard-row { min-height: auto; } } diff --git a/app/themes/high-contrast/custom.scss b/app/themes/high-contrast/custom.scss index cf395204..62c0c79a 100644 --- a/app/themes/high-contrast/custom.scss +++ b/app/themes/high-contrast/custom.scss @@ -273,7 +273,7 @@ tg-project-menu { } } .taskboard-table-body { - .taskboard-tasks-box { + .taskboard-cards-box { background: $white; border: 1px solid $black; } diff --git a/app/themes/material-design/custom.scss b/app/themes/material-design/custom.scss index 877e2884..54a02c99 100644 --- a/app/themes/material-design/custom.scss +++ b/app/themes/material-design/custom.scss @@ -160,7 +160,7 @@ tg-project-menu { } } .taskboard-table-body { - .taskboard-tasks-box { + .taskboard-cards-box { background: $mass-white; } } diff --git a/app/themes/taiga/custom.scss b/app/themes/taiga/custom.scss index c57561e0..59ce7e7f 100644 --- a/app/themes/taiga/custom.scss +++ b/app/themes/taiga/custom.scss @@ -140,7 +140,7 @@ tg-project-menu { } } .taskboard-table-body { - .taskboard-tasks-box { + .taskboard-cards-box { background: $mass-white; } }