Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update job table history size #1281

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/components/pipeline/jobs/table/cell/history/styles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
@mixin styles {
.history-cell {
display: flex;
max-width: 9rem;
overflow: scroll;

.build-history-container {
padding: 1rem 0;

a {
display: flex;

Expand Down
2 changes: 2 additions & 0 deletions app/components/pipeline/jobs/table/cell/job/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
display: flex;
height: 1.5rem;
width: 1.5rem;
margin: 1rem 0;

a {
display: flex;
Expand All @@ -19,6 +20,7 @@
}

.job-name {
padding: 1rem 0;
overflow: scroll;
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/components/pipeline/jobs/table/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export default class PipelineJobsTableComponent extends Component {
this.dataReloader = new DataReloader(
this.shuttle,
jobIds,
INITIAL_PAGE_SIZE
INITIAL_PAGE_SIZE,
this.args.numBuilds
);
const initialJobIds = this.dataReloader.newJobIds();

Expand Down
12 changes: 10 additions & 2 deletions app/components/pipeline/jobs/table/dataReloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ export default class DataReloader {

intervalId;

constructor(shuttle, jobIds, pageSize) {
numBuilds;

constructor(shuttle, jobIds, pageSize, numBuilds) {
this.shuttle = shuttle;
this.jobIdsMatchingFilter = jobIds.slice(0, pageSize);

jobIds.forEach(jobId => {
this.builds[jobId] = [];
});

this.numBuilds = numBuilds || ENV.APP.NUM_BUILDS_LISTED;
}

setCorrectBuildStatus(builds) {
Expand Down Expand Up @@ -73,7 +77,7 @@ export default class DataReloader {
.fetchFromApi(
'get',
`/builds/statuses?jobIds=${jobIds.join('&jobIds=')}&numBuilds=${
ENV.APP.NUM_BUILDS_LISTED
this.numBuilds
}`
)
.then(response => {
Expand All @@ -93,6 +97,10 @@ export default class DataReloader {
});
}

setNumBuilds(numBuilds) {
this.numBuilds = numBuilds;
}

start() {
this.intervalId = setInterval(() => {
if (Object.keys(this.jobCallbacks).length === 0) {
Expand Down
1 change: 1 addition & 0 deletions app/components/pipeline/jobs/table/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

tr {
color: colors.$sd-text;
height: 4rem;

&:hover {
color: colors.$sd-text;
Expand Down