[Backport] fix issue #4673 - local storage epics column settings
parent
69af3ce91d
commit
91bc269538
|
@ -18,19 +18,22 @@
|
||||||
###
|
###
|
||||||
|
|
||||||
taiga = @.taiga
|
taiga = @.taiga
|
||||||
|
generateHash = @.taiga.generateHash
|
||||||
|
|
||||||
class EpicsTableController
|
class EpicsTableController
|
||||||
@.$inject = [
|
@.$inject = [
|
||||||
"$tgConfirm",
|
"$tgConfirm",
|
||||||
"tgEpicsService",
|
"tgEpicsService",
|
||||||
"$timeout"
|
"$timeout",
|
||||||
|
"$tgStorage",
|
||||||
|
"tgProjectService"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@confirm, @epicsService, @timeout) ->
|
constructor: (@confirm, @epicsService, @timeout, @storage, @projectService) ->
|
||||||
|
@.hash = generateHash([@projectService.project.get('id'), 'epics'])
|
||||||
@.displayOptions = false
|
@.displayOptions = false
|
||||||
@.displayVotes = true
|
@.displayVotes = true
|
||||||
@.column = {
|
@.column = @storage.get(@.hash, {
|
||||||
votes: true,
|
votes: true,
|
||||||
name: true,
|
name: true,
|
||||||
project: true,
|
project: true,
|
||||||
|
@ -38,7 +41,7 @@ class EpicsTableController
|
||||||
assigned: true,
|
assigned: true,
|
||||||
status: true,
|
status: true,
|
||||||
progress: true
|
progress: true
|
||||||
}
|
})
|
||||||
|
|
||||||
taiga.defineImmutableProperty @, 'epics', () => return @epicsService.epics
|
taiga.defineImmutableProperty @, 'epics', () => return @epicsService.epics
|
||||||
taiga.defineImmutableProperty @, 'disabledEpicsPagination', () => return @epicsService._disablePagination
|
taiga.defineImmutableProperty @, 'disabledEpicsPagination', () => return @epicsService._disablePagination
|
||||||
|
@ -62,4 +65,7 @@ class EpicsTableController
|
||||||
hideEpicTableOption: () ->
|
hideEpicTableOption: () ->
|
||||||
return @.timer = @timeout (=> @.displayOptions = false), 400
|
return @.timer = @timeout (=> @.displayOptions = false), 400
|
||||||
|
|
||||||
|
updateViewOptions: () ->
|
||||||
|
@storage.set(@.hash, @.column)
|
||||||
|
|
||||||
angular.module("taigaEpics").controller("EpicsTableCtrl", EpicsTableController)
|
angular.module("taigaEpics").controller("EpicsTableCtrl", EpicsTableController)
|
||||||
|
|
|
@ -6,6 +6,7 @@ mixin epicSwitch(name, model)
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
ng-checked= model
|
ng-checked= model
|
||||||
ng-model= model
|
ng-model= model
|
||||||
|
ng-change="vm.updateViewOptions()"
|
||||||
)
|
)
|
||||||
div
|
div
|
||||||
span.check-text.check-yes(translate="COMMON.YES")
|
span.check-text.check-yes(translate="COMMON.YES")
|
||||||
|
@ -46,7 +47,7 @@ mixin epicSwitch(name, model)
|
||||||
button.epics-table-option-button.e2e-epics-column-button(ng-click="vm.displayOptions = true")
|
button.epics-table-option-button.e2e-epics-column-button(ng-click="vm.displayOptions = true")
|
||||||
span(translate="EPICS.TABLE.VIEW_OPTIONS")
|
span(translate="EPICS.TABLE.VIEW_OPTIONS")
|
||||||
tg-svg(svg-icon="icon-arrow-down")
|
tg-svg(svg-icon="icon-arrow-down")
|
||||||
form.epics-table-dropdown.e2e-epics-column-dropdown(
|
form.epics-table-dropdown.e2e-epics-column-dropdown.ng-hide(
|
||||||
ng-show="vm.displayOptions"
|
ng-show="vm.displayOptions"
|
||||||
ng-mouseenter="vm.keepEpicTableOption()"
|
ng-mouseenter="vm.keepEpicTableOption()"
|
||||||
)
|
)
|
||||||
|
@ -86,7 +87,7 @@ mixin epicSwitch(name, model)
|
||||||
for="switch-progress"
|
for="switch-progress"
|
||||||
)
|
)
|
||||||
+epicSwitch('switch-progress', 'vm.column.progress')
|
+epicSwitch('switch-progress', 'vm.column.progress')
|
||||||
|
|
||||||
.epics-table-body(
|
.epics-table-body(
|
||||||
tg-epics-sortable="vm.reorderEpic(epic, newIndex)"
|
tg-epics-sortable="vm.reorderEpic(epic, newIndex)"
|
||||||
infinite-scroll="vm.nextPage()"
|
infinite-scroll="vm.nextPage()"
|
||||||
|
@ -101,5 +102,5 @@ mixin epicSwitch(name, model)
|
||||||
epic="epic"
|
epic="epic"
|
||||||
column="vm.column"
|
column="vm.column"
|
||||||
)
|
)
|
||||||
|
|
||||||
div(tg-loading="vm.loadingEpics")
|
div(tg-loading="vm.loadingEpics")
|
||||||
|
|
Loading…
Reference in New Issue