Enable export for organizations (#8346)

Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com>
This commit is contained in:
Anna Khismatullina
2025-03-26 13:05:09 +07:00
committed by GitHub
parent 31de65a60c
commit e08b0392fa
5 changed files with 44 additions and 2 deletions
@@ -53,9 +53,12 @@
kind: 'error',
message: plugin.string.ExportRequestFailedMessage
})
return
}
const filename = `Talants_${new Date().toLocaleDateString()}_${new Date().toLocaleTimeString()}.csv`
const contentDisposition = res.headers.get('Content-Disposition')
const filename = contentDisposition?.match(/filename="([^"]*)"/)?.[1] ?? 'export.csv'
const blob = await res.blob()
const url = window.URL.createObjectURL(blob)
const a = document.createElement('a')
+3
View File
@@ -17,6 +17,9 @@ import { type Resources } from '@hcengineering/platform'
import ExportButton from './components/ExportButton.svelte'
import ExportSettings from './components/ExportSettings.svelte'
export { default as ExportButton } from './components/ExportButton.svelte'
export { default as ExportSettings } from './components/ExportSettings.svelte'
export default async (): Promise<Resources> => ({
component: {
ExportButton,
+1
View File
@@ -67,6 +67,7 @@
"@hcengineering/view": "^0.6.13",
"@hcengineering/view-resources": "^0.6.0",
"@hcengineering/workbench": "^0.6.16",
"@hcengineering/export-resources": "^0.6.0",
"svelte": "^4.2.19"
}
}
@@ -22,6 +22,7 @@
import { FilterBar, FilterButton, ViewletSelector, ViewletSettingButton } from '@hcengineering/view-resources'
import recruit from '../plugin'
import CreateOrganization from './CreateOrganization.svelte'
import { ExportButton } from '@hcengineering/export-resources'
import VacancyListApplicationsPopup from './organizations/VacancyListApplicationsPopup.svelte'
import VacancyListCountPresenter from './organizations/VacancyListCountPresenter.svelte'
import VacancyPopup from './organizations/VacancyPopup.svelte'
@@ -214,6 +215,40 @@
<FilterButton _class={recruit.mixin.VacancyList} />
</svelte:fragment>
<svelte:fragment slot="actions">
<ExportButton
_class={recruit.mixin.VacancyList}
query={resultQuery}
visible={true}
config={{
skipAttributes: [
'_class',
'docUpdateMessages',
'space',
'notification:mixin:Collaborators',
'recruit:mixin:VacancyList'
],
attributeKeyMap: { city: 'location' },
attributeTransforms: {
channels: {
operations: [
{
type: 'group_by',
config: {
keyField: 'data.provider',
valueField: 'data.value'
}
},
{
type: 'join',
config: {
delimiter: ', '
}
}
]
}
}
}}
/>
<Button icon={IconAdd} label={recruit.string.CompanyCreateLabel} kind={'primary'} on:click={showCreateDialog} />
</svelte:fragment>
</Header>
+1 -1
View File
@@ -159,7 +159,7 @@ export function createServer (storageConfig: StorageConfiguration): { app: Expre
const measureCtx = initStatisticsContext('export', {})
const app = express()
app.use(cors())
app.use(cors({ exposedHeaders: 'Content-Disposition' }))
app.use(express.json())
app.post(