Skip to content

fix: plugin setting [DO_NOT_MERGE_MIGHT_BREAK_HEXABOT_PROJECTS] #865

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abdou6666
Copy link
Contributor

@abdou6666 abdou6666 commented Mar 27, 2025

Motivation

This PR help us to enforce that the developer sets translatable field in the plugin/channel settings whenever the type of the setting is text or multiple_text
fixes #863

(code can improve when we plan to merge this PR)

Fixes # (issue)

Type of change:

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@abdou6666 abdou6666 self-assigned this Mar 27, 2025
@abdou6666 abdou6666 changed the title fix: plugin setting fix: plugin setting [DO_NOT_MERGE_MIGHT_BREAK_HEXABOT_PROJECTS] Mar 27, 2025
@marrouchi
Copy link
Contributor

@coderabbitai Open a Github followup issue to address the translatable flag differently in any extension setting. A rule would be : If the setting type is either text or multiple text and the "translatable" attribute is not defined, then we assume that it is translatable. Otherwise, check on the boolean value of the attribute. This change has to be made in the translation service when traversing all blocks to generate new translations.

Copy link

coderabbitai bot commented Apr 7, 2025

Tip

For best results, initiate chat on the files or code changes.

Unable to process this comment: maximum number of iterations reached.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Let's explore the repository structure to understand what we're working with
find . -type f -name "*.ts" -o -name "*.js" | grep -i transl | sort

Length of output: 677


🏁 Script executed:

#!/bin/bash
# Let's examine the translation service to understand how it currently works
cat ./api/src/i18n/services/translation.service.ts

Length of output: 5452


🏁 Script executed:

#!/bin/bash
# Check the plugin service referenced in the translation service
cat ./api/src/plugins/plugins.service.ts

Length of output: 3885


🏁 Script executed:

#!/bin/bash
# Check the base plugin service which would contain setting definitions
cat ./api/src/plugins/base-plugin.service.ts

Length of output: 1177


🏁 Script executed:

#!/bin/bash
# Check the Extension class which BasePlugin extends from
cat ./api/src/utils/generics/extension.ts

Length of output: 1750


🏁 Script executed:

#!/bin/bash
# Look for plugin settings structure
find . -type f -name "*.ts" | xargs grep -l "Setting" | head -20

Length of output: 965


🏁 Script executed:

#!/bin/bash
# Let's examine a settings file to understand the structure
cat ./api/src/extensions/channels/console/settings.ts

# Also let's check for type definitions of settings
find ./api/src/setting -type f -name "*.ts" | xargs grep -l "interface\|type" | head -10

Length of output: 3628


🏁 Script executed:

#!/bin/bash
# Let's examine the setting types to understand text and multiple_text types
cat ./api/src/setting/schemas/types.ts

# Also look at the setting schema
cat ./api/src/setting/schemas/setting.schema.ts

# Let's also look at PR #865 changes to understand what changed
git diff --name-only origin/main

Length of output: 12436


🏁 Script executed:

#!/bin/bash
# Let's look at the PR changes in more detail to understand what was modified
git show --name-only

# Let's examine what changes were made specifically related to translatable settings
git diff origin/main -- ./api/src/setting

Length of output: 56015


🏁 Script executed:

#!/bin/bash
# Let's find additional information about the PR and issue #863
git show --name-only | head -20
gh issue view 863 --json title,body,state,url

Length of output: 1063


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.

🐛 [BUG] - Make translatable plugin settings
2 participants