Skip to content

Member filters connect#948

Merged
gaspergrom merged 3 commits intofeature/filtersfrom
improvement/member-new-filters
Jun 7, 2023
Merged

Member filters connect#948
gaspergrom merged 3 commits intofeature/filtersfrom
improvement/member-new-filters

Conversation

@gaspergrom
Copy link
Copy Markdown
Contributor

@gaspergrom gaspergrom commented Jun 6, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at bb7ee9c

This pull request migrates the member module from Vuex to pinia for state management, and improves the filtering and sorting features for the member views. It updates the frontend components, configs, and services to use the useMemberStore function and the pinia actions to fetch and manipulate members and their attributes. It also adds a custom select filter for activity types, and changes the default sorting of the saved views to use the lastActive prop. Additionally, it adds a condition to the TagRepository class in the backend to allow querying tags by ids.

🤖 Generated by Copilot at bb7ee9c

We're breaking free from the old state
We're using pinia to create
A better way to query and filter
The members of our fate

Why

How

🤖 Generated by Copilot at bb7ee9c

  • Add listMembers method to MemberService class to query members with custom filters and pagination from the backend (link)
  • Add TagRepository class to filter tags by ids if the filter object has an ids property (link)
  • Replace CrSelectFilter component with CrSelectFilterAsync component for activity type filter and load options from the backend (link, link)
  • Replace MultiSelectFilterConfig import with MultiSelectAsyncFilterConfig import for tags filter and load options from the backend (link)
  • Replace apiFilterRendererByType calls with custom functions for average sentiment, engagement level, and tags filters to use custom logic for the backend query (link, link, link)
  • Replace createdBy and lastActivity props with lastActive prop in the order objects of the saved views to update the default sorting (link, link, link, link, link, link)
  • Import useMemberStore function from pinia module and access member store in various components (link, link, link, link, link)
  • Replace store.dispatch and store.getters calls with pinia actions and computed properties in various components (link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add @selection-change event handler to el-table component to assign selected members to the member store (link)
  • Replace count prop with totalMembers prop in app-empty-state-cta and app-pagination components to use the total number of members from the last query (link, link)
  • Replace pagination.pageSize and pagination.currentPage props with pagination.perPage and pagination.page props in app-pagination-sorter component to use the current pagination settings from the filters object (link)
  • Remove width prop from app-member-list-filter component to avoid a warning in the console (link)
  • Uncomment app-member-list-table component and register AppMemberListTable component in the member list page (link, link)
  • Add loading ref and showLoading function to the member list page to show a loading indicator while fetching data from the backend (link, link)
  • Add tableWidth ref and assignment to the member list table component to store the width of the table element (link, link)
  • Import piniaMapActions function from pinia module and map fetchMembers action to the member dropdown component (link, link)
  • Remove unused apiFilterRendererByType imports from average sentiment and engagement level filter configs (link, link)
  • Replace itemLabelRendererByType import with apiFilterRendererByType import in activity type filter config (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@gaspergrom gaspergrom added the Improvement Created by Linear-GitHub Sync label Jun 6, 2023
@gaspergrom gaspergrom requested a review from joanagmaia June 6, 2023 09:43
@gaspergrom gaspergrom self-assigned this Jun 6, 2023
Comment thread frontend/src/modules/auth/auth-socket.js Outdated
Comment thread frontend/src/modules/member/config/filters/activityType/config.ts
Comment thread frontend/src/modules/member/pages/member-list-page.vue Outdated
Comment thread frontend/src/shared/pagination/pagination-sorter.vue Outdated
@joanagmaia
Copy link
Copy Markdown
Contributor

joanagmaia commented Jun 6, 2023

Just did a couple of manual tests and also found this:

  • If you load localhost/members the page just keeps loading forever. In fact there is never a request with countOnly set to false, only if you go to another tab and then go back to the first.
  • Exclude is not working for some filters. For example for activityCount, this is what is being passed to the API in the filters: activityCount: {not: {filter: {eq: 1}}}. Happens in some other cases I tried
  • Is the styling of the selected dropdown ok? It appears as gray instead of the brand color
    Screenshot 2023-06-06 at 16 30 59
  • Active on/Identities default is exclude and should be include. All custom attributes are with exclude by default as well
  • Activity type is not being added to the filters, seems like it's doing nothing
  • For searchable filters such as tags, if there are no matches, you should show a message of "... not found (if there are selected filters)
    Screenshot 2023-06-06 at 16 34 37

@gaspergrom gaspergrom requested a review from joanagmaia June 7, 2023 07:21
@gaspergrom gaspergrom merged commit a3ffc63 into feature/filters Jun 7, 2023
@gaspergrom gaspergrom deleted the improvement/member-new-filters branch June 7, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants