mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-28 10:49:45 +02:00
Enable export for organizations (#8346)
Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com>
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user