-
Notifications
You must be signed in to change notification settings - Fork 199
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
Feature/fwf 4371 Backend support different filter types #2596
Open
auslin-aot
wants to merge
11
commits into
AOT-Technologies:develop
Choose a base branch
from
auslin-aot:feature/fwf-4371-backend-support-different-filter-types
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
980efe1
FWF-4371: [Feature] Backend support to add diffecrent types of filter
auslin-aot cbef3e8
FWF-4371: [Feature] Update in filter apis
auslin-aot 4f55517
FWF-4371: [Feature] Update in filter list api
auslin-aot a7b1769
Merge branch 'develop' of https://github.com/AOT-Technologies/forms-f…
auslin-aot 1abe7df
FWF-4371: [Feature] Added testcase
auslin-aot 0bee549
FWF-4371: [Feature] Added changelog
auslin-aot 812f1fb
FWF-4371: [Feature] Included edit permission to attribute filter resp…
auslin-aot bc8383c
FWF-4371: Removed attribute list from filter list
auslin-aot f65245f
FWF-4371: Removed request param filterType from filter list api
auslin-aot bb9b924
FWF-4371: [Feature] Added index for parent_filter_id
auslin-aot 684f850
FWF-4371: [Feature] Updated changelog
auslin-aot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
40 changes: 40 additions & 0 deletions
40
...flow-api/migrations/versions/92bf83135905_add_filter_type_parent_filterid_filter_table.py
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,40 @@ | ||
"""Add filter type and parent filter id to filter table | ||
|
||
Revision ID: 92bf83135905 | ||
Revises: 524194732683 | ||
Create Date: 2025-02-21 14:44:55.823150 | ||
|
||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '92bf83135905' | ||
down_revision = '524194732683' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
# Create the enum type | ||
enum_type = postgresql.ENUM('TASK', 'ATTRIBUTE', 'DATE', name='FilterType') | ||
enum_type.create(op.get_bind(), checkfirst=True) | ||
op.add_column('filter', sa.Column('filter_type', enum_type, nullable=True, server_default='TASK')) | ||
# Update existing rows to set the default value | ||
op.execute("UPDATE filter SET filter_type = 'TASK' WHERE filter_type IS NULL") | ||
# Alter the column to set `nullable=False` | ||
op.alter_column('filter', 'filter_type', nullable=False) | ||
op.create_index(op.f('ix_filter_filter_type'), 'filter', ['filter_type'], unique=False) | ||
op.add_column('filter', sa.Column('parent_filter_id', sa.Integer(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f('ix_filter_filter_type'), table_name='filter') | ||
op.drop_column('filter', 'filter_type') | ||
op.execute("DROP TYPE \"FilterType\"") | ||
op.drop_column('filter', 'parent_filter_id') | ||
# ### end Alembic commands ### |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need this here ?
Can't we have 2 endpoints which I think will be easy to handle on the UI ?
Please note that there are other changes coming in to the picture on show/hide and re-ordering. So I feel it would be better to keep each filter as separate response.
Endpoints would be as simple as /filters/TASK
/filters/ATTRIBUTE?parenFilterId=<>
What do you think ?
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 approach what auslin has followed is to quickly load the initial data when user comes to review screen.
Suppose if we have more number of attribute filters and task filters, if we go with task api which will also have all attributes inside it , TIME TO GET THE RESPONSE WILL BE MORE and only after the response is received , the task list will be refreshed and shown.
If we go with initially loading the TASK FILTER list , and ATTRIBUTE FILTER list after that , Task listing will have to wait for 2 APIs ( synchoronous ) to complete inorder to refresh and show.
Inorder to mitigate the above 2 issues, we thought of returning the TASK filter initially with either the first ATTRIBUTE filter alone in an array , or already selected 1 ATTRIBUTE filter as part of TASK filter and parallely we will call the full ATTRIBUTE filter endpoint so that user wont feel the delay in screen. By the time user plans to change the attibute filter, the ATTRIBUTE filter list will be available to frontend
We will definitely need attibute listing GET endpoint as a separate one so that if we change the TASK filter, updated attributes can be retrieved. Any other use cases like show/hide and re-ordering might need this endpoint.
@sumesh-aot Please share your thoughts
cc @auslin-aot
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.
Understood.
Adding just one filter to the list is misrepresentation of the resource.
If we go with this, we wouldn't need the attributes filter to load initially right ?
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.
Below are the agreed scope for 7.1.0
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.
Thanks for the clarification @sumesh-aot We will separate task and attribute filter and do according to the requirements
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.
Removed attributeFilters from the response of filter list API