mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00:00
UBERF-5337 (#4548)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
2d9eb8ec32
commit
169a83cd08
@ -21,7 +21,7 @@ import { boardId } from '@hcengineering/board'
|
|||||||
import calendar, { calendarId } from '@hcengineering/calendar'
|
import calendar, { calendarId } from '@hcengineering/calendar'
|
||||||
import { chunterId } from '@hcengineering/chunter'
|
import { chunterId } from '@hcengineering/chunter'
|
||||||
import client, { clientId } from '@hcengineering/client'
|
import client, { clientId } from '@hcengineering/client'
|
||||||
import { contactId } from '@hcengineering/contact'
|
import contactPlugin, { contactId } from '@hcengineering/contact'
|
||||||
import gmail, { gmailId } from '@hcengineering/gmail'
|
import gmail, { gmailId } from '@hcengineering/gmail'
|
||||||
import { hrId } from '@hcengineering/hr'
|
import { hrId } from '@hcengineering/hr'
|
||||||
import { imageCropperId } from '@hcengineering/image-cropper'
|
import { imageCropperId } from '@hcengineering/image-cropper'
|
||||||
@ -92,6 +92,7 @@ interface Config {
|
|||||||
TITLE?: string
|
TITLE?: string
|
||||||
LANGUAGES?: string
|
LANGUAGES?: string
|
||||||
DEFAULT_LANGUAGE?: string
|
DEFAULT_LANGUAGE?: string
|
||||||
|
LAST_NAME_FIRST?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const devConfig = process.env.CLIENT_TYPE === 'dev-production'
|
const devConfig = process.env.CLIENT_TYPE === 'dev-production'
|
||||||
@ -157,6 +158,7 @@ export async function configurePlatform() {
|
|||||||
|
|
||||||
setMetadata(uiPlugin.metadata.SearchPopup, view.component.ActionsPopup)
|
setMetadata(uiPlugin.metadata.SearchPopup, view.component.ActionsPopup)
|
||||||
|
|
||||||
|
setMetadata(contactPlugin.metadata.LastNameFirst, config.LAST_NAME_FIRST === 'true' ?? false)
|
||||||
const languages = config.LANGUAGES ? (config.LANGUAGES as string).split(',').map((l) => l.trim()) : ['en', 'ru']
|
const languages = config.LANGUAGES ? (config.LANGUAGES as string).split(',').map((l) => l.trim()) : ['en', 'ru']
|
||||||
|
|
||||||
setMetadata(uiPlugin.metadata.Languages, languages)
|
setMetadata(uiPlugin.metadata.Languages, languages)
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import { Account, AttachedDoc, Class, Doc, Ref, Space, Timestamp, UXObject } from '@hcengineering/core'
|
import { Account, AttachedDoc, Class, Doc, Ref, Space, Timestamp, UXObject } from '@hcengineering/core'
|
||||||
import type { Asset, Plugin, Resource } from '@hcengineering/platform'
|
import type { Asset, Metadata, Plugin, Resource } from '@hcengineering/platform'
|
||||||
import { IntlString, plugin } from '@hcengineering/platform'
|
import { IntlString, plugin } from '@hcengineering/platform'
|
||||||
import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates'
|
import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates'
|
||||||
import type { AnyComponent, IconSize, ResolvedLocation } from '@hcengineering/ui'
|
import type { AnyComponent, IconSize, ResolvedLocation } from '@hcengineering/ui'
|
||||||
@ -254,6 +254,9 @@ export const contactPlugin = plugin(contactId, {
|
|||||||
app: {
|
app: {
|
||||||
Contacts: '' as Ref<Doc>
|
Contacts: '' as Ref<Doc>
|
||||||
},
|
},
|
||||||
|
metadata: {
|
||||||
|
LastNameFirst: '' as Metadata<boolean>
|
||||||
|
},
|
||||||
string: {
|
string: {
|
||||||
PersonAlreadyExists: '' as IntlString,
|
PersonAlreadyExists: '' as IntlString,
|
||||||
Person: '' as IntlString,
|
Person: '' as IntlString,
|
||||||
|
@ -18,6 +18,7 @@ import { IconSize, ColorDefinition } from '@hcengineering/ui'
|
|||||||
import { MD5 } from 'crypto-js'
|
import { MD5 } from 'crypto-js'
|
||||||
import { Channel, Contact, contactPlugin, Person } from '.'
|
import { Channel, Contact, contactPlugin, Person } from '.'
|
||||||
import { AVATAR_COLORS, GravatarPlaceholderType } from './types'
|
import { AVATAR_COLORS, GravatarPlaceholderType } from './types'
|
||||||
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
@ -220,7 +221,9 @@ export function getLastName (name: string): string {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export function formatName (name: string): string {
|
export function formatName (name: string): string {
|
||||||
return getLastName(name) + ' ' + getFirstName(name)
|
return getMetadata(contactPlugin.metadata.LastNameFirst) === true
|
||||||
|
? getLastName(name) + ' ' + getFirstName(name)
|
||||||
|
: getFirstName(name) + ' ' + getLastName(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +21,7 @@ import serverToken from '@hcengineering/server-token'
|
|||||||
import { serverFactories } from '@hcengineering/server-ws'
|
import { serverFactories } from '@hcengineering/server-ws'
|
||||||
import { start } from '.'
|
import { start } from '.'
|
||||||
import serverNotification from '@hcengineering/server-notification'
|
import serverNotification from '@hcengineering/server-notification'
|
||||||
|
import contactPlugin from '@hcengineering/contact'
|
||||||
|
|
||||||
const serverPort = parseInt(process.env.SERVER_PORT ?? '3333')
|
const serverPort = parseInt(process.env.SERVER_PORT ?? '3333')
|
||||||
|
|
||||||
@ -91,10 +92,12 @@ if (accountsUrl === undefined) {
|
|||||||
const sesUrl = process.env.SES_URL
|
const sesUrl = process.env.SES_URL
|
||||||
const cursorMaxTime = process.env.SERVER_CURSOR_MAXTIMEMS
|
const cursorMaxTime = process.env.SERVER_CURSOR_MAXTIMEMS
|
||||||
|
|
||||||
|
const lastNameFirst = process.env.LAST_NAME_FIRST === 'true' ?? false
|
||||||
setMetadata(serverCore.metadata.CursorMaxTimeMS, cursorMaxTime)
|
setMetadata(serverCore.metadata.CursorMaxTimeMS, cursorMaxTime)
|
||||||
setMetadata(serverCore.metadata.FrontUrl, frontUrl)
|
setMetadata(serverCore.metadata.FrontUrl, frontUrl)
|
||||||
setMetadata(serverToken.metadata.Secret, serverSecret)
|
setMetadata(serverToken.metadata.Secret, serverSecret)
|
||||||
setMetadata(serverNotification.metadata.SesUrl, sesUrl ?? '')
|
setMetadata(serverNotification.metadata.SesUrl, sesUrl ?? '')
|
||||||
|
setMetadata(contactPlugin.metadata.LastNameFirst, lastNameFirst)
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -151,6 +151,7 @@ export function start (
|
|||||||
title?: string
|
title?: string
|
||||||
languages: string
|
languages: string
|
||||||
defaultLanguage: string
|
defaultLanguage: string
|
||||||
|
lastNameFirst?: string
|
||||||
},
|
},
|
||||||
port: number,
|
port: number,
|
||||||
extraConfig?: Record<string, string>
|
extraConfig?: Record<string, string>
|
||||||
@ -194,6 +195,7 @@ export function start (
|
|||||||
TITLE: config.title,
|
TITLE: config.title,
|
||||||
LANGUAGES: config.languages,
|
LANGUAGES: config.languages,
|
||||||
DEFAULT_LANGUAGE: config.defaultLanguage,
|
DEFAULT_LANGUAGE: config.defaultLanguage,
|
||||||
|
LAST_NAME_FIRST: config.lastNameFirst,
|
||||||
...(extraConfig ?? {})
|
...(extraConfig ?? {})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -116,6 +116,8 @@ export function startFront (extraConfig?: Record<string, string>): void {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const lastNameFirst = process.env.LAST_NAME_FIRST
|
||||||
|
|
||||||
const title = process.env.TITLE
|
const title = process.env.TITLE
|
||||||
|
|
||||||
setMetadata(serverToken.metadata.Secret, serverSecret)
|
setMetadata(serverToken.metadata.Secret, serverSecret)
|
||||||
@ -128,6 +130,7 @@ export function startFront (extraConfig?: Record<string, string>): void {
|
|||||||
uploadUrl,
|
uploadUrl,
|
||||||
modelVersion,
|
modelVersion,
|
||||||
gmailUrl,
|
gmailUrl,
|
||||||
|
lastNameFirst,
|
||||||
telegramUrl,
|
telegramUrl,
|
||||||
rekoniUrl,
|
rekoniUrl,
|
||||||
calendarUrl,
|
calendarUrl,
|
||||||
|
@ -76,6 +76,7 @@ services:
|
|||||||
- MINIO_ENDPOINT=minio
|
- MINIO_ENDPOINT=minio
|
||||||
- MINIO_ACCESS_KEY=minioadmin
|
- MINIO_ACCESS_KEY=minioadmin
|
||||||
- MINIO_SECRET_KEY=minioadmin
|
- MINIO_SECRET_KEY=minioadmin
|
||||||
|
- LAST_NAME_FIRST=true
|
||||||
transactor:
|
transactor:
|
||||||
image: hardcoreeng/transactor
|
image: hardcoreeng/transactor
|
||||||
pull_policy: never
|
pull_policy: never
|
||||||
@ -100,6 +101,7 @@ services:
|
|||||||
- REKONI_URL=http://rekoni:4005
|
- REKONI_URL=http://rekoni:4005
|
||||||
- FRONT_URL=http://localhost:8083
|
- FRONT_URL=http://localhost:8083
|
||||||
- ACCOUNTS_URL=http://account:3003
|
- ACCOUNTS_URL=http://account:3003
|
||||||
|
- LAST_NAME_FIRST=true
|
||||||
collaborator:
|
collaborator:
|
||||||
image: hardcoreeng/collaborator
|
image: hardcoreeng/collaborator
|
||||||
links:
|
links:
|
||||||
|
Loading…
Reference in New Issue
Block a user