mirror of
https://github.com/hexastack/hexabot
synced 2024-11-24 04:53:41 +00:00
fix: minor changes
This commit is contained in:
parent
628d0f5819
commit
7d3a92e1d6
@ -73,7 +73,7 @@ describe('TranslationService', () => {
|
||||
find: jest.fn().mockResolvedValue([
|
||||
{
|
||||
translatable: false,
|
||||
global_fallback: 'global_fallback',
|
||||
label: 'global_fallback',
|
||||
fallback_message: ['Global fallback message'],
|
||||
},
|
||||
]),
|
||||
@ -175,7 +175,6 @@ describe('TranslationService', () => {
|
||||
fallback_message: ['Global fallback message'],
|
||||
},
|
||||
} as Settings);
|
||||
|
||||
const strings = await service.getSettingStrings();
|
||||
expect(strings).toEqual([]);
|
||||
});
|
||||
|
@ -140,8 +140,9 @@ export class TranslationService extends BaseService<Translation> {
|
||||
return Object.values(settings)
|
||||
.map((group: Record<string, string | string[]>) => Object.entries(group))
|
||||
.flat()
|
||||
.filter(([l]) => {
|
||||
return translatableSettings.find(({ label }) => label === l);
|
||||
.filter(([l, value]) => {
|
||||
const found = translatableSettings.find(({ label }) => label === l);
|
||||
return found && !!value;
|
||||
})
|
||||
.map(([, v]) => v)
|
||||
.flat();
|
||||
|
8
api/src/utils/test/fixtures/setting.ts
vendored
8
api/src/utils/test/fixtures/setting.ts
vendored
@ -20,14 +20,6 @@ export const settingFixtures: SettingCreateDto[] = [
|
||||
type: SettingType.text,
|
||||
weight: 1,
|
||||
},
|
||||
{
|
||||
group: 'contact',
|
||||
label: 'greeting',
|
||||
value: 'hello',
|
||||
type: SettingType.text,
|
||||
weight: 10,
|
||||
translatable: true,
|
||||
},
|
||||
{
|
||||
group: 'contact',
|
||||
label: 'company_name',
|
||||
|
Loading…
Reference in New Issue
Block a user