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

Frontend cleanup #2753

Merged
merged 5 commits into from
Jan 10, 2025
Merged

Frontend cleanup #2753

merged 5 commits into from
Jan 10, 2025

Conversation

gaspergrom
Copy link
Contributor

@gaspergrom gaspergrom commented Jan 9, 2025

Changes proposed ✍️

What

copilot:summary

copilot:poem

Why

How

copilot:walkthrough

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots 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.

Summary by CodeRabbit

Release Notes

  • Internationalization Removal

    • Removed localization support across the entire frontend
    • Hardcoded English messages and labels throughout the application
  • Feature Flag Removal

    • Eliminated feature flag management system
    • Simplified conditional rendering and feature access logic
  • Automation Functionality Removal

    • Completely removed automation-related components, routes, and services
    • Deleted automation management interfaces and permissions
  • Enrichment Features Modification

    • Removed enrichment-related sneak peek components
    • Simplified display of enriched content across various views
  • Notes Management Removal

    • Deleted note-related components and services
    • Removed note creation, editing, and deletion functionality
  • Permissions Cleanup

    • Removed permissions related to automations and notes
    • Simplified permission management system
  • Error and Message Handling

    • Replaced dynamic error messages with static English strings
    • Simplified user feedback mechanisms

Sameh16 and others added 5 commits January 9, 2025 08:41
Copy link

coderabbitai bot commented Jan 9, 2025

Walkthrough

This pull request represents a comprehensive refactoring effort to remove feature flags, internationalization (i18n) support, and several modules related to automation, notes, and enrichment from the frontend codebase. The changes significantly simplify the application's architecture by eliminating complex feature management, localization, and optional feature implementations. Key areas of modification include removing dynamic translations, hardcoding messages, deleting feature flag management, and removing entire modules like automation and notes.

Changes

File/Module Change Summary
Internationalization Removed entire i18n system, language files, and translation-related components
Feature Flags Deleted feature flag management system and related checks
Automation Module Completely removed automation-related components, routes, and services
Notes Module Eliminated notes-related components, services, and type definitions
Enrichment Removed enrichment sneak peek and related components
Permissions Removed permissions related to automation and notes

Poem

🐰 Hop, hop, refactor we go!
Flags and translations, time to let go
Simplicity reigns, code gets lean
A cleaner path, now clearly seen
🚀 Farewell complexity, hello clean design!

Finishing Touches

  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🔭 Outside diff range comments (5)
frontend/src/shared/store/actions.js (1)

Line range hint 301-307: Reduce code duplication in analytics tracking

The code for getting the translated module name and tracking analytics is duplicated across multiple locations. This makes maintenance harder and increases the chance of inconsistencies.

Consider extracting the analytics tracking into a separate function:

+ const trackAnalytics = (moduleName, event, data) => {
+   const translatedModuleName = actionsMessages[moduleName]?.menu || moduleName;
+   window.analytics.track(
+     `${translatedModuleName} ${event}`,
+     data
+   );
+ };

- const translatedModuleName = actionsMessages[moduleName]?.menu || '';
- window.analytics.track(
-   `${translatedModuleName} View Changed`,
-   {
-     view: getters.activeView.label,
-   },
- );
+ trackAnalytics(moduleName, 'View Changed', {
+   view: getters.activeView.label,
+ });

This pattern should be applied to all analytics tracking calls in the file.

Also applies to: 336-347, 376-387

frontend/src/config/integrations/gerrit/components/gerrit-settings-drawer.vue (1)

Line range hint 18-36: Fix duplicate element IDs.

Multiple input elements are using the same ID "devUrl". HTML requires IDs to be unique within the document.

-          id="devUrl"
+          id="gerritOrgUrl"
           v-model="form.orgURL"
           class="text-green-500"
           spellcheck="false"
           placeholder="Enter Organization URL"
         />
         <el-input
-          id="devUrl"
+          id="gerritUsername"
           v-model="form.user"
           class="text-green-500 mt-2"
           spellcheck="false"
           placeholder="Enter username"
         />
         <el-input
-          id="devUrl"
+          id="gerritProjectKey"
           v-model="form.key"
           class="text-green-500 mt-2"
           spellcheck="false"
           placeholder="Enter Project key"
         />
frontend/src/config/integrations/reddit/components/reddit-settings-drawer.vue (1)

Line range hint 11-14: Fix incorrect alt text for Reddit logo.

The alt text incorrectly says "Git logo" instead of "Reddit logo".

       <img
         class="w-6 h-6 mr-2"
         :src="logoUrl"
-        alt="Git logo"
+        alt="Reddit logo"
       />
frontend/src/modules/auth/auth.socket.ts (1)

Line range hint 56-62: Remove commented-out code and implement the integration handler

The integration completion handler contains commented-out code and lacks proper implementation. Either implement the handler or remove the event listener if it's no longer needed.

-  socketIoClient.on(SocketEvents.integrationCompleted, (data) => {
-    console.info('Integration onboarding done', data);
-    // store.dispatch(
-    //   'integration/doFind',
-    //   JSON.parse(data).integrationId,
-    // );
-  });
frontend/src/shared/pagination/pagination-sorter.vue (1)

Line range hint 212-219: Enhance error handling with more specific error messages.

The current error handling is too generic. Consider providing more specific error messages based on the error type to help users better understand and resolve issues.

- if (error !== 'cancel') {
+ if (error === 'network') {
+   Message.error(
+     'Unable to connect to the server. Please check your internet connection.',
+     { title: 'Network Error' }
+   );
+ } else if (error !== 'cancel') {
   Message.error(
     'An error has occured while trying to export the CSV file. Please try again',
     {
       title: 'CSV Export failed',
     },
   );
+ }
🧹 Nitpick comments (35)
frontend/src/modules/contributor/pages/contributor-details.page.vue (2)

Line range hint 92-92: Consider using a more specific type for activities ref.

Instead of using any, consider creating an interface or type that accurately represents the activities component's structure.

-const activities = ref<any>(null);
+interface ActivitiesComponent {
+  loadMore: () => void;
+}
+const activities = ref<ActivitiesComponent | null>(null);

144-149: Consider debouncing the scroll control function.

The scroll event fires frequently, and the loadMore function might be called multiple times near the scroll threshold. Consider debouncing the scroll handler to prevent potential performance issues.

+import { debounce } from 'lodash-es';
+
-const controlScroll = (e) => {
+const controlScroll = debounce((e) => {
   if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight - 10) {
     if (tabs.value === 'activities') {
       activities.value.loadMore();
     }
   }
-};
+}, 200);
frontend/src/shared/store/actions-messages.js (2)

90-90: Fix inconsistent pluralization in destroyAll messages

