summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-01-11 19:02:30 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-01-11 19:02:30 +0000
commit8b6162eeefcf15b2d52a9cb6f0049de38b65ec23 (patch)
treed2b812bec78b4699e5a806edd772beee281b713e
parentd9aaf0ba81c3138fc315d669398b8306b284b7cf (diff)
downloadgitlab-ce-8b6162eeefcf15b2d52a9cb6f0049de38b65ec23.tar.gz
Remove remaining word from artifacts date
-rw-r--r--app/assets/javascripts/job.js12
-rw-r--r--app/views/projects/jobs/_sidebar.html.haml2
-rw-r--r--spec/javascripts/job_spec.js5
3 files changed, 2 insertions, 17 deletions
diff --git a/app/assets/javascripts/job.js b/app/assets/javascripts/job.js
index 8f32dcc94e2..7927e97ea47 100644
--- a/app/assets/javascripts/job.js
+++ b/app/assets/javascripts/job.js
@@ -71,7 +71,6 @@ export default class Job {
.off('resize.build')
.on('resize.build', _.throttle(this.sidebarOnResize.bind(this), 100));
- this.updateArtifactRemoveDate();
this.initAffixTopArea();
this.getBuildTrace();
@@ -261,16 +260,7 @@ export default class Job {
sidebarOnClick() {
if (this.shouldHideSidebarForViewport()) this.toggleSidebar();
}
- // eslint-disable-next-line class-methods-use-this, consistent-return
- updateArtifactRemoveDate() {
- const $date = $('.js-artifacts-remove');
- if ($date.length) {
- const date = $date.text();
- return $date.text(
- timeFor(new Date(date.replace(/([0-9]+)-([0-9]+)-([0-9]+)/g, '$1/$2/$3'))),
- );
- }
- }
+
// eslint-disable-next-line class-methods-use-this
populateJobs(stage) {
$('.build-job').hide();
diff --git a/app/views/projects/jobs/_sidebar.html.haml b/app/views/projects/jobs/_sidebar.html.haml
index a71333497e6..e779473c239 100644
--- a/app/views/projects/jobs/_sidebar.html.haml
+++ b/app/views/projects/jobs/_sidebar.html.haml
@@ -24,7 +24,7 @@
- elsif @build.has_expiring_artifacts?
%p.build-detail-row
The artifacts will be removed in
- %span.js-artifacts-remove= @build.artifacts_expire_at
+ %span= time_ago_in_words @build.artifacts_expire_at
- if @build.artifacts?
.btn-group.btn-group-justified{ role: :group }
diff --git a/spec/javascripts/job_spec.js b/spec/javascripts/job_spec.js
index b740c9ed893..feb341d22e6 100644
--- a/spec/javascripts/job_spec.js
+++ b/spec/javascripts/job_spec.js
@@ -52,11 +52,6 @@ describe('Job', () => {
expect($('.build-job[data-stage="test"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="deploy"]').is(':visible')).toBe(false);
});
-
- it('displays the remove date correctly', () => {
- const removeDateElement = document.querySelector('.js-artifacts-remove');
- expect(removeDateElement.innerText.trim()).toBe('1 year remaining');
- });
});
describe('running build', () => {