-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move service unit filter next to basic search in leases view #477
move service unit filter next to basic search in leases view #477
Conversation
robertrytovuori
commented
May 3, 2024
•
edited
Loading
edited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality works as expected. I added some suggestions for improving layout and following established practices.
autoBlur | ||
disableDirty | ||
fieldAttributes={{ | ||
label: 'Palvelukokonaisuus', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label is repeated in many places, so it is recommended to use the enum in leases/enums.js
@@ -236,6 +236,27 @@ class Search extends PureComponent<Props, State> { | |||
/> | |||
</Column> | |||
</Row> | |||
<SearchRow> | |||
<SearchLabelColumn> | |||
<SearchLabel>Palvelukokonaisuus</SearchLabel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be something like Suodata palvelukokonaisuuden mukaan
, to distinguish from the top nav bar filter. Should this label be put on a separate line above the field, just like in other fields?
You could also add a visible label for the search field above in the same way with text something like Hae hakusanalla
or something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Headerissa voisi lukea Oma palvelukokonaisuus
Suodatuksessa voisi lukea Vuokrauspalvelu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted some new comments
src/components/table/TableFilters.js
Outdated
@@ -33,6 +35,7 @@ const TableFilters = ({ | |||
{!!filterOptions.length && | |||
<p className='table__filters_filter-wrapper_title'>Suodatus</p> | |||
} | |||
{!!componentToRenderUnderLabel && componentToRenderUnderLabel} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest two possible options for renaming componentToRenderUnderLabel
:
componentToRenderUnderTitle
: The p element above is not a label but a title. I was a bit confused about where there should be a label.serviceUnitFilterComponent
: Describes more clearly about what the component is. There are no other components to be rendered in this position, so I think it is fine to state it more explicitly what component is rendered there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed it to componentToRenderUnderTitle. Though serviceUnitFilterComponent tells more in this use case, I still think the TableFilter component does not have to know what React component is being injected.
@@ -105,7 +105,7 @@ class Search extends PureComponent<Props, State> { | |||
newState.municipalityOptions = getFieldOptions(props.leaseAttributes, LeaseFieldPaths.MUNICIPALITY); | |||
newState.tenantTypeOptions = getFieldOptions(props.leaseAttributes, LeaseTenantContactSetFieldPaths.TYPE, false); | |||
newState.typeOptions = getFieldOptions(props.leaseAttributes, LeaseFieldPaths.TYPE); | |||
newState.serviceUnitOptions = getFieldOptions(props.leaseAttributes, 'service_unit', true); | |||
//newState.serviceUnitOptions = getFieldOptions(props.leaseAttributes, 'service_unit', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isSearchBasicMode
method beginning on line 147 delete searchQuery.service_unit;
needs to be added so that the detailed search view would not render when the service unit filter is being modified. Now it will render when the page is refreshed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved