diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-05-02 17:50:04 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-05-02 17:50:04 +0300 |
commit | e35c38e3a1fc270bcb960619f54a10078e2a39e0 (patch) | |
tree | d32b8d9c85867a122199674891f85cfbf8515afc | |
parent | 850a6c65b1a4a76b7b31d88e499ce61af7ceb27f (diff) | |
parent | 751302a16e2adc85fe0647f51df5fad24e1f12b0 (diff) |
Merge branch 'refactor/move-sidebar-time-tracking-vue-component' into 'master'
Move SidebarTimeTracking vue component
See merge request gitlab-org/gitlab-ce!18677
-rw-r--r-- | app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue (renamed from app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js) | 35 | ||||
-rw-r--r-- | app/assets/javascripts/sidebar/mount_sidebar.js | 2 | ||||
-rw-r--r-- | changelogs/unreleased/refactor-move-sidebar-time-tracking-vue-component.yml | 5 |
3 files changed, 25 insertions, 17 deletions
diff --git a/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js b/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue index 5626cccc022..2e1d6e9643a 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js +++ b/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue @@ -1,3 +1,4 @@ +<script> import $ from 'jquery'; import _ from 'underscore'; @@ -10,14 +11,17 @@ import Mediator from '../../sidebar_mediator'; import eventHub from '../../event_hub'; export default { + components: { + IssuableTimeTracker, + }, data() { return { mediator: new Mediator(), store: new Store(), }; }, - components: { - IssuableTimeTracker, + mounted() { + this.listenForQuickActions(); }, methods: { listenForQuickActions() { @@ -41,18 +45,17 @@ export default { } }, }, - mounted() { - this.listenForQuickActions(); - }, - template: ` - <div class="block"> - <issuable-time-tracker - :time_estimate="store.timeEstimate" - :time_spent="store.totalTimeSpent" - :human_time_estimate="store.humanTimeEstimate" - :human_time_spent="store.humanTotalTimeSpent" - :rootPath="store.rootPath" - /> - </div> - `, }; +</script> + +<template> + <div class="block"> + <issuable-time-tracker + :time_estimate="store.timeEstimate" + :time_spent="store.totalTimeSpent" + :human_time_estimate="store.humanTimeEstimate" + :human_time_spent="store.humanTotalTimeSpent" + :root-path="store.rootPath" + /> + </div> +</template> diff --git a/app/assets/javascripts/sidebar/mount_sidebar.js b/app/assets/javascripts/sidebar/mount_sidebar.js index 26eb4cffba3..3086e7d0fc9 100644 --- a/app/assets/javascripts/sidebar/mount_sidebar.js +++ b/app/assets/javascripts/sidebar/mount_sidebar.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import Vue from 'vue'; -import SidebarTimeTracking from './components/time_tracking/sidebar_time_tracking'; +import SidebarTimeTracking from './components/time_tracking/sidebar_time_tracking.vue'; import SidebarAssignees from './components/assignees/sidebar_assignees.vue'; import ConfidentialIssueSidebar from './components/confidential/confidential_issue_sidebar.vue'; import SidebarMoveIssue from './lib/sidebar_move_issue'; diff --git a/changelogs/unreleased/refactor-move-sidebar-time-tracking-vue-component.yml b/changelogs/unreleased/refactor-move-sidebar-time-tracking-vue-component.yml new file mode 100644 index 00000000000..4f578bfcf26 --- /dev/null +++ b/changelogs/unreleased/refactor-move-sidebar-time-tracking-vue-component.yml @@ -0,0 +1,5 @@ +--- +title: Move SidebarTimeTracking vue component +merge_request: 18677 +author: George Tsiolis +type: performance |