The pluralization in destroyAll success messages is inconsistent across entities:

  • "Activity(s)" uses (s)
  • "Automation(s)" uses (s)
  • "Conversation(s)" uses (s)
  • While others use proper plural forms like "Profiles"

Apply this diff to standardize pluralization:

-      success: 'Activity(s) successfully deleted',
+      success: 'Activities successfully deleted',
-      success: 'Automation(s) successfully deleted',
+      success: 'Automations successfully deleted',
-      success: 'Conversation(s) successfully deleted',
+      success: 'Conversations successfully deleted',

Also applies to: 108-108, 126-126


80-80: Fix capitalization in Activity error messages

The word "Activity" is inconsistently capitalized in error messages while other entities use lowercase.

Apply this diff to standardize capitalization:

-      error: 'There was an error while saving the Activity',
+      error: 'There was an error while saving the activity',
-      error: 'There was an error while saving the Activity',
+      error: 'There was an error while saving the activity',

Also applies to: 84-84

frontend/src/shared/store/actions.js (1)

65-65: Improve error handling for missing messages

The current fallback to empty string ('') when messages are missing could lead to silent failures. Consider providing a default message or logging these cases.

Apply this pattern for message retrieval:

- actionsMessages[moduleName]?.destroy.success || '',
+ actionsMessages[moduleName]?.destroy.success || `${moduleName} successfully deleted`,

This ensures users always see meaningful messages, even if the message configuration is incomplete.

Also applies to: 94-94, 141-141, 147-147, 171-171, 178-178

frontend/src/config/integrations/twitter/components/twitter-settings-drawer.vue (1)

Line range hint 1-24: Standardize X/Twitter branding across the component.

The component uses both "X/Twitter" and "Twitter" in different places. Consider standardizing to just "X" or "Twitter" consistently throughout the component.

frontend/src/config/integrations/linkedin/components/linkedin-settings-drawer.vue (1)

Line range hint 201-209: Improve type safety for analytics tracking.

The direct use of (window as any).analytics bypasses TypeScript's type checking. Consider creating a typed analytics service or interface.

