Skip to content

Commit 85fc90e

Browse files
authored
UBERF-10441: Fix configure and board item displayed (#8788)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
1 parent 917828f commit 85fc90e

File tree

12 files changed

+60
-80
lines changed

12 files changed

+60
-80
lines changed

dev/docker-compose.yaml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
image: postgres
2424
container_name: postgres
2525
extra_hosts:
26-
- "host.docker.internal:host-gateway"
26+
- 'host.docker.internal:host-gateway'
2727
environment:
2828
- POSTGRES_PASSWORD=example
2929
volumes:
@@ -98,7 +98,6 @@ services:
9898
- STORAGE_CONFIG=${STORAGE_CONFIG}
9999
- FRONT_URL=http://host.docker.internal:8087
100100
- RESERVED_DB_NAMES=telegram,gmail,github
101-
- MODEL_ENABLED=*
102101
- LAST_NAME_FIRST=true
103102
# - WS_LIVENESS_DAYS=1
104103
- ACCOUNTS_URL=http://host.docker.internal:3000
@@ -135,7 +134,6 @@ services:
135134
- MAIL_URL=
136135
- STORAGE_CONFIG=${STORAGE_CONFIG}
137136
- RESERVED_DB_NAMES=telegram,gmail,github
138-
- MODEL_ENABLED=*
139137
- ACCOUNTS_URL=http://host.docker.internal:3000
140138
- BRANDING_PATH=/var/cfg/branding.json
141139
# - PARALLEL=2
@@ -163,7 +161,6 @@ services:
163161
- STORAGE_CONFIG=${STORAGE_CONFIG}
164162
- FRONT_URL=http://host.docker.internal:8087
165163
- RESERVED_DB_NAMES=telegram,gmail,github
166-
- MODEL_ENABLED=*
167164
- ACCOUNTS_URL=http://host.docker.internal:3000
168165
- BRANDING_PATH=/var/cfg/branding.json
169166
# - PARALLEL=2
@@ -190,7 +187,6 @@ services:
190187
- REGION=cockroach
191188
- STORAGE_CONFIG=${STORAGE_CONFIG}
192189
- RESERVED_DB_NAMES=telegram,gmail,github
193-
- MODEL_ENABLED=*
194190
- ACCOUNTS_URL=http://host.docker.internal:3000
195191
- BRANDING_PATH=/var/cfg/branding.json
196192
# - PARALLEL=2
@@ -372,7 +368,7 @@ services:
372368
- AUTH_TOKEN=secret
373369
- STATS_URL=http://host.docker.internal:4900
374370
- DB_URL=postgresql://root@host.docker.internal:26257/defaultdb?sslmode=disable
375-
restart: unless-stopped
371+
restart: unless-stopped
376372
rekoni:
377373
image: hardcoreeng/rekoni-service
378374
restart: unless-stopped
@@ -503,23 +499,23 @@ services:
503499
- AVATAR_PATH=./avatar.png
504500
- AVATAR_CONTENT_TYPE=.png
505501
- STATS_URL=http://host.docker.internal:4900
506-
# - LOVE_ENDPOINT=http://host.docker.internal:8096
507-
# - OPENAI_API_KEY=token
508-
# telegram-bot:
509-
# image: hardcoreeng/telegram-bot
510-
# extra_hosts:
511-
# - "host.docker.internal:host-gateway"
512-
# restart: unless-stopped
513-
# environment:
514-
# - PORT=4020
515-
# - BOT_TOKEN=token
516-
# - MONGO_URL=${MONGO_URL}
517-
# - MONGO_DB=telegram-bot
518-
# - SECRET=secret
519-
# - DOMAIN=domain
520-
# - ACCOUNTS_URL=http://host.docker.internal:3000
521-
# - SERVICE_ID=telegram-bot-service
522-
# - STATS_URL=http://host.docker.internal:4900
502+
# - LOVE_ENDPOINT=http://host.docker.internal:8096
503+
# - OPENAI_API_KEY=token
504+
# telegram-bot:
505+
# image: hardcoreeng/telegram-bot
506+
# extra_hosts:
507+
# - "host.docker.internal:host-gateway"
508+
# restart: unless-stopped
509+
# environment:
510+
# - PORT=4020
511+
# - BOT_TOKEN=token
512+
# - MONGO_URL=${MONGO_URL}
513+
# - MONGO_DB=telegram-bot
514+
# - SECRET=secret
515+
# - DOMAIN=domain
516+
# - ACCOUNTS_URL=http://host.docker.internal:3000
517+
# - SERVICE_ID=telegram-bot-service
518+
# - STATS_URL=http://host.docker.internal:4900
523519
export:
524520
image: hardcoreeng/export
525521
extra_hosts:

dev/local-mongo/docker-compose.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
- discovery.type=single-node
2424
- ES_JAVA_OPTS=-Xms1024m -Xmx1024m
2525
- http.cors.enabled=true
26-
- http.cors.allow-origin=http://localhost:8082
26+
- http.cors.allow-origin=http://localhost:8082
2727
healthcheck:
2828
interval: 20s
2929
retries: 10
@@ -46,12 +46,11 @@ services:
4646
- STORAGE_CONFIG=${STORAGE_CONFIG}
4747
- FRONT_URL=http://localhost:8087
4848
- RESERVED_DB_NAMES=telegram,gmail,github
49-
- MODEL_ENABLED=*
5049
- LAST_NAME_FIRST=true
5150
- ACCOUNTS_URL=http://localhost:3000
5251
- BRANDING_PATH=/var/cfg/branding.json
5352
- INIT_SCRIPT_URL=https://raw.githubusercontent.com/hcengineering/init/main/script.yaml
54-
- INIT_WORKSPACE=onboarding
53+
- INIT_WORKSPACE=onboarding
5554
restart: unless-stopped
5655
collaborator:
5756
image: hardcoreeng/collaborator
@@ -86,7 +85,7 @@ services:
8685
- MONGO_URL=mongodb://host.docker.internal:27017?compressors=snappy
8786
- 'MONGO_OPTIONS={"appName":"front","maxPoolSize":1}'
8887
- ACCOUNTS_URL=http://localhost:3000
89-
- UPLOAD_URL=/files
88+
- UPLOAD_URL=/files
9089
- GMAIL_URL=http://localhost:8088
9190
- CALENDAR_URL=http://localhost:8095
9291
- TELEGRAM_URL=http://localhost:8086
@@ -100,7 +99,7 @@ services:
10099
- DESKTOP_UPDATES_URL=https://dist.huly.io
101100
- DESKTOP_UPDATES_CHANNEL=dev
102101
- BRANDING_URL=http://localhost:8087/branding.json
103-
restart: unless-stopped
102+
restart: unless-stopped
104103
transactor:
105104
image: hardcoreeng/transactor
106105
links:
@@ -112,11 +111,11 @@ services:
112111
ports:
113112
- 3333:3333
114113
volumes:
115-
- ../branding.json:/var/cfg/branding.json
114+
- ../branding.json:/var/cfg/branding.json
116115
environment:
117116
# - SERVER_PROVIDER=uweb
118117
# - UWS_HTTP_MAX_HEADERS_SIZE="32768"
119-
- UV_THREADPOOL_SIZE=10
118+
- UV_THREADPOOL_SIZE=10
120119
- SERVER_PORT=3333
121120
- SERVER_SECRET=secret
122121
- ENABLE_COMPRESSION=true
@@ -133,7 +132,7 @@ services:
133132
- ACCOUNTS_URL=http://account:3000
134133
- LAST_NAME_FIRST=true
135134
- ELASTIC_INDEX_NAME=local_storage_index
136-
- BRANDING_PATH=/var/cfg/branding.json
135+
- BRANDING_PATH=/var/cfg/branding.json
137136
restart: unless-stopped
138137
rekoni:
139138
image: hardcoreeng/rekoni-service
@@ -175,7 +174,7 @@ services:
175174
- ACCOUNTS_URL=http://account:3000
176175
- MINIO_SECRET_KEY=minioadmin
177176
- CERTIFICATE_PATH=/var/cfg/certificate.p12
178-
- SERVICE_ID=sign-service
177+
- SERVICE_ID=sign-service
179178
- BRANDING_PATH=/var/cfg/branding.json
180179
deploy:
181180
resources:

dev/tool/src/__start.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ import { devTool } from '.'
2222

2323
import { addLocation } from '@hcengineering/platform'
2424
import { serverActivityId } from '@hcengineering/server-activity'
25+
import { serverAiBotId } from '@hcengineering/server-ai-bot'
2526
import { serverAttachmentId } from '@hcengineering/server-attachment'
26-
import { serverCardId } from '@hcengineering/server-card'
2727
import { serverCalendarId } from '@hcengineering/server-calendar'
28+
import { serverCardId } from '@hcengineering/server-card'
2829
import { serverChunterId } from '@hcengineering/server-chunter'
2930
import { serverCollaborationId } from '@hcengineering/server-collaboration'
3031
import { serverContactId } from '@hcengineering/server-contact'
31-
import { serverDriveId } from '@hcengineering/server-drive'
3232
import { serverDocumentId } from '@hcengineering/server-document'
33+
import { serverDriveId } from '@hcengineering/server-drive'
3334
import { serverGmailId } from '@hcengineering/server-gmail'
3435
import { serverGuestId } from '@hcengineering/server-guest'
3536
import { serverHrId } from '@hcengineering/server-hr'
@@ -45,7 +46,6 @@ import { serverTelegramId } from '@hcengineering/server-telegram'
4546
import { serverTimeId } from '@hcengineering/server-time'
4647
import { serverTrackerId } from '@hcengineering/server-tracker'
4748
import { serverViewId } from '@hcengineering/server-view'
48-
import { serverAiBotId } from '@hcengineering/server-ai-bot'
4949

5050
addLocation(serverActivityId, () => import('@hcengineering/server-activity-resources'))
5151
addLocation(serverAttachmentId, () => import('@hcengineering/server-attachment-resources'))
@@ -79,10 +79,7 @@ function prepareTools (): {
7979
version: Data<Version>
8080
migrateOperations: [string, MigrateOperation][]
8181
} {
82-
const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim())
83-
const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim())
84-
85-
return { ...prepareToolsRaw(builder(enabled, disabled).getTxes()), version: getModelVersion(), migrateOperations }
82+
return { ...prepareToolsRaw(builder().getTxes()), version: getModelVersion(), migrateOperations }
8683
}
8784

