Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 77 additions & 8 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,22 @@ services:
- QUEUE_CONFIG=${QUEUE_CONFIG}
- QUEUE_REGION=cockroach
restart: unless-stopped
translate:
image: hardcoreeng/translate
extra_hosts:
- 'huly.local:host-gateway'
depends_on:
redpanda:
condition: service_started
account:
condition: service_started
environment:
- SECRET=secret
- ACCOUNTS_URL=http://huly.local:3000
- HULYLAKE_URL=http://huly.local:8096
- QUEUE_CONFIG=${QUEUE_CONFIG}
- QUEUE_REGION=cockroach
restart: unless-stopped
backup-cockroach:
image: hardcoreeng/backup
extra_hosts:
Expand Down
1 change: 1 addition & 0 deletions models/contact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/model-card": "^0.6.0",
"@hcengineering/model-preference": "^0.6.0",
"@hcengineering/notification": "^0.6.23",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/setting": "^0.6.17",
Expand Down
25 changes: 23 additions & 2 deletions models/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import {
type PersonSpace,
type SocialIdentity,
type Status,
type SocialIdentityProvider
type SocialIdentityProvider,
type Translation
} from '@hcengineering/contact'
import {
AccountRole,
Expand Down Expand Up @@ -90,6 +91,7 @@ import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type Action } from '@hcengineering/view'
import contact from './plugin'
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'
import preference, { TPreference } from '@hcengineering/model-preference'

export { contactId } from '@hcengineering/contact'
export { contactOperation } from './migration'
Expand Down Expand Up @@ -291,6 +293,14 @@ export class TUserRole extends TDoc implements UserRole {
role!: Ref<Role>
}

@Model(contact.class.Translation, preference.class.Preference)
export class TTranslation extends TPreference implements Translation {
declare attachedTo: Ref<Employee>
enabled!: boolean
translateTo?: string
dontTranslate!: string[]
}

export function createModel (builder: Builder): void {
builder.createModel(
TAvatarProvider,
Expand All @@ -306,7 +316,8 @@ export function createModel (builder: Builder): void {
TMember,
TContactsTab,
TPersonSpace,
TUserRole
TUserRole,
TTranslation
)

builder.mixin(contact.class.PersonSpace, core.class.Class, core.mixin.TxAccessLevel, {
Expand Down Expand Up @@ -1405,4 +1416,14 @@ export function createModel (builder: Builder): void {
isCustom: true,
readonly: true
})

builder.createDoc(setting.class.SettingsCategory, core.space.Model, {
name: 'translation',
label: contact.string.AutoTranslation,
icon: view.icon.Translate,
component: contact.component.TranslationSettings,
group: 'settings-account',
role: AccountRole.Guest,
order: 1600
})
}
3 changes: 2 additions & 1 deletion models/contact/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export default mergeIds(contactId, contact, {
EmployeeFilter: '' as AnyComponent,
EmployeeFilterValuePresenter: '' as AnyComponent,
ChannelIcon: '' as AnyComponent,
PersonPreviewPresenter: '' as AnyComponent
PersonPreviewPresenter: '' as AnyComponent,
TranslationSettings: '' as AnyComponent
},
string: {
SearchEmployee: '' as IntlString,
Expand Down
Loading
Loading