-    (window as any).analytics.track('LinkedIn: settings drawer', {
+    analyticsService.track('LinkedIn: settings drawer', {
       action: 'close',
     });
frontend/src/modules/auth/auth.socket.ts (2)

1-11: Consider improving type safety for socket client

The socketIoClient is typed as any. Consider using the proper Socket.IO client types for better type safety and IDE support.

+import { Socket } from 'socket.io-client';
-let socketIoClient: any;
+let socketIoClient: Socket;

Line range hint 64-264: Consider extracting URL construction logic

The member and organization merge/unmerge handlers repeat URL construction logic. Consider extracting this into a utility function for better maintainability.

// Suggested utility function:
const createEntityUrl = (entityType: 'people' | 'organizations', id: string, projectGroupId: string) => 
  `${window.location.origin}/${entityType}/${id}?projectGroup=${projectGroupId}`;

// Usage example:
const url = createEntityUrl('people', primaryId, selectedProjectGroup.value?.id);
frontend/src/utils/logRocket/index.ts (1)

7-7: Improve type annotation

While the removal of feature flag dependency aligns with the cleanup objectives, the type annotation could be more precise.

Consider updating the type annotation:

-const isLogRocketEnabled: () => void = () => config.env === 'production';
+const isLogRocketEnabled = (): boolean => config.env === 'production';
frontend/src/modules/tenant/tenant-model.js (1)

Line range hint 6-31: Align variable names with UI terminology

The UI labels now use "Community" terminology, but variable names still use "tenant" prefix (e.g., tenantUrl, tenantName, tenantPlatforms, tenantSize). Consider renaming these variables to match the UI terminology for better maintainability.

- tenantUrl: new StringField('url', 'Community URL', {
+ communityUrl: new StringField('url', 'Community URL', {
    required: true,
    max: 50,
  }),
- tenantName: new StringField('name', 'Community name', {
+ communityName: new StringField('name', 'Community name', {
    required: true,
    max: 50,
  }),
- tenantPlatforms: new StringArrayField(
+ communityPlatforms: new StringArrayField(
    'integrationsRequired',
    'Community platforms',
    {
      required: true,
    },
  ),
- tenantSize: new StringField(
+ communitySize: new StringField(
    'communitySize',
    'Community size',
    {
      required: true,
    },
  ),
frontend/src/modules/user/user-model.js (1)

39-43: Use consistent email terminology

The label "E-mail" uses hyphenation which is less common in modern UIs. Consider using "Email" instead for consistency with common practices.

- email: new StringField('email', 'E-mail', {
+ email: new StringField('email', 'Email', {
    required: true,
    email: true,
    max: 255,
  }),
frontend/src/integrations/hubspot/components/hubspot-connect.vue (2)

Line range hint 22-26: Improve TypeScript integration object type

The integration prop uses a generic Object type. Consider defining a more specific interface for better type safety.

interface HubspotIntegration {
  // Add relevant properties here
  id?: string;
  settings?: Record<string, unknown>;
  // ... other properties
}

defineProps({
  integration: {
    type: Object as PropType<HubspotIntegration>,
    default: () => ({}),
  },
});

Line range hint 35-44: Add return types to functions

The connect and settings functions are missing TypeScript return types. Consider adding them for better type safety.

- const connect = () => {
+ const connect = (): Promise<void> => {
    const nango = new Nango({ host: config.nangoUrl });
    nango.auth(
      'hubspot',
      `${tenant.value.id}-hubspot`,
    )
      .then(() => doHubspotConnect(null))
      .then(() => {
        openSettingsDrawer.value = true;
      });
  };

- const settings = () => {
+ const settings = (): void => {
    openSettingsDrawer.value = true;
  };

Also applies to: 46-48

frontend/src/shared/fields/boolean-field.js (1)

9-10: Document the removal of i18n support

The change from i18n to hardcoded English strings aligns with the PR objective but might impact non-English users. Consider adding a comment explaining this architectural decision.

 constructor(name, label, config = {}) {
   super(name, label);

   this.hint = config.hint;
+  // Note: i18n support removed as part of frontend cleanup
   this.yesLabel = config.yesLabel || 'Yes';
   this.noLabel = config.noLabel || 'No';
frontend/src/modules/activity/activity-model.js (2)

11-11: Improve search field label clarity

The 'search' label is too generic. Consider using a more descriptive label like 'Search activities'.

-  search: new SearchField('search', 'search', {
+  search: new SearchField('search', 'Search activities', {

16-16: Ensure consistent capitalization in labels

Some labels start with capital letters ('Person', 'Platform') while others use title case ('Activity type'). Standardize the capitalization across all labels.

-    'Person',
+    'Person',  // Correct
-    'Platform',
+    'Platform',  // Correct
-  type: new ActivityTypeField('type', 'Activity type', {
+  type: new ActivityTypeField('type', 'Activity Type', {

Also applies to: 27-27, 34-34

frontend/src/modules/member/member-model.js (1)

15-16: Consider adding tooltips for technical fields

Fields like 'username' that have special validation rules (nonEmpty, requiredUnless) should have tooltips explaining these constraints to users.

-  username: new JsonField('username', 'Username', {
+  username: new JsonField('username', 'Username', {
+    hint: 'Required if email is not provided',
     nonEmpty: true,
     nonEmptyValues: true,
     requiredUnless: 'email',
     customFilterPreview: (record) => record,
   }),
frontend/src/shared/message/message.js (1)

47-47: Fix typo in default error message

The word "Ops" should be "Oops" in the default error message.

-      message = 'Ops, an error occurred';
+      message = 'Oops, an error occurred';
frontend/src/modules/tag/tag-destroy-store.js (1)

52-52: Improve message consistency and pluralization

The success messages use inconsistent pluralization approaches:

  • Single deletion: "Tag successfully deleted"
  • Bulk deletion: "Tag(s) successfully deleted"

Consider using proper plural forms instead of the "(s)" suffix for better user experience.

-        Message.success('Tag successfully deleted');
+        Message.success('Tag successfully deleted');

-        Message.success('Tag(s) successfully deleted');
+        Message.success('Tags successfully deleted');

Also applies to: 84-84

frontend/src/shared/fields/date-field.js (1)

57-57: Consider centralizing validation messages

The validation messages are duplicated between date-field.js and date-time-field.js. Consider extracting these messages into a shared constants file to maintain consistency and ease future updates.

Example refactor:

// shared/constants/validation-messages.js
export const VALIDATION_MESSAGES = {
  REQUIRED: 'This field is required',
  INVALID_DATE: '{path} is invalid'
};

// Then import and use in both files
import { VALIDATION_MESSAGES } from '@/shared/constants/validation-messages';

Also applies to: 87-87

frontend/src/modules/conversation/components/conversation-dropdown.vue (1)

72-72: Consider extracting hardcoded messages to a constants file.

As part of the i18n removal, consider centralizing all hardcoded messages in a dedicated constants file. This would make future message updates easier to manage and maintain consistency across the application.

frontend/src/modules/settings/settings-store.js (1)

81-81: Extract countdown duration to constants.

Consider moving secondsForReload to a constants file for better maintainability. This would make it easier to adjust the countdown duration if needed.

frontend/src/shared/fields/integer-field.js (1)

75-75: Consider centralizing validation messages.

With the removal of i18n, consider creating a dedicated validation messages module to maintain consistency across all form validations. This would help:

  1. Maintain consistent wording across similar validations
  2. Make message updates easier to manage
  3. Ensure validation message format consistency

Example structure:

// validation-messages.js
export const VALIDATION_MESSAGES = {
  integer: (label) => `${label} must be an integer`,
  required: 'This field is required',
  min: (label, min) => `${label} must be greater than or equal to ${min}`,
  max: (label, max) => `${label} must be less than or equal to ${max}`,
};

Also applies to: 87-87, 95-95, 103-103

frontend/src/shared/fields/string-array-field.js (1)

43-43: Validation messages have been hardcoded as part of i18n removal.

The messages are clear and maintain the necessary information. However, consider extracting these strings to a centralized constants file for better maintainability and future-proofing.

+ // In shared/constants/validation-messages.js
+ export const VALIDATION_MESSAGES = {
+   REQUIRED: 'This field is required',
+   MIN_ITEMS: (label, min) => `${label} field must have at least ${min} items`,
+   MAX_ITEMS: (label, max) => `${label} field must have less than or equal to ${max} items`,
+ };

Also applies to: 51-51, 59-59

frontend/src/shared/fields/string-field.js (1)

59-59: Consider improving validation message for pattern matching.

While most messages are clear, the pattern matching error message (${this.label} is invalid) could be more helpful by describing the expected pattern.

- message: `${this.label} is invalid`,
+ message: `${this.label} must match the required pattern${this.matches ? `: ${this.matches}` : ''}`,

Also applies to: 66-66, 73-73, 80-80

frontend/src/modules/tag/tag-form-store.js (1)

104-104: Consider differentiating create and update success messages.

While using the same message for both operations works, it might be more user-friendly to specify whether the tag was created or updated.

- Message.success('Tag successfully saved');
+ Message.success(values.id ? 'Tag successfully updated' : 'Tag successfully created');

Also applies to: 132-132

frontend/src/modules/admin/pages/admin-panel.page.vue (1)

Line range hint 99-103: Consider improving condition readability.

While the logic is correct, the condition could be more readable by using an array and includes method.

Consider this alternative:

-  if ((initialActiveTab === 'api-keys' || initialActiveTab === 'audit-logs') && !isAdminUser.value) {
+  const adminOnlyTabs = ['api-keys', 'audit-logs'];
+  if (adminOnlyTabs.includes(initialActiveTab) && !isAdminUser.value) {
     activeTab.value = 'project-groups';
   } else {
     activeTab.value = route.hash.substring(1) as string || 'project-groups';
   }
frontend/src/modules/eagle-eye/pages/eagle-eye-onboard-page.vue (1)

79-84: Consider using constants for feature copy text.

While the function logic is correct, the hardcoded strings could be moved to constants for better maintainability.

Consider this approach:

+const FEATURE_COPY = {
+  ENTERPRISE: 'Enterprise',
+  SCALE: 'Scale',
+} as const;
+
 const isPremiumFeatureCopy = () => {
   if (config.isCommunityVersion) {
-    return 'Enterprise';
+    return FEATURE_COPY.ENTERPRISE;
   }
-  return 'Scale';
+  return FEATURE_COPY.SCALE;
 };
frontend/src/modules/organization/organization-model.js (1)

17-18: Consider using a constants file for field labels.

The transition from i18n to hardcoded strings introduces potential maintainability issues. Consider moving these strings to a dedicated constants file to maintain consistency and ease future updates.

+ // organizationConstants.js
+ export const FIELD_LABELS = {
+   ID: 'id',
+   NAME: 'Name',
+   DESCRIPTION: 'Description',
+   LOCATION: 'Location',
+   // ... other labels
+ };

  // organization-model.js
- id: new StringField('id', 'id'),
+ id: new StringField('id', FIELD_LABELS.ID),

Also applies to: 24-24, 26-26, 29-29, 33-33, 80-80

frontend/src/modules/organization/components/list/organization-common-list-table.vue (1)

Line range hint 179-186: Enhance error handling with specific error messages.

The catch block uses a generic error message. Consider providing more specific error messages based on the error type.

- .catch(() => {
+ .catch((error) => {
    Message.closeAll();
-   Message.error('Something went wrong');
+   Message.error(
+     error.response?.status === 403
+       ? 'You do not have permission to delete this organization'
+       : 'Failed to delete the organization. Please try again'
+   );
  });
frontend/src/modules/member/components/form/member-form-global-attributes.vue (1)

266-266: LGTM! Simplified error and success messages.

Replaced i18n messages with static strings:

  • Error message: "Ops, an error occurred"
  • Success message: "Custom Attributes successfully updated"

Note: There's a minor typo in the error message. Consider changing "Ops" to "Oops".

-    Message.error('Ops, an error occurred');
+    Message.error('Oops, an error occurred');

Also applies to: 269-269

frontend/src/modules/organization/pages/organization-form-page.vue (1)

492-492: Consider making the error message more specific

The current error message is generic. Consider providing more context about what went wrong during creation.

-      Message.error('There was an error creating the organization');
+      Message.error('Failed to create organization. Please check the provided information and try again');
frontend/src/shared/fields/integer-range-field.js (1)

37-37: Consider documenting the i18n removal impact.

The hardcoded error message aligns with the PR objective of removing i18n support. While this simplifies the codebase, it's worth documenting this architectural decision in the README or relevant documentation to inform future maintainers about the English-only error messages.

frontend/src/shared/fields/relation-to-one-field.js (1)

58-58: Enhance error message clarity with field context.

While removing i18n support aligns with the PR objectives, consider including the field label in the error message for better user experience:

-        message: 'This field is required',
+        message: `${this.label} is required`,

This change would maintain the simplicity while providing more context to users about which field failed validation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6738568 and 4094403.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (131)
  • frontend/package.json (0 hunks)
  • frontend/scripts/docker-entrypoint.sh (0 hunks)
  • frontend/src/app.vue (1 hunks)
  • frontend/src/config.js (0 hunks)
  • frontend/src/config/integrations/devto/components/devto-connect-drawer.vue (2 hunks)
  • frontend/src/config/integrations/gerrit/components/gerrit-settings-drawer.vue (1 hunks)
  • frontend/src/config/integrations/hackernews/components/hackernews-settings-drawer.vue (2 hunks)
  • frontend/src/config/integrations/linkedin/components/linkedin-settings-drawer.vue (1 hunks)
  • frontend/src/config/integrations/reddit/components/reddit-settings-drawer.vue (1 hunks)
  • frontend/src/config/integrations/stackoverflow/components/stackoverflow-settings-drawer.vue (1 hunks)
  • frontend/src/config/integrations/twitter/components/twitter-settings-drawer.vue (1 hunks)
  • frontend/src/config/permissions/admin.ts (0 hunks)
  • frontend/src/config/permissions/projectAdmin.ts (0 hunks)
  • frontend/src/config/permissions/readonly.ts (0 hunks)
  • frontend/src/i18n/en.js (0 hunks)
  • frontend/src/i18n/es.js (0 hunks)
  • frontend/src/i18n/index.js (0 hunks)
  • frontend/src/i18n/pt-BR.js (0 hunks)
  • frontend/src/integrations/hubspot/components/hubspot-connect.vue (1 hunks)
  • frontend/src/main.ts (0 hunks)
  • frontend/src/middleware/navigation/navigation-guard.ts (0 hunks)
  • frontend/src/modules/activity/activity-model.js (1 hunks)
  • frontend/src/modules/activity/components/activity-dropdown.vue (1 hunks)
  • frontend/src/modules/admin/pages/admin-panel.page.vue (1 hunks)
  • frontend/src/modules/auth/auth.socket.ts (1 hunks)
  • frontend/src/modules/auth/types/Tenant.type.ts (0 hunks)
  • frontend/src/modules/automation/automation-limit.js (0 hunks)
  • frontend/src/modules/automation/automation-module.js (0 hunks)
  • frontend/src/modules/automation/automation-routes.js (0 hunks)
  • frontend/src/modules/automation/automation-service.js (0 hunks)
  • frontend/src/modules/automation/automation-store.js (0 hunks)
  • frontend/src/modules/automation/components/automation-dropdown.vue (0 hunks)
  • frontend/src/modules/automation/components/automation-executions.vue (0 hunks)
  • frontend/src/modules/automation/components/automation-form.vue (0 hunks)
  • frontend/src/modules/automation/components/automation-list.vue (0 hunks)
  • frontend/src/modules/automation/components/automation-toggle.vue (0 hunks)
  • frontend/src/modules/automation/components/executions/automation-execution-list.vue (0 hunks)
  • frontend/src/modules/automation/components/executions/automation-execution.vue (0 hunks)
  • frontend/src/modules/automation/components/index.js (1 hunks)
  • frontend/src/modules/automation/components/list/automation-list-table.vue (0 hunks)
  • frontend/src/modules/automation/config/automation-types/index.ts (0 hunks)
  • frontend/src/modules/automation/config/automation-types/shared/filter-options/new-activity-filter-options.vue (0 hunks)
  • frontend/src/modules/automation/config/automation-types/shared/filter-options/new-member-filter-options.vue (0 hunks)
  • frontend/src/modules/automation/config/automation-types/shared/trigger-member-activity.vue (0 hunks)
  • frontend/src/modules/automation/config/automation-types/slack/config.ts (0 hunks)
  • frontend/src/modules/automation/config/automation-types/slack/slack-action.vue (0 hunks)
  • frontend/src/modules/automation/config/automation-types/webhook/config.ts (0 hunks)
  • frontend/src/modules/automation/config/automation-types/webhook/webhook-action.vue (0 hunks)
  • frontend/src/modules/automation/pages/automation-page.vue (0 hunks)
  • frontend/src/modules/automation/store/actions.js (0 hunks)
  • frontend/src/modules/automation/store/index.js (0 hunks)
  • frontend/src/modules/automation/store/state.js (0 hunks)
  • frontend/src/modules/contributor/components/details/contributor-details-notes.vue (0 hunks)
  • frontend/src/modules/contributor/pages/contributor-details.page.vue (2 hunks)
  • frontend/src/modules/conversation/components/conversation-dropdown.vue (1 hunks)
  • frontend/src/modules/eagle-eye/pages/eagle-eye-onboard-page.vue (2 hunks)
  • frontend/src/modules/index.ts (0 hunks)
  • frontend/src/modules/member/components/form/member-form-global-attributes.vue (1 hunks)
  • frontend/src/modules/member/components/list/member-list-table.vue (4 hunks)
  • frontend/src/modules/member/components/list/member-list-toolbar.vue (3 hunks)
  • frontend/src/modules/member/components/member-dropdown-content.vue (0 hunks)
  • frontend/src/modules/member/member-enrichment.js (0 hunks)
  • frontend/src/modules/member/member-export-limit.js (1 hunks)
  • frontend/src/modules/member/member-model.js (2 hunks)
  • frontend/src/modules/member/store/actions.js (2 hunks)
  • frontend/src/modules/notes/components/note-dropdown.vue (0 hunks)
  • frontend/src/modules/notes/components/note-editor.vue (0 hunks)
  • frontend/src/modules/notes/components/note-item.vue (0 hunks)
  • frontend/src/modules/notes/note-service.js (0 hunks)
  • frontend/src/modules/notes/types/Note.ts (0 hunks)
  • frontend/src/modules/organization/components/form/email/organization-form-email-item.vue (0 hunks)
  • frontend/src/modules/organization/components/form/identity/organization-form-identity-item.vue (0 hunks)
  • frontend/src/modules/organization/components/list/organization-common-list-table.vue (1 hunks)
  • frontend/src/modules/organization/components/list/organization-list-table.vue (8 hunks)
  • frontend/src/modules/organization/components/list/organization-list-toolbar.vue (1 hunks)
  • frontend/src/modules/organization/components/organization-actions.vue (0 hunks)
  • frontend/src/modules/organization/components/organization-dropdown-content.vue (1 hunks)
  • frontend/src/modules/organization/components/organization-headline..vue (0 hunks)
  • frontend/src/modules/organization/components/organization-manage-domains-drawer.vue (0 hunks)
  • frontend/src/modules/organization/components/organization-manage-emails-drawer.vue (0 hunks)
  • frontend/src/modules/organization/components/organization-manage-identities-drawer.vue (0 hunks)
  • frontend/src/modules/organization/components/view/_aside/_aside-enriched.vue (0 hunks)
  • frontend/src/modules/organization/components/view/_aside/_aside-identities-extra.vue (0 hunks)
  • frontend/src/modules/organization/components/view/_aside/_aside-identities.vue (0 hunks)
  • frontend/src/modules/organization/components/view/organization-view-aside.vue (0 hunks)
  • frontend/src/modules/organization/components/view/organization-view-header.vue (0 hunks)
  • frontend/src/modules/organization/components/view/organization-view-members.vue (0 hunks)
  • frontend/src/modules/organization/organization-model.js (2 hunks)
  • frontend/src/modules/organization/pages/organization-form-page.vue (2 hunks)
  • frontend/src/modules/organization/pages/organization-view-page.vue (0 hunks)
  • frontend/src/modules/settings/pages/settings-page.vue (1 hunks)
  • frontend/src/modules/settings/settings-pricing-plans.js (0 hunks)
  • frontend/src/modules/settings/settings-store.js (1 hunks)
  • frontend/src/modules/tag/tag-destroy-store.js (2 hunks)
  • frontend/src/modules/tag/tag-form-store.js (2 hunks)
  • frontend/src/modules/tenant/store/actions.js (1 hunks)
  • frontend/src/modules/tenant/store/mutations.js (0 hunks)
  • frontend/src/modules/tenant/store/state.js (0 hunks)
  • frontend/src/modules/tenant/tenant-model.js (2 hunks)
  • frontend/src/modules/user/user-model.js (1 hunks)
  • frontend/src/security/plans-limits.ts (0 hunks)
  • frontend/src/security/plans.js (0 hunks)
  • frontend/src/shared/axios/auth-axios.js (0 hunks)
  • frontend/src/shared/error/errors.js (1 hunks)
  • frontend/src/shared/fields/array-field.js (1 hunks)
  • frontend/src/shared/fields/boolean-field.js (1 hunks)
  • frontend/src/shared/fields/date-field.js (2 hunks)
  • frontend/src/shared/fields/date-time-field.js (2 hunks)
  • frontend/src/shared/fields/integer-field.js (2 hunks)
  • frontend/src/shared/fields/integer-range-field.js (1 hunks)
  • frontend/src/shared/fields/relation-to-many-field.js (1 hunks)
  • frontend/src/shared/fields/relation-to-one-field.js (1 hunks)
  • frontend/src/shared/fields/string-array-field.js (1 hunks)
  • frontend/src/shared/fields/string-field.js (1 hunks)
  • frontend/src/shared/i18n/i18n.vue (0 hunks)
  • frontend/src/shared/message/message.js (1 hunks)
  • frontend/src/shared/modules/enrichment/components/enrichment-sneak-peak-content.vue (0 hunks)
  • frontend/src/shared/modules/enrichment/components/enrichment-sneak-peak.vue (0 hunks)
  • frontend/src/shared/modules/enrichment/constants/sneak-peak-popover.ts (0 hunks)
  • frontend/src/shared/modules/enrichment/types/SneakPeakPopover.ts (0 hunks)
  • frontend/src/shared/modules/filters/components/Filter.vue (1 hunks)
  • frontend/src/shared/modules/filters/components/FilterDropdown.vue (1 hunks)
  • frontend/src/shared/modules/filters/types/FilterConfig.ts (0 hunks)
  • frontend/src/shared/modules/monitoring/types/event.ts (0 hunks)
  • frontend/src/shared/modules/permissions/types/Permissions.ts (0 hunks)
  • frontend/src/shared/pagination/pagination-sorter.vue (2 hunks)
  • frontend/src/shared/shared-module.js (0 hunks)
  • frontend/src/shared/store/actions-messages.js (1 hunks)
  • frontend/src/shared/store/actions.js (9 hunks)
  • frontend/src/utils/featureFlag/index.js (0 hunks)
  • frontend/src/utils/logRocket/index.ts (1 hunks)
💤 Files with no reviewable changes (77)
  • frontend/src/modules/auth/types/Tenant.type.ts
  • frontend/src/security/plans.js
  • frontend/src/modules/tenant/store/mutations.js
  • frontend/src/modules/tenant/store/state.js
  • frontend/src/shared/modules/enrichment/components/enrichment-sneak-peak-content.vue
  • frontend/src/modules/automation/automation-module.js
  • frontend/src/modules/automation/pages/automation-page.vue
  • frontend/src/config.js
  • frontend/src/i18n/es.js
  • frontend/src/i18n/en.js
  • frontend/src/modules/automation/automation-routes.js
  • frontend/src/modules/automation/store/state.js
  • frontend/src/modules/automation/components/automation-dropdown.vue
  • frontend/src/modules/index.ts
  • frontend/src/shared/shared-module.js
  • frontend/src/security/plans-limits.ts
  • frontend/src/modules/automation/config/automation-types/shared/filter-options/new-activity-filter-options.vue
  • frontend/src/modules/notes/types/Note.ts
  • frontend/src/modules/organization/components/view/_aside/_aside-enriched.vue
  • frontend/src/i18n/pt-BR.js
  • frontend/src/modules/organization/components/form/identity/organization-form-identity-item.vue
  • frontend/src/modules/organization/pages/organization-view-page.vue
  • frontend/src/middleware/navigation/navigation-guard.ts
  • frontend/src/main.ts
  • frontend/src/shared/axios/auth-axios.js
  • frontend/src/modules/automation/store/index.js
  • frontend/src/modules/organization/components/organization-headline..vue
  • frontend/scripts/docker-entrypoint.sh
  • frontend/src/modules/automation/automation-store.js
  • frontend/src/shared/modules/enrichment/constants/sneak-peak-popover.ts
  • frontend/src/modules/notes/components/note-item.vue
  • frontend/package.json
  • frontend/src/modules/automation/components/automation-form.vue
  • frontend/src/shared/modules/filters/types/FilterConfig.ts
  • frontend/src/modules/organization/components/view/_aside/_aside-identities.vue
  • frontend/src/modules/automation/components/executions/automation-execution-list.vue
  • frontend/src/modules/organization/components/organization-manage-identities-drawer.vue
  • frontend/src/modules/automation/store/actions.js
  • frontend/src/shared/modules/enrichment/types/SneakPeakPopover.ts
  • frontend/src/modules/automation/config/automation-types/webhook/webhook-action.vue
  • frontend/src/modules/automation/config/automation-types/slack/config.ts
  • frontend/src/modules/automation/components/automation-toggle.vue
  • frontend/src/modules/automation/config/automation-types/index.ts
  • frontend/src/modules/organization/components/view/_aside/_aside-identities-extra.vue
  • frontend/src/modules/automation/config/automation-types/slack/slack-action.vue
  • frontend/src/config/permissions/admin.ts
  • frontend/src/modules/organization/components/form/email/organization-form-email-item.vue
  • frontend/src/shared/modules/enrichment/components/enrichment-sneak-peak.vue
  • frontend/src/modules/automation/config/automation-types/webhook/config.ts
  • frontend/src/modules/contributor/components/details/contributor-details-notes.vue
  • frontend/src/modules/member/components/member-dropdown-content.vue
  • frontend/src/modules/organization/components/view/organization-view-header.vue
  • frontend/src/modules/organization/components/view/organization-view-aside.vue
  • frontend/src/utils/featureFlag/index.js
  • frontend/src/modules/automation/components/executions/automation-execution.vue
  • frontend/src/modules/organization/components/organization-manage-domains-drawer.vue
  • frontend/src/modules/automation/automation-limit.js
  • frontend/src/shared/modules/permissions/types/Permissions.ts
  • frontend/src/modules/member/member-enrichment.js
  • frontend/src/modules/organization/components/organization-actions.vue
  • frontend/src/modules/settings/settings-pricing-plans.js
  • frontend/src/modules/automation/components/automation-executions.vue
  • frontend/src/modules/notes/components/note-editor.vue
  • frontend/src/modules/automation/automation-service.js
  • frontend/src/modules/automation/config/automation-types/shared/filter-options/new-member-filter-options.vue
  • frontend/src/config/permissions/projectAdmin.ts
  • frontend/src/shared/modules/monitoring/types/event.ts
  • frontend/src/modules/automation/components/list/automation-list-table.vue
  • frontend/src/modules/automation/config/automation-types/shared/trigger-member-activity.vue
  • frontend/src/modules/notes/components/note-dropdown.vue
  • frontend/src/shared/i18n/i18n.vue
  • frontend/src/modules/automation/components/automation-list.vue
  • frontend/src/modules/notes/note-service.js
  • frontend/src/modules/organization/components/view/organization-view-members.vue
  • frontend/src/config/permissions/readonly.ts
  • frontend/src/i18n/index.js
  • frontend/src/modules/organization/components/organization-manage-emails-drawer.vue
✅ Files skipped from review due to trivial changes (3)
  • frontend/src/config/integrations/stackoverflow/components/stackoverflow-settings-drawer.vue
  • frontend/src/config/integrations/devto/components/devto-connect-drawer.vue
  • frontend/src/config/integrations/hackernews/components/hackernews-settings-drawer.vue
🔇 Additional comments (31)
frontend/src/modules/contributor/pages/contributor-details.page.vue (2)

78-78: LGTM! Simplified conditional rendering.

The conditional rendering has been correctly simplified to a binary choice between overview and activities tabs.


146-146: LGTM! Simplified scroll control logic.

The scroll control logic has been appropriately updated to handle only the activities tab infinite scroll.

frontend/src/shared/store/actions.js (1)

Line range hint 121-137: LGTM: Well-implemented member profile success message

The special handling for member profile creation with a clickable "View profile" button is well implemented. The use of Vue's h function for rendering the button and the proper cleanup with Message.closeAll() shows good attention to detail.

frontend/src/config/integrations/twitter/components/twitter-settings-drawer.vue (1)

41-41: LGTM! Removal of i18n component aligns with frontend cleanup objectives.

frontend/src/config/integrations/linkedin/components/linkedin-settings-drawer.vue (1)

86-86: LGTM! Removal of i18n component aligns with frontend cleanup objectives.

frontend/src/config/integrations/gerrit/components/gerrit-settings-drawer.vue (1)

88-88: LGTM! Removal of i18n component aligns with frontend cleanup objectives.

frontend/src/config/integrations/reddit/components/reddit-settings-drawer.vue (1)

94-94: LGTM! Removal of i18n component aligns with frontend cleanup objectives.

frontend/src/modules/auth/auth.socket.ts (2)

Line range hint 26-45: Well-structured socket connection setup!

The connection setup follows best practices with:

  • Environment-specific path configuration
  • Proper cleanup of existing connections
  • Secure token-based authentication
  • WebSocket-only transport for better performance

Line range hint 1-264: Verify removal of enrichment functionality

The changes align with the PR objectives of frontend cleanup by removing enrichment-related socket handlers while maintaining core merge/unmerge functionality. However, let's verify that all enrichment-related code has been properly removed from the codebase.

✅ Verification successful

Socket handlers for enrichment successfully removed

The enrichment-related socket handlers have been successfully removed from auth.socket.ts while maintaining the core merge/unmerge functionality. The remaining enrichment features in the codebase are handled through different mechanisms and were not intended to be removed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to enrichment functionality
echo "Searching for remaining enrichment references..."
rg -i "enrichment" frontend/

Length of output: 26589

frontend/src/shared/modules/filters/components/FilterDropdown.vue (2)

Line range hint 1-134: Well-structured implementation that aligns with cleanup objectives.

The component maintains good separation of concerns, type safety, and clean code practices while successfully removing feature flag complexity. The changes are minimal yet effective in contributing to the broader frontend cleanup effort.


92-92: Verify the visibility of previously feature-flagged options.

The removal of feature flag filtering aligns well with the frontend cleanup objectives and simplifies the code. However, please verify that all options that are now visible should indeed be accessible to users, as they were previously controlled by feature flags.

Let's check for any configuration entries that might need alternative visibility control:

✅ Verification successful

The removal of feature flag filtering is safe and architecturally sound.

The filter system is designed to control visibility through configuration composition at a higher level, not within the FilterDropdown component itself. The change aligns with good architectural practices by moving feature control to the configuration layer where filter options are defined.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for feature flag usage in filter configurations
rg -l "feature|flag|enabled" frontend/src/shared/modules/filters/config

Length of output: 73


Script:

#!/bin/bash
# Find filter configuration files
fd -e ts -e js -e vue "filter" frontend/src/shared/modules

# Search for feature flag patterns in filter-related files
rg -A 5 "filterConfig|FilterConfig" frontend/src/shared/modules

Length of output: 96131

frontend/src/modules/member/member-export-limit.js (1)

15-15: LGTM! Verify dialog UI appearance

The removal of export limit information aligns with the frontend cleanup objectives.

Please verify that the export dialog UI appears clean without the highlighted info section and that no visual artifacts remain.

frontend/src/shared/fields/array-field.js (1)

14-14: LGTM! Verify message consistency

The hardcoded validation message aligns with the removal of i18n support.

Let's verify that similar validation messages are consistent across other field types:

✅ Verification successful

Validation messages are consistent across field types

The required field message "This field is required" is consistently used across all field types in the shared/fields directory.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for validation messages across field types
rg -g "frontend/src/shared/fields/*-field.js" "message: ['\"](.*?)['\"]"

Length of output: 888

frontend/src/modules/automation/components/index.js (1)

1-14: Clarify the addition of new automation code

According to the PR summary, automation-related functionality is being removed. However, this file adds new automation-related code. This seems contradictory to the cleanup objectives.

Let's check if this file should be removed instead:

frontend/src/modules/tenant/store/actions.js (1)

37-37: LGTM!

The hardcoded success message uses consistent "Community" terminology, aligning with the UI labels.

frontend/src/modules/settings/pages/settings-page.vue (1)

71-71: LGTM! Consider additional cleanup

The change to default tab is correct since 'automations' tab was removed. However, there might be unused styles or imports that could be cleaned up.

Let's verify if there are any unused imports or styles:

frontend/src/shared/fields/date-time-field.js (1)

69-69: Verify template variable handling in validation message

The message still contains the {path} template variable. Please verify that Yup's validation system correctly interpolates this variable, as we're no longer using i18n for string interpolation.

✅ Verification successful

Validation message format is correct

The {path} template variable is a built-in Yup feature for validation messages, not related to i18n. This is confirmed by its consistent usage across multiple field components in the codebase. The message format will work correctly with Yup's validation system.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other Yup validation messages to confirm the pattern
rg -g '*.{js,ts,vue}' --no-heading '{path}.*invalid'

# Search for Yup's test method usage to verify message format
ast-grep --pattern 'test($_, $_, $message, $_)' 

Length of output: 195


Script:

#!/bin/bash
# Search for validation messages with path variable (escaped)
rg -g '*.{js,ts,vue}' '\{path\}.*invalid'

# Search for Yup validation schema definitions
ast-grep --pattern 'Yup.string().test($$$)'

# Search for Yup validation error messages
ast-grep --pattern '.validate($$$).catch(err => $$$)'

# Look for Yup validation tests
fd test -e js -e ts -e jsx -e tsx --exec rg -l 'yup.*validation'

Length of output: 357


Script:

#!/bin/bash
# Search for Yup schema definitions in field components
rg -g '*field.js' 'Yup\.'

# Look for validation schema imports
rg -g '*.{js,ts,vue}' '^import.*yup'

# Search for validation schema definitions
ast-grep --pattern 'const $_ = Yup.$$$'

Length of output: 1061

frontend/src/app.vue (1)

22-22: Verify the impact of feature flag removal.

The removal of feature flags simplifies the codebase but might affect the ability to toggle features in different environments.

✅ Verification successful

Feature flag removal is isolated to this component

The feature flag system remains active and well-maintained across the codebase. The removal from app.vue appears to be a targeted cleanup of unused code rather than a systemic change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any remaining feature flag references
echo "Checking for remaining feature flag references..."
rg -i "feature.?flag|unleash" --type js --type vue

# Check for environment-specific configurations that might have relied on feature flags
echo "Checking environment configurations..."
fd -e env -e config -e json -E node_modules

Length of output: 8007


Script:

#!/bin/bash
# Search vue files properly
echo "Checking Vue files for feature flag usage..."
rg -t js -t jsx -t ts -t tsx -t vue "feature.?flag|unleash" 

# Check if feature-flags package is still referenced
echo "Checking feature-flags package dependencies..."
rg "feature-flags" $(fd package.json -E node_modules)

# Check config files for feature flag settings
echo "Checking config files for feature flag settings..."
rg "feature.?flag|unleash" $(fd -e json -e env -E node_modules)

Length of output: 13394

frontend/src/modules/activity/components/activity-dropdown.vue (1)

113-113: LGTM! Simplified message handling.

The hardcoded success message is clear and aligns with the PR's objective of removing i18n dependencies.

frontend/src/shared/fields/relation-to-many-field.js (1)

75-91: LGTM! Clear validation messages.

The hardcoded validation messages with template literals effectively maintain all necessary information while removing i18n dependencies:

  • Required field message is straightforward
  • Min/max validation messages clearly incorporate the field label and limits
frontend/src/modules/eagle-eye/pages/eagle-eye-onboard-page.vue (1)

90-90: LGTM! Clean implementation of feature copy.

The template literal usage with the new function is clean and maintains the intended functionality while removing feature flag dependencies.

frontend/src/shared/modules/filters/components/Filter.vue (1)

13-13: LGTM! Simplified developer mode check.

The condition for showing the "Copy JSON query" button has been simplified to rely solely on isDeveloperModeActive.

Let's verify that the developer mode functionality is still properly controlled:

✅ Verification successful

Developer mode implementation verified successfully

The simplified check is properly backed by a well-structured state management system in the Pinia store, with correct persistence handling via localStorage.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining feature flag checks for developer mode
# and verify the developer mode state management

# Check for any remaining feature flag checks
rg -l "developerMode.*FeatureFlag" 

# Check how developer mode is controlled now
rg -l "isDeveloperModeActive"

Length of output: 220


Script:

#!/bin/bash
# Check the state and actions implementation
echo "=== State Implementation ==="
cat frontend/src/modules/user/store/pinia/state.ts

echo -e "\n=== Actions Implementation ==="
cat frontend/src/modules/user/store/pinia/actions.ts

echo -e "\n=== Additional Developer Mode References ==="
rg "developerMode" -A 2 -B 2

Length of output: 1609

frontend/src/modules/organization/components/list/organization-list-toolbar.vue (1)

87-88: LGTM! Simplified export functionality.

Import statements have been reorganized and export limit functionality has been removed, simplifying the codebase.

Let's verify the export functionality is still properly handled:

Also applies to: 95-95

✅ Verification successful

Export functionality properly simplified and centralized

The export functionality has been successfully simplified and centralized in the shared Excel utility, with the removal of export limits and complex dialog handling. The changes improve code maintainability and reusability.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining export limit functionality
# and verify the export dialog implementation

# Check for any remaining export limit references
rg -l "exportLimit|tenantCsvExportCount|planExportCountMax"

# Check the current export dialog implementation
ast-grep --pattern 'showExportDialog($$$)'

Length of output: 1568


Script:

#!/bin/bash
# Search for export-related code and components
rg -l "export.*csv|\.csv|downloadCsv|exportData" frontend/

# Look for dialog components that might handle exports
fd -e vue -e ts -e js . frontend/ --exec grep -l "dialog.*export\|export.*dialog"

# Check for any export-related utilities or services
ast-grep --pattern 'export function $$$export$$$'

Length of output: 597


Script:

#!/bin/bash
# Examine the excel.js implementation
cat frontend/src/shared/excel/excel.js

# Look for any references to this excel utility
rg -l "excel" frontend/src/modules/

Length of output: 738

frontend/src/modules/member/components/list/member-list-toolbar.vue (3)

70-70: LGTM! Simplified text content.

Replaced i18n component with static string "Delete", aligning with the removal of internationalization.


91-94: LGTM! Reorganized imports.

Import statements have been reorganized and simplified by removing unused imports.

Also applies to: 98-98


231-231: LGTM! Simplified error handling.

Error handling has been simplified while maintaining the core functionality.

frontend/src/modules/organization/components/organization-dropdown-content.vue (1)

266-266: LGTM! Consistent with i18n removal pattern

The hardcoded success message is clear and follows the established pattern of removing i18n strings across the codebase.

frontend/src/modules/organization/pages/organization-form-page.vue (1)

446-446: LGTM! Consistent success messages

Using the same success message "Organization successfully saved" for both create and update operations provides a consistent user experience.

Also applies to: 490-490

frontend/src/modules/organization/components/list/organization-list-table.vue (1)

442-444: LGTM! Consistent removal of enrichment conditionals

The changes consistently simplify the enrichment-related tooltips across all columns by removing feature flag checks. This aligns with the PR's cleanup objectives and makes the code more maintainable.

Also applies to: 490-492, 538-540, 588-590, 637-639, 681-683

frontend/src/modules/member/components/list/member-list-table.vue (2)

508-508: LGTM! Simplified reach tooltip

The tooltip for reach information has been simplified by removing feature flag checks while maintaining clear source attribution.


Line range hint 580-587: LGTM! Consistent content display patterns

The changes maintain a consistent pattern across Seniority Level, Programming Languages, and Skills sections:

  • Clean content display without feature flag checks
  • Consistent styling for tags and text
  • Proper fallback to "-" when no data is available

Also applies to: 636-643, 697-704

nonEmpty: true,
nonEmptyValues: true,
requiredUnless: 'email',
customFilterPreview: (record) => record,
}),
attributes: new JsonField(
'attributes',
label('attributes'),
'attributes',
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve label clarity and consistency

Several labels need improvement:

  1. 'attributes' is not user-friendly
  2. Inconsistent capitalization ('Identities' vs 'attributes')
  3. 'Custom Attributes' could be more specific
-    'attributes',
+    'Attributes',  // Make user-friendly and consistent with other labels
-    'Identities',
+    'Identities',  // Correct
-  info: new JsonField('info', 'Custom Attributes'),
+  info: new JsonField('info', 'Member Custom Attributes'),

Also applies to: 28-28, 38-38

import { router } from '@/router';
import Message from '@/shared/message/message';
import { AuthService } from '@/modules/auth/services/auth.service';

const DEFAULT_ERROR_MESSAGE = i18n('errors.defaultErrorMessage');
const DEFAULT_ERROR_MESSAGE = 'Ops, an error occurred';
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix typo in default error message.

The word "Ops" should be "Oops" in the default error message.

-const DEFAULT_ERROR_MESSAGE = 'Ops, an error occurred';
+const DEFAULT_ERROR_MESSAGE = 'Oops, an error occurred';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const DEFAULT_ERROR_MESSAGE = 'Ops, an error occurred';
const DEFAULT_ERROR_MESSAGE = 'Oops, an error occurred';

@@ -58,7 +50,7 @@ export default {
Errors.handle(error);
}

Message.error(i18n('entities.member.attributes.error'));
Message.error('Custom Attributes could not be created');
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Maintain consistent error message structure across actions.

Error and success messages should follow a consistent structure. Consider using a message template system for consistency.

+ const MESSAGE_TEMPLATES = {
+   ERROR: (action) => `${action} could not be completed`,
+   SUCCESS: (action) => `${action} completed successfully`
+ };

- Message.error('Custom Attributes could not be created');
+ Message.error(MESSAGE_TEMPLATES.ERROR('Custom Attributes creation'));

- Message.success('Profiles merged successfully');
+ Message.success(MESSAGE_TEMPLATES.SUCCESS('Profile merge'));

Also applies to: 62-62

@@ -178,7 +177,7 @@ const deleteOrganization = (organization: any) => {
OrganizationService.destroyAll([organization.id], organization.segments)
.then(() => {
Message.closeAll();
Message.success(i18n('entities.organization.destroy.success'));
Message.success('Organization successfully deleted');
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add loading state during organization deletion.

The deletion process should show a loading state to prevent multiple deletion attempts and provide better user feedback.

+ const isDeleting = ref(false);

  const deleteOrganization = (organization: any) => {
+   if (isDeleting.value) return;
    ConfirmDialog({
      // ... dialog config
    }).then(() => {
+     isDeleting.value = true;
      Message.info(null, {
        title: 'Organization is being deleted',
      });
      OrganizationService.destroyAll([organization.id], organization.segments)
        .then(() => {
          Message.closeAll();
          Message.success('Organization successfully deleted');
          emit('reload');
        })
        .catch(() => {
          Message.closeAll();
          Message.error('Something went wrong');
        })
+       .finally(() => {
+         isDeleting.value = false;
+       });
    });
  };

Committable suggestion skipped: line range outside the PR's diff.

@gaspergrom gaspergrom merged commit 6f3fb1c into main Jan 10, 2025
7 checks passed
@gaspergrom gaspergrom deleted the improvement/cleanup-fe branch January 10, 2025 07:50
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