diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index a304d9d8..a198c59c 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -407,6 +407,7 @@ "ASSIGNED_TO": "Assigned", "STATUS": "Status", "PROGRESS": "Progress", + "CLOSED_US": "Closed user stories", "VIEW_OPTIONS": "View options" }, "CREATE": { diff --git a/app/modules/epics/dashboard/epic-row/epic-row.directive.coffee b/app/modules/epics/dashboard/epic-row/epic-row.directive.coffee index 82f1a43b..7936cfba 100644 --- a/app/modules/epics/dashboard/epic-row/epic-row.directive.coffee +++ b/app/modules/epics/dashboard/epic-row/epic-row.directive.coffee @@ -25,7 +25,7 @@ EpicRowDirective = () -> bindToController: true, scope: { epic: '=', - column: '=' + options: '=' } } diff --git a/app/modules/epics/dashboard/epic-row/epic-row.jade b/app/modules/epics/dashboard/epic-row/epic-row.jade index 0cdea845..b265d27d 100644 --- a/app/modules/epics/dashboard/epic-row/epic-row.jade +++ b/app/modules/epics/dashboard/epic-row/epic-row.jade @@ -2,6 +2,7 @@ .epic-row.e2e-epic-row( ng-class="{'is-blocked': vm.epic.get('is_blocked'), 'is-closed': vm.epic.get('is_closed'), 'unfold': vm.displayUserStories, 'not-empty': vm.epic.getIn(['user_stories_counts', 'opened']) || vm.epic.getIn(['user_stories_counts', 'closed'])}" ng-click="vm.toggleUserStoryList()" + ng-hide="!vm.options.closed && vm.epic.get('is_closed')" ) tg-svg.icon-drag( svg-icon="icon-drag" @@ -9,13 +10,13 @@ ) .vote( - ng-if="vm.column.votes" + ng-if="vm.options.votes" ng-class="{'is-voter': vm.epic.get('is_voter')}" ) tg-svg(svg-icon='icon-upvote') span {{::vm.epic.get('total_voters')}} - .name(ng-if="vm.column.name") + .name(ng-if="vm.options.name") - var hash = "#"; a( tg-nav="project-epics-detail:project=vm.project.slug,ref=vm.epic.get('ref')" @@ -31,12 +32,12 @@ ng-if="vm.epic.getIn(['user_stories_counts', 'total'])" ) - .project(ng-if="vm.column.project") + .project(ng-if="vm.options.project") - .sprint(ng-if="vm.column.sprint") + .sprint(ng-if="vm.options.sprint") .assigned.e2e-assigned-to( - ng-if="vm.column.assigned" + ng-if="vm.options.assigned" tg-loading="vm.assignLoader" ) tg-assigned-to-component( @@ -48,11 +49,11 @@ ) .status( - ng-if="vm.column.status && !vm.canEditEpics()" + ng-if="vm.options.status && !vm.canEditEpics()" ) span {{vm.epic.getIn(['status_extra_info', 'name'])}} .status( - ng-if="vm.column.status && vm.canEditEpics()" + ng-if="vm.options.status && vm.canEditEpics()" ng-mouseleave="vm.displayStatusList = false" tg-isolate-click ) @@ -72,7 +73,7 @@ ng-click="vm.updateStatus(status.id)" ) {{status.name}} - .progress(ng-if="vm.column.progress") + .progress(ng-if="vm.options.progress") .progress-bar .progress-status( ng-if="::vm.percentage" @@ -83,5 +84,5 @@ .epic-story(tg-repeat="story in vm.epicStories track by story.get('id')") tg-story-row.e2e-story( story="story" - column="vm.column" + column="vm.options" ) diff --git a/app/modules/epics/dashboard/epics-table/epics-table.controller.coffee b/app/modules/epics/dashboard/epics-table/epics-table.controller.coffee index 12a1f1d1..cec9a836 100644 --- a/app/modules/epics/dashboard/epics-table/epics-table.controller.coffee +++ b/app/modules/epics/dashboard/epics-table/epics-table.controller.coffee @@ -33,14 +33,15 @@ class EpicsTableController @.hash = generateHash([@projectService.project.get('id'), 'epics']) @.displayOptions = false @.displayVotes = true - @.column = @storage.get(@.hash, { + @.options = @storage.get(@.hash, { votes: true, name: true, project: true, sprint: true, assigned: true, status: true, - progress: true + progress: true, + closed: true, }) taiga.defineImmutableProperty @, 'epics', () => return @epicsService.epics @@ -69,6 +70,6 @@ class EpicsTableController return @.timer = @timeout (=> @.displayOptions = false), 400 updateViewOptions: () -> - @storage.set(@.hash, @.column) + @storage.set(@.hash, @.options) angular.module("taigaEpics").controller("EpicsTableCtrl", EpicsTableController) diff --git a/app/modules/epics/dashboard/epics-table/epics-table.controller.spec.coffee b/app/modules/epics/dashboard/epics-table/epics-table.controller.spec.coffee index 7943bbde..7fae6e4e 100644 --- a/app/modules/epics/dashboard/epics-table/epics-table.controller.spec.coffee +++ b/app/modules/epics/dashboard/epics-table/epics-table.controller.spec.coffee @@ -86,4 +86,4 @@ describe "EpicTable", -> it "storage view options", () -> epicTableCtrl = controller "EpicsTableCtrl" - expect(epicTableCtrl.column).to.be.eql({col1: true}) + expect(epicTableCtrl.options).to.be.eql({col1: true}) diff --git a/app/modules/epics/dashboard/epics-table/epics-table.jade b/app/modules/epics/dashboard/epics-table/epics-table.jade index 90e4fa4a..aa90af13 100644 --- a/app/modules/epics/dashboard/epics-table/epics-table.jade +++ b/app/modules/epics/dashboard/epics-table/epics-table.jade @@ -16,30 +16,30 @@ mixin epicSwitch(name, model) .epics-table-header.e2e-epics-table-header .vote( translate="EPICS.TABLE.VOTES" - ng-if="vm.column.votes" + ng-if="vm.options.votes" ) .name( translate="EPICS.TABLE.NAME" ) .project( translate="EPICS.TABLE.PROJECT" - ng-if="vm.column.project" + ng-if="vm.options.project" ) .sprint( translate="EPICS.TABLE.SPRINT" - ng-if="vm.column.sprint" + ng-if="vm.options.sprint" ) .assigned( translate="EPICS.TABLE.ASSIGNED_TO" - ng-if="vm.column.assigned" + ng-if="vm.options.assigned" ) .status( translate="EPICS.TABLE.STATUS" - ng-if="vm.column.status" + ng-if="vm.options.status" ) .progress( translate="EPICS.TABLE.PROGRESS" - ng-if="vm.column.progress" + ng-if="vm.options.progress" ) .epics-table-options-wrapper( ng-mouseleave="vm.hideEpicTableOption()" @@ -56,37 +56,43 @@ mixin epicSwitch(name, model) translate="EPICS.TABLE.VOTES" for="epicSwitch-votes" ) - +epicSwitch('switch-votes', 'vm.column.votes') + +epicSwitch('switch-votes', 'vm.options.votes') .fieldset label.epics-table-options-vote( translate="EPICS.TABLE.PROJECT" for="switch-project" ) - +epicSwitch('switch-project', 'vm.column.project') + +epicSwitch('switch-project', 'vm.options.project') .fieldset label.epics-table-options-vote( translate="EPICS.TABLE.SPRINT" for="switch-sprint" ) - +epicSwitch('switch-sprint', 'vm.column.sprint') + +epicSwitch('switch-sprint', 'vm.options.sprint') .fieldset label.epics-table-options-vote( translate="EPICS.TABLE.ASSIGNED_TO" for="switch-assigned" ) - +epicSwitch('switch-assigned', 'vm.column.assigned') + +epicSwitch('switch-assigned', 'vm.options.assigned') .fieldset label.epics-table-options-vote( translate="EPICS.TABLE.STATUS" for="switch-status" ) - +epicSwitch('switch-status', 'vm.column.status') + +epicSwitch('switch-status', 'vm.options.status') .fieldset label.epics-table-options-vote( translate="EPICS.TABLE.PROGRESS" for="switch-progress" ) - +epicSwitch('switch-progress', 'vm.column.progress') + +epicSwitch('switch-progress', 'vm.options.progress') + .fieldset + label.epics-table-options-vote( + translate="EPICS.TABLE.CLOSED_US" + for="switch-closed" + ) + +epicSwitch('switch-closed', 'vm.options.closed') .epics-table-body( tg-epics-sortable="vm.reorderEpic(epic, newIndex)" @@ -100,7 +106,7 @@ mixin epicSwitch(name, model) ) tg-epic-row.e2e-epic( epic="epic" - column="vm.column" + options="vm.options" ) div(tg-loading="vm.loadingEpics")