Skip to content

Conversation

gaspergrom
Copy link
Contributor

@gaspergrom gaspergrom commented Jun 7, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 3f1ad74

This pull request refactors the activity and conversation modules to use the pinia store and the CrFilter component for data and filter management, and to improve the UI and functionality of the filter components. It also fixes a typo in the auth layout and adds a search filter for the activity list. The changes affect the following files: activity-list.vue, ActivityTypeFilter.vue, config.ts for various filters, activity-list-page.vue, conversation-list.vue, activity-service.js, actions.ts, getters.ts, index.ts, state.ts, auth-layout-side.vue, ChannelFilter.vue, and config.ts for the channel filter.

🤖 Generated by Copilot at 3f1ad74

Sing, O Muse, of the mighty deeds of the code reviewers,
who refactored and improved the activity and conversation modules,
with pinia stores and CrFilters, defineStore and itemLabelRenderer,
and made the UI more elegant and responsive, like the work of Hephaestus.

Why

How

🤖 Generated by Copilot at 3f1ad74

  • Add a CrFilter component to the activity-list.vue and conversation-list.vue components, which allows the user to apply filters to the activity or conversation list using various filter types and options (link,link)
  • Remove the app-pagination-sorter component from the activity-list.vue and conversation-list.vue components, as the CrFilter component handles the pagination and sorting logic internally (link,link)
  • Replace the useStore hook with the useActivityStore and useConversationStore hooks in the activity-list.vue and conversation-list.vue components, which are pinia stores that manage the activity and conversation state and actions (link,link)
  • Remove some unused props and data properties from the activity-list.vue and conversation-list.vue components, as they are now managed by the pinia stores or the CrFilter component (link,link)
  • Define the pinia activity and conversation stores, which are reactive and type-safe stores that contain the state, getters, and actions for the activity and conversation modules (link,link,link,link)
  • Add a fetchActivities action to the pinia activity store, which makes an API call to list activities based on a given body parameter and updates the state with the response data (link)
  • Add a new static method to the ActivityService class that makes an API call to list activities based on a given body parameter and returns the response data (link)
  • Replace the app-activity-list-tabs component with an el-tabs component in the activity-list-page.vue component, which renders a tabbed navigation for the activity and conversation views (link)
  • Replace the script tag with a script setup tag in the activity-list-page.vue component, which allows defining the component options using the Composition API and TypeScript (link)
  • Remove some unused props and data properties from the activity-list-page.vue component, and define some refs and a function that handle the activity drawer logic and the tab change logic (link)
  • Add a new file that defines the channel filter component for the conversation list, which is a custom select filter component that allows the user to filter conversations by the channel name (link)
  • Add a new file that defines the channel filter config for the conversation list, which is a custom filter config object that contains the configuration for the channel filter component (link)
  • Modify the options, itemLabelRenderer, and apiFilterRenderer properties of the platform, member, date, and sentiment filter configs, to use the enabledConfigs property of the CrowdIntegrations object, the itemLabelRendererByType function, and the value and include properties of the multi-select and select filters (link,link,link,link,link,link,link,link,link,link,link,link,link)
  • Modify the options and data props of the activityType and channel filter components, to use the types property of the activityTypeStore and the currentTenant getter from the vuex store, and emit the update:data event when changed (link,link,link,link)
  • Remove the optional chaining operator from the key attribute of the app-activity-item component, as the activity.id should always be defined and not nullish (link)
  • Add a new export to the main filter config file, which is the activitySearchFilter object that contains the configuration for the search filter component for the activity list (link,link)
  • Fix a typo in the auth-layout-side.vue component, which adds a missing comma after the word 'product' in the paragraph text (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 7, 2023
@gaspergrom gaspergrom requested a review from joanagmaia June 7, 2023 09:17
@gaspergrom gaspergrom self-assigned this Jun 7, 2023
Copy link
Contributor

@joanagmaia joanagmaia left a comment

Choose a reason for hiding this comment

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

Looks great!
One thing I noticed while testing was that conversation query endpoint is returning 500. Looked at the logs and it seems that is because of the orderBy value being passed:
column conversation.timestamp does not exist

@gaspergrom gaspergrom changed the title Improvement/activity new filters Activity new filters Jun 8, 2023
@gaspergrom gaspergrom changed the title Activity new filters Activity & Conversation new filters Jun 8, 2023
@gaspergrom gaspergrom merged commit 2c503b3 into feature/filters Jun 8, 2023
@gaspergrom gaspergrom deleted the improvement/activity-new-filters branch June 8, 2023 06:56
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