Skip to content

Add error component on invalid URL and managed-obj endpoint #1694

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

Merged
merged 5 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove console logs
  • Loading branch information
iamfaran committed May 20, 2025
commit ed55d120c47cb21e2a0160f4aea1a884396bb980
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const WorkspaceDetail: React.FC = () => {
const { workspace, isLoading, error, toggleManagedStatus } = useWorkspaceContext();
const { openDeployModal } = useDeployModal();

console.log("workspace render", workspace);

const [isToggling, setIsToggling] = useState(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export async function getWorkspaceDataSources(
orgId: workspaceId
}
});
console.log("data source response",response);

// Check if response is valid
if (!response.data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ export async function getManagedQueries(environmentId: string): Promise<Query[]>
environmentId
}
});
console.log("Managed queries response function:", response.data);

if (!response.data.data || !Array.isArray(response.data.data)) {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ export async function getEnvironmentUserGroups(

// Make the API request to get user groups
const response = await axios.get(`${apiServiceUrl}/api/groups/list`, { headers });
console.log(response);

// Check if response is valid
if (!response.data) {
Expand Down Expand Up @@ -359,8 +358,7 @@ export async function getWorkspaceDataSources(
orgId: workspaceId
}
});
console.log("data source response",response);


// Check if response is valid
if (!response.data) {
return [];
Expand Down Expand Up @@ -434,7 +432,7 @@ export async function getWorkspaceQueries(
if (!response.data) {
return { queries: [], total: 0 };
}
console.log("RESPONSE DATA QUERIES",response.data.data);

// Map the response to include id field required by DeployableItem
const queries = response.data.data.map(query => ({
...query,
Expand All @@ -444,8 +442,6 @@ export async function getWorkspaceQueries(
managed: false // Default to unmanaged
}));

console.log("queries",queries);

return {
queries,
total: response.data.total
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,15 @@ export interface MergedQueriesResult {
// Fetch regular queries

const regularQueries = await getWorkspaceQueries(workspaceId, apiKey, apiServiceUrl);
console.log("Regular queries response:", regularQueries);

const managedObjects = await getManagedObjects(environmentId, ManagedObjectType.QUERY);
console.log("Managed queries response:", managedObjects);

// Create a set of managed query GIDs for quick lookup
const managedQueryGids = new Set(managedObjects.map(obj => obj.objGid));
console.log("Managed query GIDs:", Array.from(managedQueryGids));

// Mark regular queries as managed if they exist in managed queries
const mergedQueries = regularQueries.queries.map((query: Query) => {
const isManaged = managedQueryGids.has(query.gid);
console.log(`Query ${query.name} (gid: ${query.gid}) is ${isManaged ? "managed" : "not managed"}`);

return {
...query,
Expand All @@ -52,11 +48,6 @@ export interface MergedQueriesResult {
// Calculate stats
const total = mergedQueries.length;
const managed = mergedQueries.filter(query => query.managed).length;
console.log("Generated stats:", {
total,
managed,
unmanaged: total - managed
});

return {
queries: mergedQueries,
Expand Down