-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split dropdowns / panels when possible
- Loading branch information
1 parent
58868cc
commit c320bcf
Showing
29 changed files
with
1,796 additions
and
1,704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
web/src/components/dropdowns/__tests__/metric-function-dropdown.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
web/src/components/dropdowns/__tests__/metric-type-dropdown.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
web/src/components/dropdowns/__tests__/refresh-dropdown.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
web/src/components/dropdowns/__tests__/time-range-dropdown.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Switch, Text, TextVariants, Tooltip } from '@patternfly/react-core'; | ||
import { InfoAltIcon } from '@patternfly/react-icons'; | ||
import * as React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { FlowScope } from '../../model/flow-query'; | ||
|
||
import ScopeDropdown from './scope-dropdown'; | ||
import TruncateDropdown, { TruncateLength } from './truncate-dropdown'; | ||
|
||
export type Size = 's' | 'm' | 'l'; | ||
|
||
export interface OverviewDisplayOptionsProps { | ||
metricScope: FlowScope; | ||
setMetricScope: (s: FlowScope) => void; | ||
truncateLength: TruncateLength; | ||
setTruncateLength: (v: TruncateLength) => void; | ||
focus: boolean; | ||
setFocus: (v: boolean) => void; | ||
allowedScopes: FlowScope[]; | ||
} | ||
|
||
export const OverviewDisplayOptions: React.FC<OverviewDisplayOptionsProps> = ({ | ||
metricScope, | ||
setMetricScope, | ||
truncateLength, | ||
setTruncateLength, | ||
focus, | ||
setFocus, | ||
allowedScopes | ||
}) => { | ||
const { t } = useTranslation('plugin__netobserv-plugin'); | ||
|
||
return ( | ||
<> | ||
<div className="pf-c-select__menu-group"> | ||
<Tooltip content={t('The level of details represented.')}> | ||
<div className="pf-c-select__menu-group-title"> | ||
<Text component={TextVariants.p}> | ||
{t('Scope')} <InfoAltIcon /> | ||
</Text> | ||
</div> | ||
</Tooltip> | ||
<div className="display-dropdown-padding"> | ||
<ScopeDropdown | ||
data-test="scope" | ||
id="scope" | ||
selected={metricScope} | ||
setScopeType={setMetricScope} | ||
allowedScopes={allowedScopes} | ||
/> | ||
</div> | ||
</div> | ||
<div className="pf-c-select__menu-group"> | ||
<Tooltip content={t('Long labels can reduce visibility.')}> | ||
<div className="pf-c-select__menu-group-title"> | ||
<Text component={TextVariants.p}> | ||
{t('Truncate labels')} <InfoAltIcon /> | ||
</Text> | ||
</div> | ||
</Tooltip> | ||
<div className="display-dropdown-padding"> | ||
<TruncateDropdown id="truncate" selected={truncateLength} setTruncateLength={setTruncateLength} /> | ||
</div> | ||
</div> | ||
<div className="pf-c-select__menu-group"> | ||
<Switch | ||
id="focus-switch" | ||
className="display-dropdown-padding" | ||
label={t('Single graph focus')} | ||
isChecked={focus} | ||
onChange={setFocus} | ||
/> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default OverviewDisplayOptions; |
Oops, something went wrong.