Skip to content

Commit

Permalink
chore: temporary disable dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Apr 6, 2022
1 parent ac52cc2 commit 45267c7
Show file tree
Hide file tree
Showing 12 changed files with 636 additions and 635 deletions.
16 changes: 8 additions & 8 deletions docs/plugins/dashboard/gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from "path";
// import path from "path";

const config = {
plugins: [
Expand All @@ -8,13 +8,13 @@ const config = {
typeName: `Tracking`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "data",
path: path.resolve(__dirname, "../../data"),
},
},
// {
// resolve: "gatsby-source-filesystem",
// options: {
// name: "data",
// path: path.resolve(__dirname, "../../data"),
// },
// },
{
resolve: `gatsby-plugin-create-client-paths`,
options: { prefixes: [`/dashboard/*`] },
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/dashboard/gatsby-node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import onPreInit from "./gatsby/onPreInit";
import createSchemaCustomization from "./gatsby/createSchemeCustomization";
import createPages from "./gatsby/createPages";
// import createPages from "./gatsby/createPages";

export { createPages, onPreInit, createSchemaCustomization };
export { onPreInit, createSchemaCustomization };
114 changes: 57 additions & 57 deletions docs/src/components/Dashboard/AllRepositories.tsx
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
import React from "react";
import { PageRendererProps, graphql, useStaticQuery } from "gatsby";
// import React from "react";
// import { PageRendererProps, graphql, useStaticQuery } from "gatsby";

import ComponentsList from "./components/ComponentList";
import DocLayout from "../DocLayout";
import { SchemeTrackingNode } from "./interfaces";
// import ComponentsList from "./components/ComponentList";
// import DocLayout from "../DocLayout";
// import { SchemeTrackingNode } from "./interfaces";

const AllRepositories = ({ location }: PageRendererProps) => {
const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
query AllRepositoriesTracking {
# get only the latest
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
nodes {
createdAt
trackedData {
instances
category
icon
isDeprecated
name
}
}
}
}
`);
// const AllRepositories = ({ location }: PageRendererProps) => {
// const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
// query AllRepositoriesTracking {
// # get only the latest
// allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
// nodes {
// createdAt
// trackedData {
// instances
// category
// icon
// isDeprecated
// name
// }
// }
// }
// }
// `);

const components = allTracking.nodes.reduce((acc, cur) => {
cur.trackedData
.filter(source => !source.icon)
.forEach(({ name, instances, category, isDeprecated }) => {
if (!acc[name]) {
acc[name] = {
name,
instances,
category,
isDeprecated,
slug: `/dashboard/tracking/allrepositories/${name.toLowerCase()}`,
};
} else {
const prev = acc[name];
// const components = allTracking.nodes.reduce((acc, cur) => {
// cur.trackedData
// .filter(source => !source.icon)
// .forEach(({ name, instances, category, isDeprecated }) => {
// if (!acc[name]) {
// acc[name] = {
// name,
// instances,
// category,
// isDeprecated,
// slug: `/dashboard/tracking/allrepositories/${name.toLowerCase()}`,
// };
// } else {
// const prev = acc[name];

acc[name] = {
...acc[name],
instances: prev.instances + instances,
};
}
});
// acc[name] = {
// ...acc[name],
// instances: prev.instances + instances,
// };
// }
// });

return acc;
}, []);
// return acc;
// }, []);

return (
<DocLayout
location={location}
path="/dashboard/tracking/allrepositories/"
title="All Repositories"
noElevation
>
<ComponentsList components={Object.values(components)} />
</DocLayout>
);
};
// return (
// <DocLayout
// location={location}
// path="/dashboard/tracking/allrepositories/"
// title="All Repositories"
// noElevation
// >
// <ComponentsList components={Object.values(components)} />
// </DocLayout>
// );
// };

export default AllRepositories;
// export default AllRepositories;
Loading

0 comments on commit 45267c7

Please sign in to comment.