From 230e1ec418c1e8594e83f82ba931d292208dec45 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Wed, 30 Apr 2025 22:52:39 +0700 Subject: [PATCH] UBERF-10441: Fix configure and board item displayed (#8789) Signed-off-by: Andrey Sobolev --- dev/docker-compose.yaml | 3 --- dev/local-mongo/docker-compose.yaml | 17 ++++++++--------- dev/tool/src/__start.ts | 11 ++++------- models/all/src/build.ts | 4 +--- models/all/src/index.ts | 12 ++++++------ models/all/src/show.ts | 4 +--- packages/core/src/classes.ts | 4 +++- .../src/components/Configure.svelte | 2 +- pods/workspace/src/__start.ts | 5 +---- qms-tests/docker-compose.yaml | 2 -- tests/docker-compose.yaml | 2 -- ws-tests/docker-compose.yaml | 3 --- 12 files changed, 25 insertions(+), 44 deletions(-) diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 6b699547e5..da7ed9fbac 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -158,7 +158,6 @@ services: - MAIL_URL= - STORAGE_CONFIG=${STORAGE_CONFIG} - FRONT_URL=http://huly.local:8087 - - MODEL_ENABLED=* - LAST_NAME_FIRST=true # - WS_LIVENESS_DAYS=1 - ACCOUNTS_URL=http://huly.local:3000 @@ -193,7 +192,6 @@ services: - STATS_URL=http://huly.local:4900 - MAIL_URL= - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - REGION= - ACCOUNTS_URL=http://huly.local:3000 - BRANDING_PATH=/var/cfg/branding.json @@ -219,7 +217,6 @@ services: - DB_URL=${DB_CR_URL} - STATS_URL=http://huly.local:4900 - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - ACCOUNTS_URL=http://huly.local:3000 - BRANDING_PATH=/var/cfg/branding.json - BACKUP_STORAGE=${BACKUP_STORAGE_CONFIG} diff --git a/dev/local-mongo/docker-compose.yaml b/dev/local-mongo/docker-compose.yaml index 81b1caf323..ba43b35551 100644 --- a/dev/local-mongo/docker-compose.yaml +++ b/dev/local-mongo/docker-compose.yaml @@ -23,7 +23,7 @@ services: - discovery.type=single-node - ES_JAVA_OPTS=-Xms1024m -Xmx1024m - http.cors.enabled=true - - http.cors.allow-origin=http://localhost:8082 + - http.cors.allow-origin=http://localhost:8082 healthcheck: interval: 20s retries: 10 @@ -46,12 +46,11 @@ services: - STORAGE_CONFIG=${STORAGE_CONFIG} - FRONT_URL=http://localhost:8087 - RESERVED_DB_NAMES=telegram,gmail,github - - MODEL_ENABLED=* - LAST_NAME_FIRST=true - ACCOUNTS_URL=http://localhost:3000 - BRANDING_PATH=/var/cfg/branding.json - INIT_SCRIPT_URL=https://raw.githubusercontent.com/hcengineering/init/main/script.yaml - - INIT_WORKSPACE=onboarding + - INIT_WORKSPACE=onboarding restart: unless-stopped collaborator: image: hardcoreeng/collaborator @@ -86,7 +85,7 @@ services: - MONGO_URL=mongodb://huly.local:27017?compressors=snappy - 'MONGO_OPTIONS={"appName":"front","maxPoolSize":1}' - ACCOUNTS_URL=http://localhost:3000 - - UPLOAD_URL=/files + - UPLOAD_URL=/files - GMAIL_URL=http://localhost:8088 - CALENDAR_URL=http://localhost:8095 - TELEGRAM_URL=http://localhost:8086 @@ -100,7 +99,7 @@ services: - DESKTOP_UPDATES_URL=https://dist.huly.io - DESKTOP_UPDATES_CHANNEL=dev - BRANDING_URL=http://localhost:8087/branding.json - restart: unless-stopped + restart: unless-stopped transactor: image: hardcoreeng/transactor links: @@ -112,11 +111,11 @@ services: ports: - 3333:3333 volumes: - - ../branding.json:/var/cfg/branding.json + - ../branding.json:/var/cfg/branding.json environment: # - SERVER_PROVIDER=uweb # - UWS_HTTP_MAX_HEADERS_SIZE="32768" - - UV_THREADPOOL_SIZE=10 + - UV_THREADPOOL_SIZE=10 - SERVER_PORT=3333 - SERVER_SECRET=secret - ENABLE_COMPRESSION=true @@ -133,7 +132,7 @@ services: - ACCOUNTS_URL=http://account:3000 - LAST_NAME_FIRST=true - ELASTIC_INDEX_NAME=local_storage_index - - BRANDING_PATH=/var/cfg/branding.json + - BRANDING_PATH=/var/cfg/branding.json restart: unless-stopped rekoni: image: hardcoreeng/rekoni-service @@ -175,7 +174,7 @@ services: - ACCOUNTS_URL=http://account:3000 - MINIO_SECRET_KEY=minioadmin - CERTIFICATE_PATH=/var/cfg/certificate.p12 - - SERVICE_ID=sign-service + - SERVICE_ID=sign-service - BRANDING_PATH=/var/cfg/branding.json deploy: resources: diff --git a/dev/tool/src/__start.ts b/dev/tool/src/__start.ts index b1d6e027b4..ef9e25bb72 100644 --- a/dev/tool/src/__start.ts +++ b/dev/tool/src/__start.ts @@ -22,14 +22,15 @@ import { devTool } from '.' import { addLocation } from '@hcengineering/platform' import { serverActivityId } from '@hcengineering/server-activity' +import { serverAiBotId } from '@hcengineering/server-ai-bot' import { serverAttachmentId } from '@hcengineering/server-attachment' -import { serverCardId } from '@hcengineering/server-card' import { serverCalendarId } from '@hcengineering/server-calendar' +import { serverCardId } from '@hcengineering/server-card' import { serverChunterId } from '@hcengineering/server-chunter' import { serverCollaborationId } from '@hcengineering/server-collaboration' import { serverContactId } from '@hcengineering/server-contact' -import { serverDriveId } from '@hcengineering/server-drive' import { serverDocumentId } from '@hcengineering/server-document' +import { serverDriveId } from '@hcengineering/server-drive' import { serverGmailId } from '@hcengineering/server-gmail' import { serverGuestId } from '@hcengineering/server-guest' import { serverHrId } from '@hcengineering/server-hr' @@ -45,7 +46,6 @@ import { serverTelegramId } from '@hcengineering/server-telegram' import { serverTimeId } from '@hcengineering/server-time' import { serverTrackerId } from '@hcengineering/server-tracker' import { serverViewId } from '@hcengineering/server-view' -import { serverAiBotId } from '@hcengineering/server-ai-bot' addLocation(serverActivityId, () => import('@hcengineering/server-activity-resources')) addLocation(serverAttachmentId, () => import('@hcengineering/server-attachment-resources')) @@ -79,10 +79,7 @@ function prepareTools (): { version: Data migrateOperations: [string, MigrateOperation][] } { - const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim()) - const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim()) - - return { ...prepareToolsRaw(builder(enabled, disabled).getTxes()), version: getModelVersion(), migrateOperations } + return { ...prepareToolsRaw(builder().getTxes()), version: getModelVersion(), migrateOperations } } export function getMongoDBUrl (): string { diff --git a/models/all/src/build.ts b/models/all/src/build.ts index a4e5b47a38..42ab7b98b1 100644 --- a/models/all/src/build.ts +++ b/models/all/src/build.ts @@ -1,7 +1,5 @@ import { writeFileSync } from 'fs' import builder from './' -const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim()) -const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim()) -const model = JSON.stringify(builder(enabled, disabled).getTxes()) +const model = JSON.stringify(builder().getTxes()) writeFileSync(process.argv[2], model) diff --git a/models/all/src/index.ts b/models/all/src/index.ts index bb6c7f13e6..09e9f274b4 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -143,7 +143,7 @@ export type { MigrateOperation } from '@hcengineering/model' * @param disabled - a set of disabled plugins * @returns */ -export default function buildModel (enabled: string[] = ['*'], disabled: string[] = []): Builder { +export default function buildModel (): Builder { const builder = new Builder() const defaultFilter = [ @@ -323,10 +323,11 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ boardModel, boardId, { - label: undefined, // board.string.ConfigLabel, + label: board.string.ConfigLabel, description: board.string.ConfigDescription, enabled: false, beta: true, + hidden: true, icon: board.icon.Board, classFilter: defaultFilter } @@ -335,10 +336,11 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ bitrixModel, bitrixId, { - label: undefined, // bitrix.string.ConfigLabel, + label: bitrix.string.ConfigLabel, description: bitrix.string.ConfigDescription, enabled: false, beta: true, + hidden: true, icon: bitrix.icon.Bitrix, classFilter: defaultFilter } @@ -505,9 +507,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ pluginId: id, transactions: txes.map((it) => it._id), ...config, - enabled: - config?.label === undefined || - ((config?.enabled ?? true) && (enabled.includes(id) || enabled.includes('*')) && !disabled.includes(id)), + enabled: config?.label === undefined || ((config?.enabled ?? true) && !(config.hidden ?? false)), beta: config?.beta ?? false }, ('plugin-configuration-' + id) as Ref diff --git a/models/all/src/show.ts b/models/all/src/show.ts index 0198730ed2..a5e73f92d1 100644 --- a/models/all/src/show.ts +++ b/models/all/src/show.ts @@ -1,6 +1,4 @@ import builder from './' -const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim()) -const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim()) -const model = JSON.stringify(builder(enabled, disabled).getTxes()) +const model = JSON.stringify(builder().getTxes()) console.log(model) diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index 0ca4e2ccfe..8638c76345 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -268,12 +268,14 @@ export interface PluginConfiguration extends Doc { pluginId: Plugin transactions: Ref[] - // If not set will not be shown in configuration UI label?: IntlString icon?: Asset description?: IntlString enabled: boolean + // If set will not be shown in configuration UI or enabled + hidden?: boolean + // If specified, will show beta/testing label in UI. beta: boolean diff --git a/plugins/setting-resources/src/components/Configure.svelte b/plugins/setting-resources/src/components/Configure.svelte index c385517aa5..90a485b848 100644 --- a/plugins/setting-resources/src/components/Configure.svelte +++ b/plugins/setting-resources/src/components/Configure.svelte @@ -35,7 +35,7 @@
{#each $pluginConfigurationStore.list as config} - {#if config.label} + {#if config.label && !(config.hidden ?? false)}
diff --git a/pods/workspace/src/__start.ts b/pods/workspace/src/__start.ts index 52e87fa9ca..f111a036d1 100644 --- a/pods/workspace/src/__start.ts +++ b/pods/workspace/src/__start.ts @@ -10,10 +10,7 @@ import { initStatisticsContext, loadBrandingMap } from '@hcengineering/server-co import { serveWorkspaceAccount } from '@hcengineering/workspace-service' import { join } from 'path' -const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim()) -const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim()) - -const txes = JSON.parse(JSON.stringify(builder(enabled, disabled).getTxes())) as Tx[] +const txes = JSON.parse(JSON.stringify(builder().getTxes())) as Tx[] configureAnalytics(process.env.SENTRY_DSN, {}) Analytics.setTag('application', 'workspace') diff --git a/qms-tests/docker-compose.yaml b/qms-tests/docker-compose.yaml index 2dff7d730f..882fc6950d 100644 --- a/qms-tests/docker-compose.yaml +++ b/qms-tests/docker-compose.yaml @@ -107,7 +107,6 @@ services: - DB_URL=mongodb://mongodb:27018 - TRANSACTOR_URL=ws://transactor:3334;ws://huly.local:3334 - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - BRANDING_PATH=/var/cfg/branding-test.json workspace: image: hardcoreeng/workspace @@ -125,7 +124,6 @@ services: - MONGO_URL=mongodb://mongodb:27018 - TRANSACTOR_URL=ws://transactor:3334;ws://huly.local:3334 - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - ACCOUNTS_URL=http://account:3003 - BRANDING_PATH=/var/cfg/branding.json restart: unless-stopped diff --git a/tests/docker-compose.yaml b/tests/docker-compose.yaml index 6a2214ede1..7ac034790a 100644 --- a/tests/docker-compose.yaml +++ b/tests/docker-compose.yaml @@ -124,7 +124,6 @@ services: - REGION_INFO=|America - TRANSACTOR_URL=ws://transactor:3334;ws://localhost:3334 - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - BRANDING_PATH=/var/cfg/branding.json - STATS_URL=http://stats:4901 workspace: @@ -142,7 +141,6 @@ services: - TRANSACTOR_URL=ws://transactor:3334;ws://localhost:3334 - QUEUE_CONFIG=${QUEUE_CONFIG} - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - REGION= - ACCOUNTS_URL=http://account:3003 - BRANDING_PATH=/var/cfg/branding.json diff --git a/ws-tests/docker-compose.yaml b/ws-tests/docker-compose.yaml index 067486a57b..936c22ccc8 100644 --- a/ws-tests/docker-compose.yaml +++ b/ws-tests/docker-compose.yaml @@ -143,7 +143,6 @@ services: - TRANSACTOR_URL=ws://huly.local:3334;ws://huly.local:3334,ws://huly.local:3335;ws://huly.local:3335;europe - STORAGE_CONFIG=${STORAGE_CONFIG} - FRONT_URL=http://huly.local:8083 - - MODEL_ENABLED=* # - LAST_NAME_FIRST=true # - WS_LIVENESS_DAYS=1 - ACCOUNTS_URL=http://huly.local:3003 @@ -177,7 +176,6 @@ services: - DB_URL=${DB_URL} - STATS_URL=http://huly.local:4901 - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - REGION= - ACCOUNTS_URL=http://huly.local:3003 - BRANDING_PATH=/var/cfg/branding.json @@ -203,7 +201,6 @@ services: - DB_URL=${DB_EU_URL} - STATS_URL=http://huly.local:4901 - STORAGE_CONFIG=${STORAGE_CONFIG} - - MODEL_ENABLED=* - ACCOUNTS_URL=http://huly.local:3003 - BRANDING_PATH=/var/cfg/branding.json - BACKUP_STORAGE=${BACKUP_STORAGE_CONFIG}