Signed-off-by Lmejbar : Added SearchBar and ScrollBar on Techradar

Signed-off-by: lmejbar <42239917+lmejbar@users.noreply.github.com>
This commit is contained in:
lmejbar
2021-09-06 11:52:33 +02:00
committed by Fredrik Adelöw
parent 48ac287ee0
commit 5e198da71b
10 changed files with 3808 additions and 93 deletions
+2
View File
@@ -107,6 +107,8 @@ export interface TechRadarComponentProps {
// (undocumented)
id?: string;
// (undocumented)
searchText?: string;
// (undocumented)
svgProps?: object;
// (undocumented)
width: number;
@@ -52,7 +52,7 @@ const RadarComponent = (props: TechRadarComponentProps): JSX.Element => {
loaderResponse: TechRadarLoaderResponse | undefined,
): Array<Entry> => {
let filteredArray = loaderResponse!.entries;
if (!(props.searchText === '')) {
if (props.searchText) {
// Compare the name or the description with the search input text
filteredArray = loaderResponse!.entries.filter(
element =>
@@ -33,13 +33,21 @@ export type Props = {
const useStyles = makeStyles<Theme>(theme => ({
foreignObject: {
overflowY: 'visible',
overflow: 'scroll',
scrollbarWidth: 0 as any, // hide in FF
'&::-webkit-scrollbar': {
display: 'none', // hide in Chrome
},
},
quadrant: {
height: '100%',
width: '100%',
overflowY: 'visible',
pointerEvents: 'none',
overflow: 'scroll',
scrollbarWidth: 0 as any, // hide in FF
'&::-webkit-scrollbar': {
display: 'none', // hide in Chrome
},
// pointerEvents: 'none',
},
quadrantHeading: {
pointerEvents: 'none',
@@ -70,9 +78,6 @@ const useStyles = makeStyles<Theme>(theme => ({
listStylePosition: 'inside',
marginTop: 0,
paddingLeft: 0,
height: '100%',
width: '100%',
overflow: 'scroll',
fontVariantNumeric: 'proportional-nums',
'-moz-font-feature-settings': 'pnum',
'-webkit-font-feature-settings': 'pnum',
@@ -15,16 +15,15 @@
*/
import React from 'react';
import { Grid, makeStyles } from '@material-ui/core';
import { Grid, makeStyles, TextField } from '@material-ui/core';
import RadarComponent from '../components/RadarComponent';
import { TechRadarComponentProps } from '../api';
import {
Content,
ContentHeader,
Page,
// Header,
Header,
SupportButton,
InputTextFilter,
} from '@backstage/core-components';
const useStyles = makeStyles(() => ({
@@ -48,16 +47,25 @@ export const RadarPage = ({
const classes = useStyles();
const [searchText, setSearchText] = React.useState('');
const searchInput = (event: any) => {
const searchInput = (
event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
) => {
setSearchText(event.target.value);
};
return (
<Page themeId="tool">
{/* <Header title={title} subtitle={subtitle} /> */}
<Header title={title} subtitle={subtitle} />
<Content className={classes.overflowXScroll}>
<ContentHeader title={pageTitle}>
<InputTextFilter searchCategory={searchInput} />
<TextField
id="standard-search"
label="Search field"
type="search"
onChange={e => {
searchInput(e);
}}
/>
<SupportButton>
This is used for visualizing the official guidelines of different
areas of software development such as languages, frameworks,
File diff suppressed because it is too large Load Diff