Skip to content

Commit d4731a6

Browse files
authored
Support export to JSON, CSV (#8193)
Signed-off-by: Anna Khismatullina <[email protected]>
1 parent dd23389 commit d4731a6

File tree

46 files changed

+2102
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2102
-153
lines changed

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,5 +798,24 @@
798798
"outputCapture": "std",
799799
"cwd": "${workspaceRoot}/dev/import-tool"
800800
},
801+
{
802+
"name": "Debug Export service",
803+
"type": "node",
804+
"request": "launch",
805+
"args": ["src/index.ts"],
806+
"env": {
807+
"PORT": "4009",
808+
"SECRET": "secret",
809+
"ACCOUNTS_URL": "http://localhost:3000",
810+
"MINIO_ENDPOINT": "localhost",
811+
"MINIO_ACCESS_KEY": "minioadmin",
812+
"MINIO_SECRET_KEY": "minioadmin",
813+
"TRANSACTOR_URL": "ws://localhost:3333",
814+
"SERVICE_ID": "export-service"
815+
},
816+
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
817+
"sourceMaps": true,
818+
"cwd": "${workspaceRoot}/services/export/pod-export"
819+
}
801820
]
802821
}

common/config/rush/command-line.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
"summary": "Build docker with platform",
247247
"description": "use to build all docker containers required for platform",
248248
"safeForSimultaneousRushProcesses": true,
249-
"shellCommand": "rush docker:build -p 20 --to @hcengineering/pod-server --to @hcengineering/pod-front --to @hcengineering/prod --to @hcengineering/pod-account --to @hcengineering/pod-workspace --to @hcengineering/pod-collaborator --to @hcengineering/tool --to @hcengineering/pod-print --to @hcengineering/pod-sign --to @hcengineering/pod-analytics-collector --to @hcengineering/rekoni-service --to @hcengineering/pod-ai-bot --to @hcengineering/import-tool --to @hcengineering/pod-stats --to @hcengineering/pod-fulltext --to @hcengineering/pod-love --to @hcengineering/green --to @hcengineering/pod-mail --to @hcengineering/pod-datalake --to @hcengineering/pod-hook"
249+
"shellCommand": "rush docker:build -p 20 --to @hcengineering/pod-server --to @hcengineering/pod-front --to @hcengineering/prod --to @hcengineering/pod-account --to @hcengineering/pod-workspace --to @hcengineering/pod-collaborator --to @hcengineering/tool --to @hcengineering/pod-print --to @hcengineering/pod-sign --to @hcengineering/pod-analytics-collector --to @hcengineering/rekoni-service --to @hcengineering/pod-ai-bot --to @hcengineering/import-tool --to @hcengineering/pod-stats --to @hcengineering/pod-fulltext --to @hcengineering/pod-love --to @hcengineering/green --to @hcengineering/pod-mail --to @hcengineering/pod-datalake --to @hcengineering/pod-hook --to @hcengineering/pod-export"
250250
},
251251
{
252252
"commandKind": "global",

common/config/rush/pnpm-lock.yaml

Lines changed: 311 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop/src/ui/platform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ export async function configurePlatform (): Promise<void> {
373373
configureNotifications()
374374

375375
setMetadata(setting.metadata.BackupUrl, config.BACKUP_URL ?? '')
376+
setMetadata(setting.metadata.ExportUrl, config.EXPORT_URL ?? '')
376377

377378
if (config.INITIAL_URL !== '') {
378379
setLocationStorageKey('uberflow_child')

desktop/src/ui/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface Config {
4141
STREAM_URL?: string
4242
BACKUP_URL?: string
4343
PUBLIC_SCHEDULE_URL?: string
44+
EXPORT_URL?: string
4445
}
4546

4647
export interface Branding {

dev/docker-compose.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,24 @@ services:
440440
# - ACCOUNTS_URL=http://huly.local:3000
441441
# - SERVICE_ID=telegram-bot-service
442442
# - STATS_URL=http://huly.local:4900
443+
export:
444+
image: hardcoreeng/export
445+
extra_hosts:
446+
- 'huly.local:host-gateway'
447+
links:
448+
- mongodb
449+
- minio
450+
- stats
451+
ports:
452+
- 4009:4009
453+
environment:
454+
- PORT=4009
455+
- SECRET=secret
456+
- SERVICE_ID=export-service
457+
- DB_URL=${MONGO_URL}
458+
- STATS_URL=http://huly.local:4900
459+
- STORAGE_CONFIG=${STORAGE_CONFIG}
460+
- ACCOUNTS_URL=http://huly.local:3000
443461
volumes:
444462
db:
445463
dbpg:

dev/import-tool/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import {
1717
ClickupImporter,
1818
defaultDocumentPreprocessors,
1919
DocumentConverter,
20-
FrontFileUploader,
21-
importNotion,
22-
UnifiedFormatImporter,
2320
type DocumentConverterOptions,
2421
type FileUploader,
22+
FrontFileUploader,
23+
HulyFormatImporter,
24+
importNotion,
2525
type Logger
2626
} from '@hcengineering/importer'
2727
import { setMetadata } from '@hcengineering/platform'
@@ -164,7 +164,7 @@ export function importTool (): void {
164164
.action(async (dir: string, cmd) => {
165165
const { workspace, user, password } = cmd
166166
await authorize(user, password, workspace, async (client, uploader) => {
167-
const importer = new UnifiedFormatImporter(client, uploader, new ConsoleLogger())
167+
const importer = new HulyFormatImporter(client, uploader, new ConsoleLogger())
168168
await importer.importFolder(dir)
169169
})
170170
})

dev/prod/public/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"STATS_URL": "http://localhost:4900",
2121
"PASSWORD_STRICTNESS": "none",
2222
"STREAM_URL": "http://localhost:1080/recording",
23-
"PUBLIC_SCHEDULE_URL": "http://localhost:8060"
23+
"PUBLIC_SCHEDULE_URL": "http://localhost:8060",
24+
"EXPORT_URL": "http://localhost:4009/export"
2425
}

dev/prod/src/platform.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export interface Config {
176176
BACKUP_URL?: string
177177
STREAM_URL?: string
178178
PUBLIC_SCHEDULE_URL?: string
179+
EXPORT_URL?: string
179180
}
180181

181182
export interface Branding {
@@ -560,6 +561,7 @@ export async function configurePlatform() {
560561
setMetadata(workbench.metadata.DefaultSpecial, myBranding.defaultSpecial ?? 'issues')
561562

562563
setMetadata(setting.metadata.BackupUrl, config.BACKUP_URL ?? '')
564+
setMetadata(setting.metadata.ExportUrl, config.EXPORT_URL ?? '')
563565

564566
initThemeStore()
565567
}

models/setting/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,20 @@ export function createModel (builder: Builder): void {
336336
},
337337
setting.ids.InviteSettings
338338
)
339+
builder.createDoc(
340+
setting.class.WorkspaceSettingCategory,
341+
core.space.Model,
342+
{
343+
name: 'export',
344+
label: setting.string.Export,
345+
icon: setting.icon.Export,
346+
component: setting.component.Export,
347+
group: 'settings-editor',
348+
role: AccountRole.User,
349+
order: 4800
350+
},
351+
setting.ids.Export
352+
)
339353
// Currently remove Support item from settings
340354
// builder.createDoc(
341355
// setting.class.SettingsCategory,

packages/importer/src/docx/docx.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { markupToMarkdown } from '@hcengineering/text-markdown'
1818
import { mkdir, readdir, readFile, writeFile } from 'fs/promises'
1919
import * as yaml from 'js-yaml'
2020
import { basename, dirname, extname, join, relative } from 'path'
21-
import { UnifiedControlledDocumentHeader, UnifiedDocumentTemplateHeader } from '../huly/unified'
21+
import { HulyControlledDocumentHeader, HulyDocumentTemplateHeader } from '../huly/huly'
2222

2323
export interface DocumentConverterOptions {
2424
outputPath: string
@@ -32,7 +32,7 @@ export interface DocumentState {
3232
path: string
3333
root: string
3434
markup: MarkupNode
35-
header?: UnifiedControlledDocumentHeader | UnifiedDocumentTemplateHeader
35+
header?: HulyControlledDocumentHeader | HulyDocumentTemplateHeader
3636
}
3737

3838
export interface DocumentPreprocessorOptions<T> {

0 commit comments

Comments
 (0)