Skip to content

Commit

Permalink
fix: documentation path
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fung committed Jul 30, 2020
1 parent 019f0cb commit efb770b
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 16,869 deletions.
Binary file removed iaticloudfront2.zip
Binary file not shown.
Binary file removed iaticloudfront3.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@testing-library/cypress": "^6.0.0",
"craco-plugin-react-hot-reload": "^0.1.0",
"easy-peasy": "^3.2.1",
"history": "^4.10.1",
"html-react-parser": "^0.9.1",
"history": "^5.0.0",
"html-react-parser": "^0.13.0",
"js-base64": "^2.6.2",
"lodash": "^4.17.15",
"material-ui-chip-input": "^2.0.0-beta.2",
Expand All @@ -32,7 +32,7 @@
"react-hot-loader": "^4.12.21",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-router-hash-link": "^1.2.2",
"react-router-hash-link": "^2.0.0",
"react-scripts": "^3.4.0",
"react-select": "^3.0.4",
"react-select-async-paginate": "^0.3.7",
Expand Down Expand Up @@ -111,7 +111,7 @@
"source-map-explorer": "^2.3.1",
"start-server-and-test": "^1.11.0",
"ts-loader": "^7.0.5",
"typescript": "~3.9.5",
"typescript": "4.0.0-beta",
"webpack-plugin-ramdisk": "^0.1.4"
},
"prettier": {
Expand Down
52 changes: 1 addition & 51 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,9 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->

<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(
["setDocumentTitle", document.domain + "/" + document.title]
);
_paq.push(["setCookieDomain", "*.iatidatastore.iatistandard.org"]);
_paq.push([
"setDomains",
[
"*.iatidatastore.iatistandard.org",
"*.iati.cloud",
"*.www.iati.cloud",
],
]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u = "https://zimmermanzimmerman.matomo.cloud/";
_paq.push(["setTrackerUrl", u + "matomo.php"]);
_paq.push(["setSiteId", "5"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.type = "text/javascript";
g.async = true;
g.defer = true;
g.src = "//cdn.matomo.cloud/zimmermanzimmerman.matomo.cloud/matomo.js";
s.parentNode.insertBefore(g, s);
})();
</script>

<script src="https://unpkg.com/[email protected]/dist/ponyfill.es6.js"></script>

<script type="text/javascript">
(function (e, t, r, n, a) {
var c = [];
e[a] = function () {
c.push(arguments);
};
e[a].queue = c;
var s = t.createElement(r);
s.async = 1;
s.src = n;
var u = t.getElementsByTagName(r)[0];
u.parentNode.insertBefore(s, u);
})(window, document, "script", "//cdn.sematext.com/rum.js", "strum");
</script>
<script type="text/javascript">
strum("config", {
token: "155abb23-9f7e-4bf0-bebd-86ee4043ed74",
receiverUrl: "https://rum-receiver.eu.sematext.com",
});
</script>

<title>IATI Datastore</title>
</head>
<body>
Expand Down
15 changes: 0 additions & 15 deletions src/app/components/surfaces/AppBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { Link } from 'react-router-dom';
import { Hidden } from '@material-ui/core';
import { DrawerMenu } from 'app/components/navigation/Drawer';
import { mockData as drawerMockData } from 'app/components/navigation/Drawer/mock';

import { useDebounce, useWindowScroll } from 'react-use';
import useDocumentScrollThrottled from 'app/components/surfaces/AppBar/utils';

type AppBarProps = {
Expand Down Expand Up @@ -61,7 +59,6 @@ const BaseComponent = styled((props) => <BaseAppBar {...props} />)`
`;

export const AppBar = (props: AppBarProps) => {
// const [shouldHideHeader, setShouldHideHeader] = useState(false);
const [shouldShrink, setShouldShowShadow] = useState(false);
const MINIMUM_SCROLL = 180;
const TIMEOUT_DELAY = 400;
Expand All @@ -71,22 +68,10 @@ export const AppBar = (props: AppBarProps) => {
const isScrolledDown = previousScrollTop < currentScrollTop;
const isMinimumScrolled = currentScrollTop > MINIMUM_SCROLL;

/*setTimeout(() => {
setShouldShowShadow(isScrolledDown && isMinimumScrolled);
}, TIMEOUT_DELAY);
*/

setShouldShowShadow(isMinimumScrolled);

/*setTimeout(() => {
setShouldHideHeader(isScrolledDown && isMinimumScrolled);
}, TIMEOUT_DELAY);*/
});

const shadowStyle = shouldShrink ? shrunkStyle : baseStyle;
// const shrinkMode = shouldShowShadow ? true : false;

console.log(shadowStyle);

return (
<React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,15 @@ export const ApiCallFragment = (data) => {

const showRequest = useStoreActions((actions) => actions.request.showRequest);

// console.log('rendr ApiCallFragment');

const [targetRef, percent] = useVisible<HTMLDivElement>(
(vi: number) => Math.floor(vi * 100),
{
rootMargin: '300px 0px -200px 0px',
}
);

// if (percent > 99) {
// if (targetRef.current) {
// if (request) {
// showRequest(request);
// }
// }
// }

const handleClick = React.useCallback(() => {
const url = request.url.raw.replace('{{url}}', targetURL);
clipboard.copy(url); // programmatically copying a value
Expand Down Expand Up @@ -83,9 +77,9 @@ export const ApiCallFragment = (data) => {
{parsed.description && (
<Grid item md={12}>
{parsed.description &&
parsed.description.split('\n').map((line) => {
parsed.description.split('\n').map((line, index) => {
return (
<Typography variant={'body2'}>
<Typography variant={'body2'} key={index}>
{line.replace(/`/g, '')}
</Typography>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const ApiCallParamItem = ({ data }) => {

export const ApiCallParamList = ({ data }) => {
return (
<>
<React.Fragment>
{/* -------------------- */}
{/* param header */}
<ParameterHeader>PARAMS</ParameterHeader>
Expand All @@ -23,9 +23,12 @@ export const ApiCallParamList = ({ data }) => {
{/* -------------------- */}
{/* param list */}
<ParameterList>
{data && data.map((item) => <ApiCallParamItem data={item} />)}
{data &&
data.map((item, index) => (
<ApiCallParamItem key={index} data={item} />
))}
</ParameterList>
{/* --------- */}
</>
</React.Fragment>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const SubCaregoryDescription = ({ item }) => {
<Grid item md={12}>
<Typography variant="body2">
{item.description && item.description}
<Box height={'20px'} width={'20px'} />
</Typography>
<Box height={'20px'} width={'20px'} />
</Grid>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import { TreeItem } from '@material-ui/lab';
import { HashLink } from 'react-router-hash-link';
import styled from 'styled-components';
import { SubLink3 } from './ui/SubLink3';
import { SubLink3 } from 'app/modules/documentation-module/common/DocSideBar/common/ui/SubLink3';

type Props = {
item: any;
Expand Down Expand Up @@ -60,8 +60,10 @@ const Item = styled((props) => <TreeItem {...props} />)`
`;

export function TreeItemLink(props: Props) {
// console.log('TreeItemLink', props.postmanId, props.item.name);

return (
<>
<React.Fragment>
{props.item.item ? (
<Item nodeId={props.item.name} label={props.item.name}>
<Link to={`${props.postmanId}#${props.item.name}`} />
Expand All @@ -71,9 +73,9 @@ export function TreeItemLink(props: Props) {
<SubLink3
requestMethod={props.item.request.method}
text={props.item.name}
to={`${props.postmanId}#${props.item.name}`}
to={`/documentation/${props.postmanId}#${props.item.name}`}
/>
)}
</>
</React.Fragment>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ export const SubLink1 = (props: Props) => {
) : (
<Folder css={closedStyle} />
)}
<Link to={props.to} {...props}>
blablabla{props.text}
</Link>
<Link {...props}>{props.text}</Link>
</div>
);
};
Expand Down
19 changes: 3 additions & 16 deletions src/app/modules/documentation-module/common/DocSideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ export function DocsideBar() {
Introduction
</CustomLink>

{/* <CustomLink key="Endpoints" to="/documentation/introduction">
Available endpoints
</CustomLink>
<CustomLink key="XML" to="/documentation/introduction">
XML export
</CustomLink>
<CustomLink key="CSV" to="/documentation/introduction">
CSV export
</CustomLink>
<CustomLink key="XLS" to="/documentation/introduction">
XLS export
</CustomLink> */}

<TreeView
defaultCollapseIcon={<FolderOpen />}
defaultExpandIcon={<Folder />}
Expand All @@ -76,18 +60,21 @@ export function DocsideBar() {
<TreeItemLink
item={subItem1}
postmanId={item._postman_id}
key={subItem1._postman_id}
>
{subItem1.item &&
subItem1.item.map((subItem2) => (
<TreeItemLink
item={subItem2}
postmanId={item._postman_id}
key={subItem2._postman_id}
>
{subItem2.item &&
subItem2.item.map((subItem3) => (
<TreeItemLink
item={subItem3}
postmanId={item._postman_id}
key={subItem3._postman_id}
/>
))}
</TreeItemLink>
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/documentation-module/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const DocumentationRoutes = () => {
const fetchPostman = useStoreActions((actions) => actions.fetch);

useEffectOnce(() => {
console.log('Running effect once on mount');
console.log('fetch postman data once');

fetchPostman();

Expand Down
Loading

0 comments on commit efb770b

Please sign in to comment.