fix: danger intent fields.

This commit is contained in:
a.bouhuolia
2021-08-03 14:30:50 +02:00
parent 15bc34d866
commit aab56662a5
13 changed files with 124 additions and 48 deletions

View File

@@ -109,6 +109,7 @@ export default function ItemFormPrimarySection() {
<InputGroup
medium={true}
{...field}
intent={inputIntent({ error, touched })}
inputRef={(ref) => (nameFieldRef.current = ref)}
/>
</FormGroup>
@@ -125,7 +126,7 @@ export default function ItemFormPrimarySection() {
helperText={<ErrorMessage name={'code'} />}
inline={true}
>
<InputGroup medium={true} {...field} />
<InputGroup medium={true} intent={inputIntent({ error, touched })} {...field} />
</FormGroup>
)}
</FastField>

View File

@@ -11,7 +11,9 @@ import {
Classes,
Intent,
Switch,
Alignment,
} from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
@@ -19,6 +21,7 @@ import Icon from 'components/Icon';
import { If, DashboardActionViewsList } from 'components';
import { useItemsListContext } from './ItemsListProvider';
import { useRefreshItems } from 'hooks/query/items';
import withItems from 'containers/Items/withItems';
import withItemsActions from './withItemsActions';
@@ -43,7 +46,8 @@ function ItemsActionsBar({
// Items list context.
const { itemsViews } = useItemsListContext();
// React intl.
// Items refresh action.
const { refresh } = useRefreshItems();
// History context.
const history = useHistory();
@@ -69,6 +73,10 @@ function ItemsActionsBar({
setItemsTableState({ inactiveMode: checked });
};
const handleRefreshBtnClick = () => {
refresh();
};
return (
<DashboardActionsBar>
<NavbarGroup>
@@ -125,6 +133,14 @@ function ItemsActionsBar({
onChange={handleInactiveSwitchChange}
/>
</NavbarGroup>
<NavbarGroup align={Alignment.RIGHT}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="refresh-16" iconSize={14} />}
onClick={handleRefreshBtnClick}
/>
</NavbarGroup>
</DashboardActionsBar>
);
}