Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Commit 5068789

Browse files
authored
Repo view limits (#468)
1 parent 6ddb0ef commit 5068789

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

web/dashboard/src/components/env/env.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export class Env extends Component {
5757
{this.state.isClosed ? null : (
5858
<>
5959
{renderPullRequests(pullRequests)}
60-
<div className="bg-white shadow p-4 sm:p-6 lg:p-8">
60+
<div className="bg-white shadow p-4 sm:p-6 lg:p-8 space-y-4">
61+
{renderedServices.length === 10 &&
62+
<span className="text-xs text-blue-700">Displaying at most 10 application configurations per environment.</span>}
6163
{renderedServices.length > 0
6264
?
6365
<>
@@ -116,6 +118,10 @@ function renderServices(stacks, envConfigs, envName, repoRolloutHistory, navigat
116118
)
117119
})
118120

121+
if (services.length >= 10) {
122+
return services.slice(0, 10);
123+
}
124+
119125
const configsWeHaventDeployed = configsWeHave.filter(config => !configsWeDeployed.includes(config));
120126

121127
services.push(
@@ -146,7 +152,7 @@ function renderServices(stacks, envConfigs, envName, repoRolloutHistory, navigat
146152
}
147153
)
148154
)
149-
return services
155+
return services.slice(0, 10)
150156
}
151157

152158
function kubernetesAlertsByDeploymentName(kubernetesAlerts, deploymentName) {

web/dashboard/src/views/repo/repo.jsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export default class Repo extends Component {
439439
envName={envName}
440440
env={filteredEnvs[envName]}
441441
repoRolloutHistory={repoRolloutHistory}
442-
envConfigs={envConfigs[envName]}
442+
envConfigs={limitedEnvConfigs(envConfigs[envName])}
443443
navigateToConfigEdit={this.navigateToConfigEdit}
444444
linkToDeployment={this.linkToDeployment}
445445
newConfig={this.newConfig}
@@ -502,12 +502,18 @@ function stacks(connectedAgents, envName) {
502502
for (const agentName of Object.keys(connectedAgents)) {
503503
const agent = connectedAgents[agentName];
504504
if (agentName === envName) {
505-
return agent.stacks;
505+
return agent.stacks.slice(0, 10);
506506
}
507507
}
508508
return [];
509509
}
510510

511+
function limitedEnvConfigs(envConfigs) {
512+
if (envConfigs) {
513+
return envConfigs.slice(0, 10)
514+
}
515+
}
516+
511517
function envsForRepoFilteredBySearchFilter(envs, connectedAgents, repoName, searchFilter) {
512518
let filteredEnvs = {};
513519

0 commit comments

Comments
 (0)