feat: add project select to sales & purchases

This commit is contained in:
elforjani13
2022-08-11 11:20:52 +02:00
parent 95137f4fcd
commit 69c4519647
18 changed files with 228 additions and 23 deletions

View File

@@ -2,6 +2,8 @@ import React from 'react';
import intl from 'react-intl-universal';
import { MenuItem, Button } from '@blueprintjs/core';
import { FSelect } from '@/components';
import { CLASSES } from '@/constants/classes';
import classNames from 'classnames';
/**
*
@@ -31,7 +33,6 @@ const projectsItemPredicate = (query, project, _index, exactMatch) => {
const projectsItemRenderer = (project, { handleClick, modifiers, query }) => {
return (
<MenuItem
active={modifiers.active}
disabled={modifiers.disabled}
key={project.id}
onClick={handleClick}
@@ -52,8 +53,18 @@ const projectSelectProps = {
* @param {*} param0
* @returns
*/
export function ProjectsSelect({ projects, ...rest }) {
return <FSelect {...projectSelectProps} items={projects} {...rest} />;
export function ProjectsSelect({ projects, popoverFill, ...rest }) {
return (
<FSelect
{...projectSelectProps}
items={projects}
popoverProps={{ minimal: true, usePortal: !popoverFill }}
className={classNames('form-group--select-list', {
[CLASSES.SELECT_LIST_FILL_POPOVER]: popoverFill,
})}
{...rest}
/>
);
}
/**
*

View File

@@ -48,7 +48,6 @@ function ProjectTimeEntryFormFields() {
name={'project_id'}
projects={projects}
input={ProjectSelectButton}
popoverProps={{ minimal: true }}
/>
</FFormGroup>
</If>