Commit 8b6162ee authored by Filipa Lacerda's avatar Filipa Lacerda

Remove remaining word from artifacts date

parent d9aaf0ba
...@@ -71,7 +71,6 @@ export default class Job { ...@@ -71,7 +71,6 @@ export default class Job {
.off('resize.build') .off('resize.build')
.on('resize.build', _.throttle(this.sidebarOnResize.bind(this), 100)); .on('resize.build', _.throttle(this.sidebarOnResize.bind(this), 100));
this.updateArtifactRemoveDate();
this.initAffixTopArea(); this.initAffixTopArea();
this.getBuildTrace(); this.getBuildTrace();
...@@ -261,16 +260,7 @@ export default class Job { ...@@ -261,16 +260,7 @@ export default class Job {
sidebarOnClick() { sidebarOnClick() {
if (this.shouldHideSidebarForViewport()) this.toggleSidebar(); 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 // eslint-disable-next-line class-methods-use-this
populateJobs(stage) { populateJobs(stage) {
$('.build-job').hide(); $('.build-job').hide();
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
- elsif @build.has_expiring_artifacts? - elsif @build.has_expiring_artifacts?
%p.build-detail-row %p.build-detail-row
The artifacts will be removed in 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? - if @build.artifacts?
.btn-group.btn-group-justified{ role: :group } .btn-group.btn-group-justified{ role: :group }
......
...@@ -52,11 +52,6 @@ describe('Job', () => { ...@@ -52,11 +52,6 @@ describe('Job', () => {
expect($('.build-job[data-stage="test"]').is(':visible')).toBe(false); expect($('.build-job[data-stage="test"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="deploy"]').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', () => { describe('running build', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment