Skip to content

Commit

Permalink
Merge pull request #988 from replicatedhq/laverya/listDownstreamsForApp
Browse files Browse the repository at this point in the history
remove listDownstreamsForApp
  • Loading branch information
laverya committed Aug 22, 2020
2 parents 29e676d + 6b85d0a commit 0117fba
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 83 deletions.
15 changes: 0 additions & 15 deletions kotsadm/api/src/kots_app/kots_app_store.ts
Expand Up @@ -381,21 +381,6 @@ export class KotsAppStore {
return clusterIds;
}

async listDownstreamsForApp(appId: string): Promise<string[]> {
const q = `select downstream_name from app_downstream where app_id = $1`;
const v = [
appId,
];

const result = await this.pool.query(q, v);
const downstreams: string[] = [];
for (const row of result.rows) {
downstreams.push(row.downstream_name);
}

return downstreams;
}

async listAppsForCluster(clusterId: string): Promise<KotsApp[]> {
const q = `select app_id from app_downstream where cluster_id = $1`;
const v = [
Expand Down
14 changes: 0 additions & 14 deletions kotsadm/api/src/kots_app/resolvers/kots_app_queries.ts
Expand Up @@ -26,20 +26,6 @@ export function KotsQueries(stores: Stores, params: Params) {
return app.toSchema(downstreams, stores);
},

async listDownstreamsForApp(root: any, args: any, context: Context): Promise<Cluster[]> {
const { slug } = args;
const appId = await stores.kotsAppStore.getIdFromSlug(slug);
const app = await context.getApp(appId);

const downstreams = await stores.clusterStore.listClustersForKotsApp(app.id);
let results: Cluster[] = [];
_.map(downstreams, (downstream) => {
const kotsSchemaCluster = downstream.toKotsAppSchema(appId, stores);
results.push(kotsSchemaCluster);
});
return results;
},

async listPendingKotsVersions(root: any, args: any, context: Context): Promise<KotsVersion[]> {
const { slug, clusterId } = args;
const id = await stores.kotsAppStore.getIdFromSlug(slug);
Expand Down
1 change: 0 additions & 1 deletion kotsadm/api/src/schema/query.ts
Expand Up @@ -17,7 +17,6 @@ export const Query = `
getGitOpsRepo: KotsGitOps
getKotsApp(slug: String!): KotsApp
getKotsAppDashboard(slug: String!, clusterId: String): KotsAppDashboard
listDownstreamsForApp(slug: String!): [Cluster]
getKotsDownstreamHistory(clusterSlug: String!, upstreamSlug: String!): [KotsVersion]
listPendingKotsVersions(slug: String!): [KotsVersion]
listPastKotsVersions(slug: String!): [KotsVersion]
Expand Down
24 changes: 0 additions & 24 deletions kotsadm/web/src/components/apps/AppDetailPage.jsx
Expand Up @@ -6,7 +6,6 @@ import { Helmet } from "react-helmet";
import Modal from "react-modal";

import withTheme from "@src/components/context/withTheme";
import { listDownstreamsForApp } from "@src/queries/AppsQueries";
import { KotsSidebarItem } from "@src/components/watches/WatchSidebarItem";
import { HelmChartSidebarItem } from "@src/components/watches/WatchSidebarItem";
import NotFound from "../static/NotFound";
Expand Down Expand Up @@ -445,27 +444,4 @@ export default compose(
withApollo,
withRouter,
withTheme,
graphql(listDownstreamsForApp, {
name: "listDownstreamsForAppQuery",
skip: props => {
const { slug } = props.match.params;

// Skip if no variables (user at "/watches" URL)
if (!slug) {
return true;
}

return false;

},
options: props => {
const { slug } = props.match.params;
return {
fetchPolicy: "no-cache",
variables: {
slug: slug
}
}
}
})
)(AppDetailPage);
29 changes: 0 additions & 29 deletions kotsadm/web/src/queries/AppsQueries.js
Expand Up @@ -225,35 +225,6 @@ export const getKotsAppRaw = `
`;
export const getKotsApp = gql(getKotsAppRaw);

export const listDownstreamsForAppRaw = `
query listDownstreamsForApp($slug: String!) {
listDownstreamsForApp(slug: $slug) {
id
title
slug
createdOn
lastUpdated
currentVersion {
title
status
createdOn
sequence
deployedAt
yamlErrors {
path
error
}
}
shipOpsRef {
token
}
totalApplicationCount
}
}
`;

export const listDownstreamsForApp = gql(listDownstreamsForAppRaw);

export const getKotsDownstreamHistoryRaw = `
query getKotsDownstreamHistory($clusterSlug: String!, $upstreamSlug: String!) {
getKotsDownstreamHistory(clusterSlug: $clusterSlug, upstreamSlug: $upstreamSlug) {
Expand Down

0 comments on commit 0117fba

Please sign in to comment.