Closed tulsiojha closed 3 days ago
This PR implements environment-specific service binding functionality by cleaning up unused code and adding cluster-based service visibility. The changes primarily focus on environment tab management and service binding route handling.
sequenceDiagram
participant User
participant UI
participant Backend
participant GQLServerHandler
User->>UI: Access service binding route
UI->>Backend: Call loader function
Backend->>GQLServerHandler: getEnvironment(environment)
GQLServerHandler-->>Backend: Return environment data
alt Environment has no clusterName
Backend->>UI: Redirect to environment page
else Environment has clusterName
Backend->>GQLServerHandler: listServiceBinding(environment)
GQLServerHandler-->>Backend: Return service bindings data
Backend->>UI: Display service bindings
end
classDiagram
class EnvironmentTabs {
+EnvironmentTabs(env: IEnvironment)
+CommonTabs
-useParams()
-parseName(env)
}
class IEnvironment {
+String displayName
+String clusterName
}
EnvironmentTabs --> IEnvironment: uses
Change | Details | Files |
---|---|---|
Refactored environment tabs component to handle cluster-dependent service visibility |
|
src/apps/console/routes/_main+/$account+/env+/$environment+/_layout.tsx |
Enhanced service binding route with environment validation and redirection |
|
src/apps/console/routes/_main+/$account+/env+/$environment+/services/route.tsx |
Code cleanup and optimization |
|
src/apps/console/routes/_main+/$account+/env+/$environment+/_layout.tsx package-lock.json |
Summary by Sourcery
Refactor the environment layout and service route components to improve code clarity and functionality. Remove unused code and dependencies, and enhance the EnvironmentTabs component to conditionally filter tabs based on environment properties. Update the service route loader to handle redirection based on the presence of a cluster name.
Enhancements: