From d6ab993519bff56a3c5082738e20aa9535fd269f Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 9 Aug 2018 12:00:53 +0100 Subject: [PATCH 1/3] Dont hide history entries while loading. --- services/web/app/views/project/editor/history/entriesListV2.pug | 1 - 1 file changed, 1 deletion(-) diff --git a/services/web/app/views/project/editor/history/entriesListV2.pug b/services/web/app/views/project/editor/history/entriesListV2.pug index e08de0effd..ca0c48b722 100644 --- a/services/web/app/views/project/editor/history/entriesListV2.pug +++ b/services/web/app/views/project/editor/history/entriesListV2.pug @@ -119,7 +119,6 @@ script(type="text/ng-template", id="historyEntriesListTpl") users="$ctrl.users" on-select="$ctrl.onEntrySelect({ selectedEntry: selectedEntry })" on-label-delete="$ctrl.onLabelDelete({ label: label })" - ng-show="!$ctrl.isLoading" ) .loading(ng-show="$ctrl.isLoading") i.fa.fa-spin.fa-refresh From 4f4ab579583f2c0b237a68e4dc5aed2fd4eefadc Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 9 Aug 2018 12:05:00 +0100 Subject: [PATCH 2/3] Use controller binding in the label tooltip. --- services/web/app/views/project/editor/history.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/editor/history.pug b/services/web/app/views/project/editor/history.pug index 2f3f317561..fec7327d6f 100644 --- a/services/web/app/views/project/editor/history.pug +++ b/services/web/app/views/project/editor/history.pug @@ -92,7 +92,7 @@ script(type="text/ng-template", id="historyLabelTooltipTpl") i.fa.fa-tag |  {{ $ctrl.labelText }} p.history-label-tooltip-owner #{translate("history_label_created_by")} {{ $ctrl.labelOwnerName }} - time.history-label-tooltip-datetime {{ labelCreationDateTime | formatDate }} + time.history-label-tooltip-datetime {{ $ctrl.labelCreationDateTime | formatDate }} script(type="text/ng-template", id="historyV2DeleteLabelModalTemplate") From 64a66aafd5452ddd9728511423186d974678360b Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 9 Aug 2018 12:16:36 +0100 Subject: [PATCH 3/3] Protect against reading the project members list too soon. --- .../ide/history/controllers/HistoryListController.coffee | 8 ++++++-- .../history/controllers/HistoryV2ListController.coffee | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/ide/history/controllers/HistoryListController.coffee b/services/web/public/coffee/ide/history/controllers/HistoryListController.coffee index cfd5bb75c5..6c9890c6e5 100644 --- a/services/web/public/coffee/ide/history/controllers/HistoryListController.coffee +++ b/services/web/public/coffee/ide/history/controllers/HistoryListController.coffee @@ -6,13 +6,17 @@ define [ App.controller "HistoryListController", ["$scope", "$modal", "ide", ($scope, $modal, ide) -> $scope.hoveringOverListSelectors = false - projectUsers = $scope.project.members.concat $scope.project.owner + $scope.projectUsers = [] + + $scope.$watch "project.members", (newVal) -> + if newVal? + $scope.projectUsers = newVal.concat $scope.project.owner # This method (and maybe the one below) will be removed soon. User details data will be # injected into the history API responses, so we won't need to fetch user data from other # local data structures. _getUserById = (id) -> - _.find projectUsers, (user) -> + _.find $scope.projectUsers, (user) -> curUserId = user?._id or user?.id curUserId == id diff --git a/services/web/public/coffee/ide/history/controllers/HistoryV2ListController.coffee b/services/web/public/coffee/ide/history/controllers/HistoryV2ListController.coffee index f7c602733f..1635ec9f0a 100644 --- a/services/web/public/coffee/ide/history/controllers/HistoryV2ListController.coffee +++ b/services/web/public/coffee/ide/history/controllers/HistoryV2ListController.coffee @@ -7,8 +7,13 @@ define [ $scope.hoveringOverListSelectors = false $scope.listConfig = showOnlyLabelled: false - $scope.projectUsers = $scope.project.members.concat $scope.project.owner + $scope.projectUsers = [] + + $scope.$watch "project.members", (newVal) -> + if newVal? + $scope.projectUsers = newVal.concat $scope.project.owner + $scope.loadMore = () => ide.historyManager.fetchNextBatchOfUpdates()