diff --git a/docs/plugins/dashboard/gatsby-config.ts b/docs/plugins/dashboard/gatsby-config.ts index 277f2f890f..a887fd5427 100644 --- a/docs/plugins/dashboard/gatsby-config.ts +++ b/docs/plugins/dashboard/gatsby-config.ts @@ -1,4 +1,4 @@ -import path from "path"; +// import path from "path"; const config = { plugins: [ @@ -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/*`] }, diff --git a/docs/plugins/dashboard/gatsby-node.ts b/docs/plugins/dashboard/gatsby-node.ts index cf3275f5d8..f13f96f76f 100644 --- a/docs/plugins/dashboard/gatsby-node.ts +++ b/docs/plugins/dashboard/gatsby-node.ts @@ -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 }; diff --git a/docs/src/components/Dashboard/AllRepositories.tsx b/docs/src/components/Dashboard/AllRepositories.tsx index fce995e74e..9f58d11f2d 100644 --- a/docs/src/components/Dashboard/AllRepositories.tsx +++ b/docs/src/components/Dashboard/AllRepositories.tsx @@ -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; diff --git a/docs/src/components/Dashboard/AllRepositoriesComponent.tsx b/docs/src/components/Dashboard/AllRepositoriesComponent.tsx index 33d957e906..4ecc6002ed 100644 --- a/docs/src/components/Dashboard/AllRepositoriesComponent.tsx +++ b/docs/src/components/Dashboard/AllRepositoriesComponent.tsx @@ -1,198 +1,198 @@ -import React from "react"; -import { PageRendererProps, graphql, useStaticQuery } from "gatsby"; -import { sortBy, upperFirst } from "lodash"; -import fp from "lodash/fp"; -import { - Table, - TableRow, - TableCell, - TableHead, - TableBody, - Stack, - TextLink, - Modal, - ModalSection, -} from "@kiwicom/orbit-components"; -import { css } from "styled-components"; -import { ChevronDown, ChevronUp } from "@kiwicom/orbit-components/icons"; +// import React from "react"; +// import { PageRendererProps, graphql, useStaticQuery } from "gatsby"; +// import { sortBy, upperFirst } from "lodash"; +// import fp from "lodash/fp"; +// import { +// Table, +// TableRow, +// TableCell, +// TableHead, +// TableBody, +// Stack, +// TextLink, +// Modal, +// ModalSection, +// } from "@kiwicom/orbit-components"; +// import { css } from "styled-components"; +// import { ChevronDown, ChevronUp } from "@kiwicom/orbit-components/icons"; -import DocLayout from "../DocLayout"; -import { sumProperties } from "./helpers"; -import { TrackedData, TrackingProp, SchemeTrackingNode } from "./interfaces"; +// import DocLayout from "../DocLayout"; +// import { sumProperties } from "./helpers"; +// import { TrackedData, TrackingProp, SchemeTrackingNode } from "./interfaces"; -const Sort = ({ children, onClick, isSorted }) => ( - <TextLink - type="secondary" - iconRight={isSorted ? <ChevronUp /> : <ChevronDown />} - onClick={onClick} - > - {children} - </TextLink> -); +// const Sort = ({ children, onClick, isSorted }) => ( +// <TextLink +// type="secondary" +// iconRight={isSorted ? <ChevronUp /> : <ChevronDown />} +// onClick={onClick} +// > +// {children} +// </TextLink> +// ); -const AllRepositoriesComponent = ({ location }: PageRendererProps) => { - const [isOpenModal, setOpenModal] = React.useState(false); - const [propsInstances, setPropsInstances] = React.useState<string[]>([]); - const [isSortedByName, setSortedByName] = React.useState(false); - const [isSortedByInstances, setSortedByInstances] = React.useState(false); - const [allData, setAllData] = React.useState<TrackingProp[] | null>(null); - const { pathname } = location; - const title = pathname.split("/").filter(Boolean).slice(-1)[0]; +// const AllRepositoriesComponent = ({ location }: PageRendererProps) => { +// const [isOpenModal, setOpenModal] = React.useState(false); +// const [propsInstances, setPropsInstances] = React.useState<string[]>([]); +// const [isSortedByName, setSortedByName] = React.useState(false); +// const [isSortedByInstances, setSortedByInstances] = React.useState(false); +// const [allData, setAllData] = React.useState<TrackingProp[] | null>(null); +// const { pathname } = location; +// const title = pathname.split("/").filter(Boolean).slice(-1)[0]; - const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` - query AllTrackingComponentQuery { - allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { - nodes { - createdAt - name - trackedData { - icon - instances - category - isDeprecated - name - props { - name - used - values { - name - used - } - } - sources { - url - props { - name - value - } - } - } - } - } - } - `); +// const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` +// query AllTrackingComponentQuery { +// allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { +// nodes { +// createdAt +// name +// trackedData { +// icon +// instances +// category +// isDeprecated +// name +// props { +// name +// used +// values { +// name +// used +// } +// } +// sources { +// url +// props { +// name +// value +// } +// } +// } +// } +// } +// } +// `); - const component = fp.compose( - fp.map((n: TrackedData[]) => n.find(c => c.name.toLowerCase() === title)), - fp.map(fp.get(["trackedData"])), - )(allTracking.nodes); +// const component = fp.compose( +// fp.map((n: TrackedData[]) => n.find(c => c.name.toLowerCase() === title)), +// fp.map(fp.get(["trackedData"])), +// )(allTracking.nodes); - const props = fp.compose( - sumProperties, - fp.filter(Boolean), - fp.flatten, - fp.map(fp.get("props")), - )(component); +// const props = fp.compose( +// sumProperties, +// fp.filter(Boolean), +// fp.flatten, +// fp.map(fp.get("props")), +// )(component); - const sources = fp.compose(fp.filter(Boolean), fp.flatten, fp.map(fp.get("sources")))(component); +// const sources = fp.compose(fp.filter(Boolean), fp.flatten, fp.map(fp.get("sources")))(component); - React.useEffect(() => { - setAllData(Object.values<TrackingProp>(props)); - }, [setAllData]); +// React.useEffect(() => { +// setAllData(Object.values<TrackingProp>(props)); +// }, [setAllData]); - const handleInstances = (instances, propName, valueName) => { - const filteredProps = instances - .filter(({ props: instanceProps }) => - instanceProps.some(prop => prop.name === propName && prop.value === valueName), - ) - .map(({ url }) => url); +// const handleInstances = (instances, propName, valueName) => { +// const filteredProps = instances +// .filter(({ props: instanceProps }) => +// instanceProps.some(prop => prop.name === propName && prop.value === valueName), +// ) +// .map(({ url }) => url); - setOpenModal(true); - setPropsInstances(filteredProps); - }; +// setOpenModal(true); +// setPropsInstances(filteredProps); +// }; - if (!allData) return null; +// if (!allData) return null; - return ( - <DocLayout location={location} path={location.pathname} title={upperFirst(title)}> - {isOpenModal && ( - <Modal onClose={() => setOpenModal(false)}> - <ModalSection> - <ol - css={css` - list-style-type: decimal; - & > * { - margin-bottom: 0.5rem; - } - `} - > - {propsInstances.map(instance => ( - <li key={instance}> - <TextLink key={instance} title={instance} href={instance}> - {instance.split("/").slice(-4).join("/")} - </TextLink> - </li> - ))} - </ol> - </ModalSection> - </Modal> - )} - <Table> - <TableHead> - <TableRow> - <TableCell> - <Sort - isSorted={isSortedByName} - onClick={() => { - if (isSortedByName) { - setAllData(prev => sortBy(prev, ["name"]).reverse()); - setSortedByName(false); - } else { - setSortedByName(true); - setAllData(prev => sortBy(prev, ["name"])); - } - }} - > - Property name - </Sort> - </TableCell> - <TableCell> - <Sort - isSorted={isSortedByInstances} - onClick={() => { - if (isSortedByInstances) { - setAllData(prev => sortBy(prev, ["used"]).reverse()); - setSortedByInstances(false); - } else { - setSortedByInstances(true); - setAllData(prev => sortBy(prev, ["used"])); - } - }} - > - Instances - </Sort> - </TableCell> - <TableCell>Properties</TableCell> - </TableRow> - </TableHead> - <TableBody> - {allData.map(({ name: propName, used, values }, idx) => ( - // eslint-disable-next-line react/no-array-index-key - <TableRow key={idx}> - <TableCell>{propName}</TableCell> - <TableCell>{used}</TableCell> - <TableCell> - <Stack direction="column" spacing="XXSmall"> - {sortBy(values, ["used"]) - .reverse() - .map(({ name: valueName, used: valueInstances }, id) => ( - <TextLink - // eslint-disable-next-line react/no-array-index-key - key={id} - size="small" - onClick={() => handleInstances(sources, propName, valueName)} - > - {valueName}: <b>{valueInstances}</b> - </TextLink> - ))} - </Stack> - </TableCell> - </TableRow> - ))} - </TableBody> - </Table> - </DocLayout> - ); -}; +// return ( +// <DocLayout location={location} path={location.pathname} title={upperFirst(title)}> +// {isOpenModal && ( +// <Modal onClose={() => setOpenModal(false)}> +// <ModalSection> +// <ol +// css={css` +// list-style-type: decimal; +// & > * { +// margin-bottom: 0.5rem; +// } +// `} +// > +// {propsInstances.map(instance => ( +// <li key={instance}> +// <TextLink key={instance} title={instance} href={instance}> +// {instance.split("/").slice(-4).join("/")} +// </TextLink> +// </li> +// ))} +// </ol> +// </ModalSection> +// </Modal> +// )} +// <Table> +// <TableHead> +// <TableRow> +// <TableCell> +// <Sort +// isSorted={isSortedByName} +// onClick={() => { +// if (isSortedByName) { +// setAllData(prev => sortBy(prev, ["name"]).reverse()); +// setSortedByName(false); +// } else { +// setSortedByName(true); +// setAllData(prev => sortBy(prev, ["name"])); +// } +// }} +// > +// Property name +// </Sort> +// </TableCell> +// <TableCell> +// <Sort +// isSorted={isSortedByInstances} +// onClick={() => { +// if (isSortedByInstances) { +// setAllData(prev => sortBy(prev, ["used"]).reverse()); +// setSortedByInstances(false); +// } else { +// setSortedByInstances(true); +// setAllData(prev => sortBy(prev, ["used"])); +// } +// }} +// > +// Instances +// </Sort> +// </TableCell> +// <TableCell>Properties</TableCell> +// </TableRow> +// </TableHead> +// <TableBody> +// {allData.map(({ name: propName, used, values }, idx) => ( +// // eslint-disable-next-line react/no-array-index-key +// <TableRow key={idx}> +// <TableCell>{propName}</TableCell> +// <TableCell>{used}</TableCell> +// <TableCell> +// <Stack direction="column" spacing="XXSmall"> +// {sortBy(values, ["used"]) +// .reverse() +// .map(({ name: valueName, used: valueInstances }, id) => ( +// <TextLink +// // eslint-disable-next-line react/no-array-index-key +// key={id} +// size="small" +// onClick={() => handleInstances(sources, propName, valueName)} +// > +// {valueName}: <b>{valueInstances}</b> +// </TextLink> +// ))} +// </Stack> +// </TableCell> +// </TableRow> +// ))} +// </TableBody> +// </Table> +// </DocLayout> +// ); +// }; -export default AllRepositoriesComponent; +// export default AllRepositoriesComponent; diff --git a/docs/src/components/Dashboard/Repository.tsx b/docs/src/components/Dashboard/Repository.tsx index 5f28c2bb4d..2d909e4a97 100644 --- a/docs/src/components/Dashboard/Repository.tsx +++ b/docs/src/components/Dashboard/Repository.tsx @@ -1,100 +1,100 @@ -import React from "react"; -import { Heading, TextLink, Stack, Text } from "@kiwicom/orbit-components"; -import { upperFirst } from "lodash"; -import { graphql, PageRendererProps, useStaticQuery } from "gatsby"; -import fp from "lodash/fp"; +// import React from "react"; +// import { Heading, TextLink, Stack, Text } from "@kiwicom/orbit-components"; +// import { upperFirst } from "lodash"; +// import { graphql, PageRendererProps, useStaticQuery } from "gatsby"; +// import fp from "lodash/fp"; -import DocLayout from "../DocLayout"; -import Members from "./components/Members"; -import ComponentList from "./components/ComponentList"; -import UsageByCategory from "./components/UsageByCategory"; -import { SchemeTrackingNode } from "./interfaces"; +// import DocLayout from "../DocLayout"; +// import Members from "./components/Members"; +// import ComponentList from "./components/ComponentList"; +// import UsageByCategory from "./components/UsageByCategory"; +// 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) { - nodes { - id - name - lastCommit { - title - webUrl - } - members { - maintainers { - avatarUrl - name - id - bot - state - publicEmail - status { - availability - message - } - webUrl - webPath - } - } - trackedData { - icon - sources { - url - props { - name - value - } - } - instances - category - isDeprecated - name - props { - used - name - } - } - orbitVersion - url - } - } - } - `); +// export default function Tracking({ location }: PageRendererProps) { +// const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` +// query TrackingDataQuery { +// allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { +// nodes { +// id +// name +// lastCommit { +// title +// webUrl +// } +// members { +// maintainers { +// avatarUrl +// name +// id +// bot +// state +// publicEmail +// status { +// availability +// message +// } +// webUrl +// webPath +// } +// } +// trackedData { +// icon +// sources { +// url +// props { +// name +// value +// } +// } +// instances +// category +// isDeprecated +// name +// props { +// used +// name +// } +// } +// orbitVersion +// url +// } +// } +// } +// `); - const { pathname } = location; - const pageName = pathname.split("/").filter(Boolean).slice(-1)[0]; +// const { pathname } = location; +// const pageName = pathname.split("/").filter(Boolean).slice(-1)[0]; - const { url, members, orbitVersion, trackedData, lastCommit } = fp.compose( - fp.head, - fp.filter(({ name }) => name === pageName), - )(allTracking.nodes); +// const { url, members, orbitVersion, trackedData, lastCommit } = fp.compose( +// fp.head, +// fp.filter(({ name }) => name === pageName), +// )(allTracking.nodes); - const components = trackedData - .filter(({ icon }) => !icon) - .map(({ name, isDeprecated, instances, category }) => ({ - name, - category, - slug: `/dashboard/tracking/${pageName.toLowerCase()}/${name.toLowerCase()}`, - isDeprecated, - instances, - })); +// const components = trackedData +// .filter(({ icon }) => !icon) +// .map(({ name, isDeprecated, instances, category }) => ({ +// name, +// category, +// slug: `/dashboard/tracking/${pageName.toLowerCase()}/${name.toLowerCase()}`, +// isDeprecated, +// instances, +// })); - return ( - <DocLayout location={location} path={location.pathname} title={upperFirst(pageName)}> - <Stack flex direction="column"> - <TextLink href={url}>Gitlab repository</TextLink> - <Heading type="title3">Orbit version: {orbitVersion}</Heading> - </Stack> +// return ( +// <DocLayout location={location} path={location.pathname} title={upperFirst(pageName)}> +// <Stack flex direction="column"> +// <TextLink href={url}>Gitlab repository</TextLink> +// <Heading type="title3">Orbit version: {orbitVersion}</Heading> +// </Stack> - <Stack inline spacing="XSmall"> - <Text>Last commit:</Text> - <TextLink href={lastCommit.webUrl}>{lastCommit.title}</TextLink> - </Stack> +// <Stack inline spacing="XSmall"> +// <Text>Last commit:</Text> +// <TextLink href={lastCommit.webUrl}>{lastCommit.title}</TextLink> +// </Stack> - <Members members={members} /> - <ComponentList components={components} /> - <UsageByCategory components={components} /> - </DocLayout> - ); -} +// <Members members={members} /> +// <ComponentList components={components} /> +// <UsageByCategory components={components} /> +// </DocLayout> +// ); +// } diff --git a/docs/src/components/Dashboard/RepositoryComponent.tsx b/docs/src/components/Dashboard/RepositoryComponent.tsx index f141f7ca4a..060afe547c 100644 --- a/docs/src/components/Dashboard/RepositoryComponent.tsx +++ b/docs/src/components/Dashboard/RepositoryComponent.tsx @@ -1,173 +1,173 @@ -import React from "react"; -import { graphql, useStaticQuery } from "gatsby"; -import { upperFirst } from "lodash"; -import fp from "lodash/fp"; -import { - Heading, - InputField, - Table, - TableRow, - TableCell, - TableHead, - Button, - Truncate, - TableBody, - Text, - Stack, - TextLink, -} from "@kiwicom/orbit-components"; -import Slide from "@kiwicom/orbit-components/lib/utils/Slide"; +// import React from "react"; +// import { graphql, useStaticQuery } from "gatsby"; +// import { upperFirst } from "lodash"; +// import fp from "lodash/fp"; +// import { +// Heading, +// InputField, +// Table, +// TableRow, +// TableCell, +// TableHead, +// Button, +// Truncate, +// TableBody, +// Text, +// Stack, +// TextLink, +// } from "@kiwicom/orbit-components"; +// import Slide from "@kiwicom/orbit-components/lib/utils/Slide"; -import { SchemeTrackingNode } from "./interfaces"; -import DocLayout from "../DocLayout"; +// import { SchemeTrackingNode } from "./interfaces"; +// import DocLayout from "../DocLayout"; -const ComponentPage = ({ location }) => { - const [allSources, setAllSources] = React.useState<string[]>([]); - const [height, setHeight] = React.useState(0); - const [expanded, setExpanded] = React.useState(false); +// const ComponentPage = ({ location }) => { +// const [allSources, setAllSources] = React.useState<string[]>([]); +// const [height, setHeight] = React.useState(0); +// const [expanded, setExpanded] = React.useState(false); - const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` - query TrackingComponentQuery { - allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { - nodes { - createdAt - name - trackedData { - icon - instances - category - isDeprecated - name - props { - name - used - values { - name - used - } - } - sources { - url - props { - name - value - } - } - } - } - } - } - `); +// const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` +// query TrackingComponentQuery { +// allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { +// nodes { +// createdAt +// name +// trackedData { +// icon +// instances +// category +// isDeprecated +// name +// props { +// name +// used +// values { +// name +// used +// } +// } +// sources { +// url +// props { +// name +// value +// } +// } +// } +// } +// } +// } +// `); - const { pathname } = location; - const [repo, title] = pathname.split("/").filter(Boolean).slice(-2); +// const { pathname } = location; +// const [repo, title] = pathname.split("/").filter(Boolean).slice(-2); - const { category, props, sources, instances, isDeprecated } = fp.compose( - fp.head, - fp.filter(({ name: componentName }) => componentName.toLowerCase() === title), - fp.get("trackedData"), - fp.head, - fp.filter(({ name }) => name.toLowerCase() === repo), - )(allTracking.nodes); +// const { category, props, sources, instances, isDeprecated } = fp.compose( +// fp.head, +// fp.filter(({ name: componentName }) => componentName.toLowerCase() === title), +// fp.get("trackedData"), +// fp.head, +// fp.filter(({ name }) => name.toLowerCase() === repo), +// )(allTracking.nodes); - const sourceLinks = sources && sources.map(({ url }) => url); +// const sourceLinks = sources && sources.map(({ url }) => url); - React.useEffect(() => { - setAllSources(sourceLinks); - }, []); +// React.useEffect(() => { +// setAllSources(sourceLinks); +// }, []); - const measureRef = React.useCallback(n => { - if (n) { - setHeight(n.getBoundingClientRect().height); - } - }, []); +// const measureRef = React.useCallback(n => { +// if (n) { +// setHeight(n.getBoundingClientRect().height); +// } +// }, []); - return ( - <DocLayout location={location} title={upperFirst(title)} path={location.pathname}> - <Table> - <TableHead> - <TableRow> - <TableCell>Category</TableCell> - <TableCell>Instances</TableCell> - <TableCell>Deprecated</TableCell> - </TableRow> - </TableHead> - <TableBody> - <TableRow> - <TableCell>{category}</TableCell> - <TableCell>{instances}</TableCell> - <TableCell>{isDeprecated}</TableCell> - </TableRow> - </TableBody> - </Table> - <Table> - <TableHead> - <TableRow> - <TableCell>Property name</TableCell> - <TableCell>Instances</TableCell> - <TableCell>Properties</TableCell> - </TableRow> - </TableHead> - <TableBody> - {props.map(({ name: propName, used, values }) => ( - <TableRow key={propName}> - <TableCell>{propName}</TableCell> - <TableCell>{used}</TableCell> - <TableCell> - {values.map(({ name: valueName, used: valueInstances }) => ( - <Text size="small" key={valueName}> - {valueName}: <b>{valueInstances}</b> - </Text> - ))} - </TableCell> - </TableRow> - ))} - </TableBody> - </Table> - <Heading>Sources</Heading> - <Stack direction="column"> - {sources.length > 15 && ( - <InputField - placeholder="filter sources" - onChange={ev => { - if (ev.currentTarget.value.length === 0) { - setAllSources(sourceLinks); - } else { - setAllSources(allSources.filter(el => el.includes(ev.currentTarget.value))); - } - }} - /> - )} - {allSources.length < 15 ? ( - allSources.map(source => ( - <TextLink key={source} size="small" href={source}> - <Truncate maxWidth="887px">{source.split("master")[1]}</Truncate> - </TextLink> - )) - ) : ( - <> - <Button onClick={() => setExpanded(prev => !prev)}>Toggle all sources</Button> - {allSources.slice(0, 15).map(source => ( - <TextLink key={source} size="small" href={source}> - <Truncate maxWidth="887px">{source.split("master")[1]}</Truncate> - </TextLink> - ))} - <Slide maxHeight={height} expanded={expanded}> - <div ref={measureRef}> - <Stack inline direction="column"> - {allSources.slice(15, allSources.length).map(source => ( - <TextLink key={source} size="small" href={source}> - <Truncate maxWidth="887px">{source.split("master")[1]}</Truncate> - </TextLink> - ))} - </Stack> - </div> - </Slide> - </> - )} - </Stack> - </DocLayout> - ); -}; +// return ( +// <DocLayout location={location} title={upperFirst(title)} path={location.pathname}> +// <Table> +// <TableHead> +// <TableRow> +// <TableCell>Category</TableCell> +// <TableCell>Instances</TableCell> +// <TableCell>Deprecated</TableCell> +// </TableRow> +// </TableHead> +// <TableBody> +// <TableRow> +// <TableCell>{category}</TableCell> +// <TableCell>{instances}</TableCell> +// <TableCell>{isDeprecated}</TableCell> +// </TableRow> +// </TableBody> +// </Table> +// <Table> +// <TableHead> +// <TableRow> +// <TableCell>Property name</TableCell> +// <TableCell>Instances</TableCell> +// <TableCell>Properties</TableCell> +// </TableRow> +// </TableHead> +// <TableBody> +// {props.map(({ name: propName, used, values }) => ( +// <TableRow key={propName}> +// <TableCell>{propName}</TableCell> +// <TableCell>{used}</TableCell> +// <TableCell> +// {values.map(({ name: valueName, used: valueInstances }) => ( +// <Text size="small" key={valueName}> +// {valueName}: <b>{valueInstances}</b> +// </Text> +// ))} +// </TableCell> +// </TableRow> +// ))} +// </TableBody> +// </Table> +// <Heading>Sources</Heading> +// <Stack direction="column"> +// {sources.length > 15 && ( +// <InputField +// placeholder="filter sources" +// onChange={ev => { +// if (ev.currentTarget.value.length === 0) { +// setAllSources(sourceLinks); +// } else { +// setAllSources(allSources.filter(el => el.includes(ev.currentTarget.value))); +// } +// }} +// /> +// )} +// {allSources.length < 15 ? ( +// allSources.map(source => ( +// <TextLink key={source} size="small" href={source}> +// <Truncate maxWidth="887px">{source.split("master")[1]}</Truncate> +// </TextLink> +// )) +// ) : ( +// <> +// <Button onClick={() => setExpanded(prev => !prev)}>Toggle all sources</Button> +// {allSources.slice(0, 15).map(source => ( +// <TextLink key={source} size="small" href={source}> +// <Truncate maxWidth="887px">{source.split("master")[1]}</Truncate> +// </TextLink> +// ))} +// <Slide maxHeight={height} expanded={expanded}> +// <div ref={measureRef}> +// <Stack inline direction="column"> +// {allSources.slice(15, allSources.length).map(source => ( +// <TextLink key={source} size="small" href={source}> +// <Truncate maxWidth="887px">{source.split("master")[1]}</Truncate> +// </TextLink> +// ))} +// </Stack> +// </div> +// </Slide> +// </> +// )} +// </Stack> +// </DocLayout> +// ); +// }; -export default ComponentPage; +// export default ComponentPage; diff --git a/docs/src/components/Dashboard/Tracking.tsx b/docs/src/components/Dashboard/Tracking.tsx index 3f3065ec4e..e45b9469b0 100644 --- a/docs/src/components/Dashboard/Tracking.tsx +++ b/docs/src/components/Dashboard/Tracking.tsx @@ -1,81 +1,81 @@ -import React from "react"; -import { PageRendererProps, graphql, useStaticQuery } from "gatsby"; -import { Grid } from "@kiwicom/orbit-components"; -import { sortBy, upperFirst } from "lodash"; +// import React from "react"; +// import { PageRendererProps, graphql, useStaticQuery } from "gatsby"; +// import { Grid } from "@kiwicom/orbit-components"; +// import { sortBy, upperFirst } from "lodash"; -import DocLayout from "../DocLayout"; -import Tile from "../Tile"; -import useDevMode from "../../hooks/useDevMode"; -import { SchemeTrackingNode } from "./interfaces"; +// import DocLayout from "../DocLayout"; +// import Tile from "../Tile"; +// import useDevMode from "../../hooks/useDevMode"; +// import { SchemeTrackingNode } from "./interfaces"; -const Tracking = ({ location }: PageRendererProps) => { - const [devMode] = useDevMode(); - const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` - query TrackingPageQuery { - allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { - nodes { - name - createdAt - description - trackedData { - icon - name - } - } - } - } - `); +// const Tracking = ({ location }: PageRendererProps) => { +// const [devMode] = useDevMode(); +// const { allTracking }: SchemeTrackingNode = useStaticQuery(graphql` +// query TrackingPageQuery { +// allTracking(sort: { fields: createdAt, order: DESC }, limit: 8) { +// nodes { +// name +// createdAt +// description +// trackedData { +// icon +// name +// } +// } +// } +// } +// `); - const pages = allTracking.nodes.map(({ name, description }) => { - const url = `/dashboard/tracking/${name.toLowerCase()}`; +// const pages = allTracking.nodes.map(({ name, description }) => { +// const url = `/dashboard/tracking/${name.toLowerCase()}`; - return { - slug: url, - title: upperFirst(name), - description, - hasReactTab: false, - }; - }); +// return { +// slug: url, +// title: upperFirst(name), +// description, +// hasReactTab: false, +// }; +// }); - pages.push({ - slug: "/dashboard/tracking/allrepositories/", - title: "All Repositories", - description: "Combined data from all repositories on single page", - hasReactTab: false, - }); +// pages.push({ +// slug: "/dashboard/tracking/allrepositories/", +// title: "All Repositories", +// description: "Combined data from all repositories on single page", +// hasReactTab: false, +// }); - pages.push({ - slug: "/dashboard/difference/", - title: "Tracking difference", - description: "Shows difference between the first and last tracked data", - hasReactTab: false, - }); +// pages.push({ +// slug: "/dashboard/difference/", +// title: "Tracking difference", +// description: "Shows difference between the first and last tracked data", +// hasReactTab: false, +// }); - return ( - <DocLayout location={location} path="dashboard/tracking" title="Tracking" noElevation> - <Grid - columns="1fr" - gap="2rem" - largeMobile={{ columns: "repeat(2, 1fr)" }} - desktop={{ columns: "repeat(3, 1fr)" }} - largeDesktop={{ columns: "repeat(2, 1fr)" }} - > - {sortBy(pages, ["title"]).map( - ({ title: pageTitle, slug: pageSlug, description, hasReactTab }) => { - return ( - <Tile - key={pageSlug} - title={pageTitle} - href={hasReactTab && devMode ? `${pageSlug}react/` : pageSlug} - > - {description} - </Tile> - ); - }, - )} - </Grid> - </DocLayout> - ); -}; +// return ( +// <DocLayout location={location} path="dashboard/tracking" title="Tracking" noElevation> +// <Grid +// columns="1fr" +// gap="2rem" +// largeMobile={{ columns: "repeat(2, 1fr)" }} +// desktop={{ columns: "repeat(3, 1fr)" }} +// largeDesktop={{ columns: "repeat(2, 1fr)" }} +// > +// {sortBy(pages, ["title"]).map( +// ({ title: pageTitle, slug: pageSlug, description, hasReactTab }) => { +// return ( +// <Tile +// key={pageSlug} +// title={pageTitle} +// href={hasReactTab && devMode ? `${pageSlug}react/` : pageSlug} +// > +// {description} +// </Tile> +// ); +// }, +// )} +// </Grid> +// </DocLayout> +// ); +// }; -export default Tracking; +// export default Tracking; diff --git a/docs/src/components/Dashboard/index.tsx b/docs/src/components/Dashboard/index.tsx index c05e127a05..41707aa30a 100644 --- a/docs/src/components/Dashboard/index.tsx +++ b/docs/src/components/Dashboard/index.tsx @@ -1,33 +1,33 @@ -import React from "react"; -import { Grid } from "@kiwicom/orbit-components"; -import { WindowLocation } from "@reach/router"; -import { Pet as PetIcon } from "@kiwicom/orbit-components/icons"; +// import React from "react"; +// import { Grid } from "@kiwicom/orbit-components"; +// import { WindowLocation } from "@reach/router"; +// import { Pet as PetIcon } from "@kiwicom/orbit-components/icons"; -import Tile from "../Tile"; -import DocLayout from "../DocLayout"; -import Tracking from "./Tracking"; -import AllRepositories from "./AllRepositories"; -import AllRepositoriesComponent from "./AllRepositoriesComponent"; -import Repository from "./Repository"; -import RepositoryComponent from "./RepositoryComponent"; +// import Tile from "../Tile"; +// import DocLayout from "../DocLayout"; +// import Tracking from "./Tracking"; +// import AllRepositories from "./AllRepositories"; +// import AllRepositoriesComponent from "./AllRepositoriesComponent"; +// import Repository from "./Repository"; +// import RepositoryComponent from "./RepositoryComponent"; -interface Props { - path: string; - location: WindowLocation; -} +// interface Props { +// path: string; +// location: WindowLocation; +// } -const Dashboard = ({ path = "/dashboard/", location }: Props) => { - return ( - <DocLayout location={location} title="Tracking" path={path} noElevation> - <Grid columns="1fr" tablet={{ columns: "1fr 1fr" }}> - <Tile title="Tracking" icon={<PetIcon />} href="tracking"> - Orbit tracking tool shows the data collected from frontend repositories with react-scanner - and eslint - </Tile> - </Grid> - </DocLayout> - ); -}; +// const Dashboard = ({ path = "/dashboard/", location }: Props) => { +// return ( +// <DocLayout location={location} title="Tracking" path={path} noElevation> +// <Grid columns="1fr" tablet={{ columns: "1fr 1fr" }}> +// <Tile title="Tracking" icon={<PetIcon />} href="tracking"> +// Orbit tracking tool shows the data collected from frontend repositories with react-scanner +// and eslint +// </Tile> +// </Grid> +// </DocLayout> +// ); +// }; -export default Dashboard; -export { Tracking, AllRepositories, AllRepositoriesComponent, Repository, RepositoryComponent }; +// export default Dashboard; +// export { Tracking, AllRepositories, AllRepositoriesComponent, Repository, RepositoryComponent }; diff --git a/docs/src/pages/dashboard.tsx b/docs/src/pages/dashboard.tsx index 024ab99a2a..8c7f5b5ca7 100644 --- a/docs/src/pages/dashboard.tsx +++ b/docs/src/pages/dashboard.tsx @@ -1,52 +1,53 @@ import { Router } from "@reach/router"; -import { navigate } from "gatsby"; +// import { navigate } from "gatsby"; import React from "react"; -import Dashboard, { - AllRepositories, - AllRepositoriesComponent, - Repository, - RepositoryComponent, - Tracking, -} from "../components/Dashboard"; -import Login from "../components/Login"; -import { isBrowser, isLoggedIn } from "../services/auth"; +// import Dashboard, { +// AllRepositories, +// AllRepositoriesComponent, +// Repository, +// RepositoryComponent, +// Tracking, +// } from "../components/Dashboard"; +// import Login from "../components/Login"; +// import { isBrowser, isLoggedIn } from "../services/auth"; import NotFound from "./404"; -const PrivateRoute = ({ component: Component, location, ...rest }) => { - if (!isLoggedIn() && location.pathname !== `/dashboard/login/` && isBrowser) { - navigate(`/dashboard/login/`); - return null; - } +// const PrivateRoute = ({ component: Component, location, ...rest }) => { +// if (!isLoggedIn() && location.pathname !== `/dashboard/login/` && isBrowser) { +// navigate(`/dashboard/login/`); +// return null; +// } - return <Component location={location} {...rest} />; -}; +// return <Component location={location} {...rest} />; +// }; export default ({ location }) => { return ( <Router> {/* @ts-expect-error TODO */} <NotFound default /> - <PrivateRoute path="/dashboard/" component={Dashboard} location={location} /> + {/* <PrivateRoute path="/dashboard/" component={Dashboard} location={location} /> <PrivateRoute path="/dashboard/tracking/" component={Tracking} location={location} /> - <PrivateRoute path="/dashboard/tracking/:slug/" component={Repository} location={location} /> + <PrivateRoute path="/dashboard/tracking/:slug/" component={Repository} location={location} /> */} - <PrivateRoute - path="/dashboard/tracking/*/*/" + {/* <PrivateRoute + // path="/dashboard/tracking/*\/*\/" component={RepositoryComponent} location={location} /> <PrivateRoute - path="/dashboard/tracking/allrepositories/" + // path="/dashboard/tracking/allrepositories/" component={AllRepositories} location={location} /> <PrivateRoute - path="/dashboard/tracking/allrepositories/:slug/" + // path="/dashboard/tracking/allrepositories/:slug/" component={AllRepositoriesComponent} location={location} /> <Login path="/dashboard/login/" location={location} /> + */} </Router> ); }; diff --git a/packages/orbit-design-tokens/output/theo-spec.ios.json b/packages/orbit-design-tokens/output/theo-spec.ios.json index 4b4a5b8a85..80dd5b8830 100644 --- a/packages/orbit-design-tokens/output/theo-spec.ios.json +++ b/packages/orbit-design-tokens/output/theo-spec.ios.json @@ -2957,4 +2957,4 @@ "name": "marginButtonGroup" } ] -} +} \ No newline at end of file diff --git a/packages/orbit-design-tokens/output/theo-spec.json b/packages/orbit-design-tokens/output/theo-spec.json index a7166dd7bd..b5712602a3 100644 --- a/packages/orbit-design-tokens/output/theo-spec.json +++ b/packages/orbit-design-tokens/output/theo-spec.json @@ -491,4 +491,4 @@ "paletteOrangeDark": "rgb(174, 87, 0)", "lineHeightTextSmall": "16px", "marginButtonGroup": "0 1px 0 0" -} +} \ No newline at end of file diff --git a/packages/orbit-design-tokens/src/theo/theo-spec.json b/packages/orbit-design-tokens/src/theo/theo-spec.json index 80af6ff4a2..12a220d85b 100644 --- a/packages/orbit-design-tokens/src/theo/theo-spec.json +++ b/packages/orbit-design-tokens/src/theo/theo-spec.json @@ -3941,4 +3941,4 @@ } } } -} +} \ No newline at end of file