Skip to content

Commit

Permalink
Fix typo in "site" to "side"
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfs committed Aug 7, 2020
1 parent 0db9178 commit 4b23876
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions app/src/components/ExplorationViews/MethodView/MethodView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import LoadingIndicator from '../../LoadingIndicator/LoadingIndicator';
import { getMethodInfo, getMethodText } from '../../../utils/BackendHandling/apiHandler';
import './MethodView.css';

const MethodView = ({ currentClass, site, currentMethod }) => {
const MethodView = ({ currentClass, side, currentMethod }) => {
const [loading, setLoading] = useState(true);
const [methodText, setMethodText] = useState('');
const [hasPrecodeComment, setHasPrecodeComment] = useState(false);
const [precodeComment, setPrecodeComment] = useState('');

useEffect(() => {
const simpleFetch = async () => {
const methodResponse = await getMethodInfo(currentClass, site, currentMethod);
const methodTextResponse = await getMethodText(currentClass, site, currentMethod);
const methodResponse = await getMethodInfo(currentClass, side, currentMethod);
const methodTextResponse = await getMethodText(currentClass, side, currentMethod);
// console.log(methodResponse);
setMethodText(methodTextResponse);
setHasPrecodeComment(methodResponse.hasPrecodeComment);
setPrecodeComment(methodResponse.precodeComment);
setLoading(false);
};
simpleFetch();
}, [currentClass, site, currentMethod]);
}, [currentClass, side, currentMethod]);

return (
<div>
Expand Down Expand Up @@ -53,6 +53,6 @@ export default MethodView;

MethodView.propTypes = {
currentClass: PropTypes.string.isRequired,
site: PropTypes.string.isRequired,
side: PropTypes.string.isRequired,
currentMethod: PropTypes.string.isRequired
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Method View', () => {
render(
<MethodView
currentClass={getSampleClassName()}
site={getSampleSide()}
side={getSampleSide()}
currentMethod={getSampleMethodName()}
/>,
container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ afterEach(() => {
});

describe('Metrics Landing View', () => {
it('should display the statistics landing view site', () => {
it('should display the statistics landing view side', () => {
act(() => {
render(<MetricsLandingView />, container);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const MethodsOfClassContainer = props => {
<UndocumentedMethodsList
currentClass={theClassName}
methodList={undocumentedClassMethods}
site="class"
side="class"
/>
<h2 className="listHeading">Undocumented Instance Methods</h2>
<UndocumentedMethodsList
methodList={undocumentedInstanceMethods}
currentClass={theClassName}
site="instance"
side="instance"
/>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ afterEach(() => {
});

describe('Methods Of Class Container', () => {
it('should display the MethodsOfClassContainer site', async () => {
it('should display the MethodsOfClassContainer side', async () => {
const fetchMock = getUndocumentedMethodsOfClassAPIMock();

await act(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { NavLink } from 'react-router-dom';
import { getPathToMethod } from '../../../utils/PathHandling/pathMapper';

const UndocumentedMethodsList = props => {
const { methodList, site, currentClass } = props;
const { methodList, side, currentClass } = props;
return (
<div className="navListContainer">
{methodList.map(aMethod => (
<NavLink
className="navButton"
key={aMethod}
to={getPathToMethod(aMethod, currentClass, site)}
to={getPathToMethod(aMethod, currentClass, side)}
>
{aMethod}
</NavLink>
Expand All @@ -25,7 +25,7 @@ const UndocumentedMethodsList = props => {
UndocumentedMethodsList.propTypes = {
methodList: PropTypes.arrayOf(PropTypes.string).isRequired,
currentClass: PropTypes.string.isRequired,
site: PropTypes.string.isRequired
side: PropTypes.string.isRequired
};

export default UndocumentedMethodsList;
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ afterEach(() => {
});

describe('Undocumented Methods List', () => {
it('should display the UndocumentedMethodsList site', () => {
it('should display the UndocumentedMethodsList side', () => {
const methodList = ['test1', 'test2'];
const site = 'test';
const side = 'test';
const currentClass = 'test';

act(() => {
render(
<Router>
<UndocumentedMethodsList
currentClass={currentClass}
site={site}
side={side}
methodList={methodList}
/>
</Router>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ afterEach(() => {
});

describe('Unknown Statistics', () => {
it('should display UnknownStatistics site', () => {
it('should display UnknownStatistics side', () => {
const testStatisticsName = 'test';

act(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ afterEach(() => {
});

describe('Result Enumeration', () => {
it('should display the result enumeration site', () => {
it('should display the result enumeration side', () => {
const testLinkText = 'test';
const testLinkPath = 'test';

Expand Down
4 changes: 2 additions & 2 deletions app/src/test-utils/apiMocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ export const getContentOfBookMock = () =>
});
});

export const getFetchMethodInfoAndCodeMock = (className, site, methodName) =>
export const getFetchMethodInfoAndCodeMock = (className, side, methodName) =>
jest.spyOn(global, 'fetch').mockImplementation(path => {
if (path === `${baseURL}/env/classes/${className}/methods/${site}/${methodName}`)
if (path === `${baseURL}/env/classes/${className}/methods/${side}/${methodName}`)
return Promise.resolve({
json: () => getSampleMethodInfoResponse()
});
Expand Down
6 changes: 3 additions & 3 deletions app/src/utils/PathHandling/pathMapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const getPathToMethod = (aMethodName, aClassName, theSite) =>
`/doku/classes/${aClassName}/methods/${theSite}/${aMethodName}`;
export const getPathToMethod = (aMethodName, aClassName, aSide) =>
`/doku/classes/${aClassName}/methods/${aSide}/${aMethodName}`;
export const getPathToClass = aClassName => `/doku/classes/${aClassName}`;
export const getPathToDokuRoot = () => '/doku';
export const getPathToHelpClass = aClassName => `/doku/help/${aClassName}`;
Expand All @@ -11,7 +11,7 @@ const getURLParameterFromKey = key => `:${key}`;
export const metricsKey = () => 'currentMetrics';
export const classKey = () => 'currentClass';
export const methodKey = () => 'currentMethod';
export const methodSideKey = () => 'site';
export const methodSideKey = () => 'side';

export const getSpecificMetricsURLBluePrint = () =>
getPathToMetrics(getURLParameterFromKey(metricsKey()));
Expand Down
2 changes: 1 addition & 1 deletion app/src/utils/ViewMappers/explorationMapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const getExplorationViewByPath = (locationObj, paramsObj) =>
<Suspense fallback={<LoadingIndicator />}>
<MethodView
currentClass={paramsObj[classKey()]}
site={paramsObj[methodSideKey()]}
side={paramsObj[methodSideKey()]}
currentMethod={paramsObj[methodKey()]}
/>
</Suspense>
Expand Down

0 comments on commit 4b23876

Please sign in to comment.