prettier
Signed-off-by: Emma Indal <emma.indahl@gmail.com> Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
committed by
Eric Peterson
parent
b6a633ca31
commit
720fd2f360
@@ -120,10 +120,7 @@ const routes = (
|
||||
<Route path="/gcp-projects" element={<GcpProjectsPage />} />
|
||||
<Route path="/newrelic" element={<NewRelicPage />} />
|
||||
<Route path="/search" element={<SearchPage />} />
|
||||
<Route
|
||||
path="/search-next"
|
||||
element={<SearchPageNext />}
|
||||
>
|
||||
<Route path="/search-next" element={<SearchPageNext />}>
|
||||
{searchPage}
|
||||
</Route>
|
||||
<Route path="/cost-insights" element={<CostInsightsPage />} />
|
||||
|
||||
@@ -31,7 +31,7 @@ export default async function createPlugin({
|
||||
|
||||
indexBuilder.addCollator({
|
||||
type: 'software-catalog',
|
||||
defaultRefreshIntervalSeconds: 600,
|
||||
defaultRefreshIntervalSeconds: 10,
|
||||
collator: new DefaultCatalogCollator({ discovery }),
|
||||
});
|
||||
|
||||
|
||||
@@ -66,5 +66,8 @@ export interface DocumentCollator {
|
||||
* additional metadata.
|
||||
*/
|
||||
export interface DocumentDecorator {
|
||||
execute(type: string, documents: IndexableDocument[]): Promise<IndexableDocument[]>;
|
||||
execute(
|
||||
type: string,
|
||||
documents: IndexableDocument[],
|
||||
): Promise<IndexableDocument[]>;
|
||||
}
|
||||
|
||||
@@ -11,13 +11,19 @@
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* l
|
||||
imitations under the License.
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Link } from '@backstage/core';
|
||||
import { Box, Chip, Divider, ListItem, ListItemText, makeStyles } from '@material-ui/core';
|
||||
import {
|
||||
Box,
|
||||
Chip,
|
||||
Divider,
|
||||
ListItem,
|
||||
ListItemText,
|
||||
makeStyles,
|
||||
} from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
flexContainer: {
|
||||
@@ -41,8 +47,10 @@ export const CatalogResultListItem = ({ result }: any) => {
|
||||
secondary={result.text}
|
||||
/>
|
||||
<Box>
|
||||
{result.kind && (<Chip label={`Kind: ${result.kind}`} size="small" />)}
|
||||
{result.lifecycle && (<Chip label={`Lifecycle: ${result.lifecycle}`} size="small" />)}
|
||||
{result.kind && <Chip label={`Kind: ${result.kind}`} size="small" />}
|
||||
{result.lifecycle && (
|
||||
<Chip label={`Lifecycle: ${result.lifecycle}`} size="small" />
|
||||
)}
|
||||
</Box>
|
||||
</ListItem>
|
||||
<Divider component="li" />
|
||||
|
||||
@@ -116,14 +116,12 @@ export class LunrSearchEngine implements SearchEngine {
|
||||
Object.keys(this.lunrIndices).forEach(type => {
|
||||
try {
|
||||
results.push(
|
||||
...this.lunrIndices[type]
|
||||
.search(lunrQueryString)
|
||||
.map(result => {
|
||||
return {
|
||||
result: result,
|
||||
type: type,
|
||||
};
|
||||
})
|
||||
...this.lunrIndices[type].search(lunrQueryString).map(result => {
|
||||
return {
|
||||
result: result,
|
||||
type: type,
|
||||
};
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
// if a field does not exist on a index, we can see that as a no-match
|
||||
@@ -141,14 +139,12 @@ export class LunrSearchEngine implements SearchEngine {
|
||||
.forEach(type => {
|
||||
try {
|
||||
results.push(
|
||||
...this.lunrIndices[type]
|
||||
.search(lunrQueryString)
|
||||
.map(result => {
|
||||
return {
|
||||
result: result,
|
||||
type: type,
|
||||
};
|
||||
})
|
||||
...this.lunrIndices[type].search(lunrQueryString).map(result => {
|
||||
return {
|
||||
result: result,
|
||||
type: type,
|
||||
};
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
// if a field does not exist on a index, we can see that as a no-match
|
||||
|
||||
Reference in New Issue
Block a user