diff --git a/kotoed-js/src/main/ts/code/actions.ts b/kotoed-js/src/main/ts/code/actions.ts index a97dcdb8..d7cd222e 100644 --- a/kotoed-js/src/main/ts/code/actions.ts +++ b/kotoed-js/src/main/ts/code/actions.ts @@ -211,7 +211,9 @@ export function loadLostFound(payload: SubmissionPayload) { } // Lower numbers are displayed first -const fileTypeDisplayOrder = Map({"directory": 1, "file": 2}) +const fileTypeDisplayOrder = {directory: 1, file: 2} +const naturalSorter = natsort() +const typeSorter = (a: File, b: File) => fileTypeDisplayOrder[a.type] - fileTypeDisplayOrder[b.type] export function fetchRootDirIfNeeded(payload: SubmissionPayload) { return (dispatch: Dispatch, getState: () => CodeReviewState) => { @@ -223,9 +225,6 @@ export function fetchRootDirIfNeeded(payload: SubmissionPayload) { })); return fetchRootDir(payload.submissionId).then((root) => { - const naturalSorter = natsort() - const typeSorter = (a: File, b: File) => - fileTypeDisplayOrder.get(a.type) - fileTypeDisplayOrder.get(b.type) const recursiveSorter = (node: File) => { if (node.children == null) { return diff --git a/kotoed-js/src/main/ts/projects/list.tsx b/kotoed-js/src/main/ts/projects/list.tsx index 306abf57..93cedbbd 100644 --- a/kotoed-js/src/main/ts/projects/list.tsx +++ b/kotoed-js/src/main/ts/projects/list.tsx @@ -230,16 +230,14 @@ class ProjectsSearch extends React.Component<{}, ProjectSearchState> { tagCloug = (cb: SearchCallback) => { return this.state.tags.length !== 0 && - {intersperse(this.state.tags.map(tag => { - const searchState = cb(); - // XXX: we can do better - // XXX: also it's a copy-paste from ProjectComponent - if (!searchState.oldKey.includes(tag.name)) { - searchState.toggleSearch(searchState.oldKey + " " + tag.name) - } - }}/>), " ")} + {intersperse(this.state.tags.map(tag => { + const searchState = cb(); + // XXX: we can do better + // XXX: also it's a copy-paste from ProjectComponent + if(!searchState.oldKey.includes(tag.name)) { + searchState.toggleSearch(searchState.oldKey + " " + tag.name) + } + }}/>), " ")} ; }; @@ -269,16 +267,16 @@ class ProjectsSearch extends React.Component<{}, ProjectSearchState> { return ( - - - - - - - + + + + + + + - {children} + {children}
IdNameAuthorRepoOpen submissions
IdNameAuthorRepoOpen submissions
) };