8885
export function getMongoDBUrl (): string {

models/all/src/build.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { writeFileSync } from 'fs'
22
import builder from './'
3-
const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim())
4-
const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim())
53

6-
const model = JSON.stringify(builder(enabled, disabled).getTxes())
4+
const model = JSON.stringify(builder().getTxes())
75
writeFileSync(process.argv[2], model)

models/all/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export type { MigrateOperation } from '@hcengineering/model'
137137
* @param disabled - a set of disabled plugins
138138
* @returns
139139
*/
140-
export default function buildModel (enabled: string[] = ['*'], disabled: string[] = []): Builder {
140+
export default function buildModel (): Builder {
141141
const builder = new Builder()
142142

143143
const defaultFilter = [
@@ -303,10 +303,11 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[
303303
boardModel,
304304
boardId,
305305
{
306-
label: undefined, // board.string.ConfigLabel,
306+
label: board.string.ConfigLabel,
307307
description: board.string.ConfigDescription,
308308
enabled: false,
309309
beta: true,
310+
hidden: true,
310311
icon: board.icon.Board,
311312
classFilter: defaultFilter
312313
}
@@ -315,10 +316,11 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[
315316
bitrixModel,
316317
bitrixId,
317318
{
318-
label: undefined, // bitrix.string.ConfigLabel,
319+
label: bitrix.string.ConfigLabel,
319320
description: bitrix.string.ConfigDescription,
320321
enabled: false,
321322
beta: true,
323+
hidden: true,
322324
icon: bitrix.icon.Bitrix,
323325
classFilter: defaultFilter
324326
}
@@ -481,9 +483,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[
481483
pluginId: id,
482484
transactions: txes.map((it) => it._id),
483485
...config,
484-
enabled:
485-
config?.label === undefined ||
486-
((config?.enabled ?? true) && (enabled.includes(id) || enabled.includes('*')) && !disabled.includes(id)),
486+
enabled: config?.label === undefined || ((config?.enabled ?? true) && !(config.hidden ?? false)),
487487
beta: config?.beta ?? false
488488
},
489489
('plugin-configuration-' + id) as Ref<PluginConfiguration>

models/all/src/show.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import builder from './'
2-
const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim())
3-
const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim())
42

5-
const model = JSON.stringify(builder(enabled, disabled).getTxes())
3+
const model = JSON.stringify(builder().getTxes())
64
console.log(model)

packages/core/src/classes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,14 @@ export interface PluginConfiguration extends Doc {
235235
pluginId: Plugin
236236
transactions: Ref<Doc>[]
237237

238-
// If not set will not be shown in configuration UI
239238
label?: IntlString
240239
icon?: Asset
241240
description?: IntlString
242241
enabled: boolean
243242

243+
// If set will not be shown in configuration UI or enabled
244+
hidden?: boolean
245+
244246
// If specified, will show beta/testing label in UI.
245247
beta: boolean
246248

plugins/setting-resources/src/components/Configure.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<Scroller align={'center'} padding={'var(--spacing-3)'} bottomPadding={'var(--spacing-3)'}>
3737
<div class="flex-row-center flex-wrap gap-around-4">
3838
{#each $pluginConfigurationStore.list as config}
39-
{#if config.label}
39+
{#if config.label && !(config.hidden ?? false)}
4040
<div class="cardBox flex-col clear-mins" class:enabled={config.enabled ?? true}>
4141
<div class="flex-row-center">
4242
<span class="mr-2">

pods/workspace/src/__start.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import { initStatisticsContext, loadBrandingMap } from '@hcengineering/server-co
99
import { serveWorkspaceAccount } from '@hcengineering/workspace-service'
1010
import { join } from 'path'
1111

12-
const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim())
13-
const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim())
14-
15-
const txes = JSON.parse(JSON.stringify(builder(enabled, disabled).getTxes())) as Tx[]
12+
const txes = JSON.parse(JSON.stringify(builder().getTxes())) as Tx[]
1613

1714
configureAnalytics(process.env.SENTRY_DSN, {})
1815
Analytics.setTag('application', 'workspace')

0 commit comments

Comments
 (0)