diff --git a/src/views/Gantt.vue b/src/views/Gantt.vue index 984b15ac6..e7d79b2c5 100644 --- a/src/views/Gantt.vue +++ b/src/views/Gantt.vue @@ -80,25 +80,6 @@ along with this program. If not, see . prefix="Tasks Per Page" v-model="tasksPerPage"/> - - - } - */ - const jobsRange = useInitialOptions('jobsRange', { props, emit }, 100) - return { tasksPerPage, jobsFilter, - jobsRange, } }, @@ -244,30 +218,8 @@ export default { workflowIDs () { return [this.workflowId] }, - totalJobs () { - return Object.values(this.callback.jobs).flat().length - }, filteredJobs () { - // Flatten all jobs into a single array - const allJobs = Object.values(this.callback.jobs).flat() - - // Sort jobs by submission time in descending order - const sortedJobs = allJobs.sort((a, b) => new Date(b.submittedTime) - new Date(a.submittedTime)) - - // Take the latest N jobs based on user input - const latestJobs = sortedJobs.slice(0, this.jobsRange) - - // Group the latest jobs by task name - const groupedJobs = latestJobs.reduce((acc, job) => { - if (!acc[job.name]) { - acc[job.name] = [] - } - acc[job.name].push(job) - return acc - }, {}) - - // Apply filters to the grouped jobs - return matchTasks(groupedJobs, this.jobsFilter) + return matchTasks(this.callback.jobs, this.jobsFilter) }, platformOptions () { return platformOptions(this.callback.jobs) @@ -278,16 +230,6 @@ export default { }, methods: { - updateJobsRange (event) { - const value = event.target.value - const numValue = Number(value) - // Ensure the value is a number and not less than 1. - this.jobsRange = Math.max(1, numValue) - // Focuses on text input so the counter shows up - this.$nextTick(() => { - this.$refs.jobRangeInput.focus() - }) - }, /** * Run the one-off query for historical job data and pass its results * through the callback diff --git a/tests/e2e/specs/gantt.cy.js b/tests/e2e/specs/gantt.cy.js index 396135c21..d4a3b1d9e 100644 --- a/tests/e2e/specs/gantt.cy.js +++ b/tests/e2e/specs/gantt.cy.js @@ -82,31 +82,3 @@ describe('Filter save state', () => { checkOption('#c-gantt-tasks-per-page', '25') }) }) - -describe('Render the correct amount of jobs', () => { - it('allows changing the number of jobs displayed', () => { - cy.visit('/#/gantt/one') - let jobsToShow = 5 - - cy.get('#c-gantt-job-range') - .clear() - .type(jobsToShow) - .blur() // Trigger the change event - .should('have.value', jobsToShow) - - cy.get('.vue-apexcharts') - .should('be.visible') - .contains('d1') - - jobsToShow = 4 - - cy.get('#c-gantt-job-range') - .clear() - .type(jobsToShow) - .blur() // Trigger the change event - .should('have.value', jobsToShow) - - cy.get('.vue-apexcharts') - .contains('d1').should('not.exist') - }) -})