Filepath search (#1568)

Add search for files to the sources view. The search is only for finding file paths. It does not search any file metadata nor the content. Results get a rating, where file names are rated higher than file paths. The results are sorted by the score and the first 50 results are displayed.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
Sebastian Sdorra
2021-03-04 10:39:58 +01:00
committed by GitHub
parent bafe84b79a
commit 89548d45bd
36 changed files with 1112 additions and 30 deletions

View File

@@ -25,7 +25,7 @@ import React, { FC } from "react";
import styled from "styled-components";
import { useLocation } from "react-router-dom";
import { Level, BranchSelector } from "@scm-manager/ui-components";
import CodeViewSwitcher from "./CodeViewSwitcher";
import CodeViewSwitcher, { SwitchViewLink } from "./CodeViewSwitcher";
import { useTranslation } from "react-i18next";
import { Branch } from "@scm-manager/ui-types";
@@ -52,7 +52,7 @@ type Props = {
selectedBranch?: string;
branches?: Branch[];
onSelectBranch: () => void;
switchViewLink: string;
switchViewLink: SwitchViewLink;
};
const CodeActionBar: FC<Props> = ({ selectedBranch, branches, onSelectBranch, switchViewLink }) => {
@@ -63,7 +63,8 @@ const CodeActionBar: FC<Props> = ({ selectedBranch, branches, onSelectBranch, sw
<ActionBar>
<FlexShrinkLevel
left={
branches && branches?.length > 0 && (
branches &&
branches?.length > 0 && (
<BranchSelector
label={t("code.branchSelector")}
branches={branches}