Skip to content

Commit

Permalink
docs: fix fetching issue for tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Oct 23, 2023
1 parent 84be8c2 commit 84c1f89
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/src/components/Dashboard/AllRepositories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const AllRepositories = ({ location }: PageRendererProps) => {
const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
query AllRepositoriesTracking {
# get only the latest
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 11) {
nodes {
fields {
currentComponents
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Dashboard/AllRepositoriesComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const AllRepositoriesComponent = ({ location }: PageRendererProps) => {

const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
query AllTrackingComponentQuery {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 11) {
nodes {
createdAt
name
Expand Down
5 changes: 3 additions & 2 deletions docs/src/components/Dashboard/Difference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ const DataDiffTemplate = ({ location }: PageRendererProps) => {
`);

const { nodes } = allTracking;
const first = nodes.slice(0, 8);
const last = nodes.slice(-8);
const TRACKED_REPOSITORIES_COUNT = 11;
const first = nodes.slice(0, TRACKED_REPOSITORIES_COUNT);
const last = nodes.slice(-TRACKED_REPOSITORIES_COUNT);

const getSum = (data: TrackingNode[]) =>
data.reduce((acc, cur) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Dashboard/Repository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { SchemeTrackingNode } from "./interfaces";
export default function Tracking({ location }: PageRendererProps) {
const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
query TrackingDataQuery {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 11) {
nodes {
id
name
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Dashboard/RepositoryComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ComponentPage = ({ location }) => {

const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
query TrackingComponentQuery {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 11) {
nodes {
createdAt
name
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Dashboard/Tracking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Tracking = ({ location }: PageRendererProps) => {
const [devMode] = useDevMode();
const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql`
query TrackingPageQuery {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) {
allTracking(sort: { fields: createdAt, order: DESC }, limit: 11) {
nodes {
name
createdAt
Expand Down

0 comments on commit 84c1f89

Please sign in to comment.