Skip to content
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

Conversation

robertrytovuori
Copy link
Contributor

@robertrytovuori robertrytovuori commented May 3, 2024

Screenshot-service-unit-filter

Copy link
Contributor

@NC-jsAhonen NC-jsAhonen left a 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',
Copy link
Contributor

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>
Copy link
Contributor

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.

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

@robertrytovuori
Copy link
Contributor Author

Screenshot-service-unit-filter

Copy link
Contributor

@NC-jsAhonen NC-jsAhonen left a 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

@@ -33,6 +35,7 @@ const TableFilters = ({
{!!filterOptions.length &&
<p className='table__filters_filter-wrapper_title'>Suodatus</p>
}
{!!componentToRenderUnderLabel && componentToRenderUnderLabel}
Copy link
Contributor

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.

Copy link
Contributor Author

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);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor

@NC-jsAhonen NC-jsAhonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@robertrytovuori robertrytovuori merged commit fc5f539 into develop May 16, 2024
4 checks passed
@juho-kettunen-nc juho-kettunen-nc deleted the MVJ-218_move-service-unit-lease-filter-out-of-detailed-search branch December 4, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants