diff options
author | Phil Hughes <me@iamphill.com> | 2017-06-13 16:47:50 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-06-13 16:47:50 +0000 |
commit | a90b18b97f1ad6f7c3d2f3314332a2511d4db46c (patch) | |
tree | 78c5dfc82d34632ff0a9137f03df459dcc970f63 | |
parent | 4ea4fdaf48bf62712cb83d2cb5c8e8997fdfa688 (diff) | |
parent | aeabd307ba819a96c27b756ba7bb1e3089354500 (diff) | |
download | gitlab-ce-a90b18b97f1ad6f7c3d2f3314332a2511d4db46c.tar.gz |
Merge branch '33642-timeago-update' into 'master'
Remove js classes from vue component that are not needed in vue component
Closes #33642
See merge request !12133
-rw-r--r-- | app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue | 16 | ||||
-rw-r--r-- | spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js | 13 |
2 files changed, 3 insertions, 26 deletions
diff --git a/app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue b/app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue index af2b4c6786e..1c6ef071a6d 100644 --- a/app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue +++ b/app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue @@ -20,12 +20,6 @@ export default { default: 'top', }, - shortFormat: { - type: Boolean, - required: false, - default: false, - }, - cssClass: { type: String, required: false, @@ -37,18 +31,12 @@ export default { tooltipMixin, timeagoMixin, ], - - computed: { - timeagoCssClass() { - return this.shortFormat ? 'js-short-timeago' : 'js-timeago'; - }, - }, }; </script> <template> <time - :class="[timeagoCssClass, cssClass]" - class="js-timeago js-timeago-render" + :class="cssClass" + class="js-vue-timeago" :title="tooltipTitle(time)" :data-placement="tooltipPlacement" data-container="body" diff --git a/spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js b/spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js index bf28019ef24..f3b4adc0b70 100644 --- a/spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js +++ b/spec/javascripts/vue_shared/components/time_ago_tooltip_spec.js @@ -22,7 +22,7 @@ describe('Time ago with tooltip component', () => { }).$mount(); expect(vm.$el.tagName).toEqual('TIME'); - expect(vm.$el.classList.contains('js-timeago')).toEqual(true); + expect(vm.$el.classList.contains('js-vue-timeago')).toEqual(true); expect( vm.$el.getAttribute('data-original-title'), ).toEqual(gl.utils.formatDate('2017-05-08T14:57:39.781Z')); @@ -44,17 +44,6 @@ describe('Time ago with tooltip component', () => { expect(vm.$el.getAttribute('data-placement')).toEqual('bottom'); }); - it('should render short format class', () => { - vm = new TimeagoTooltip({ - propsData: { - time: '2017-05-08T14:57:39.781Z', - shortFormat: true, - }, - }).$mount(); - - expect(vm.$el.classList.contains('js-short-timeago')).toEqual(true); - }); - it('should render provided html class', () => { vm = new TimeagoTooltip({ propsData: { |