2019-04-17 12:10:56 +02:00
|
|
|
/**
|
|
|
|
* Defines the column order for csv/xlsx export/import of motions.
|
|
|
|
*/
|
|
|
|
export const motionImportExportHeaderOrder: string[] = [
|
|
|
|
'id',
|
|
|
|
'identifier',
|
2019-04-26 11:54:07 +02:00
|
|
|
'submitters',
|
2019-04-17 12:10:56 +02:00
|
|
|
'title',
|
|
|
|
'text',
|
|
|
|
'reason',
|
|
|
|
'category',
|
|
|
|
'tags',
|
|
|
|
'recommendation',
|
2019-04-26 11:54:07 +02:00
|
|
|
'state',
|
|
|
|
'motion_block',
|
|
|
|
'origin'
|
2019-04-17 12:10:56 +02:00
|
|
|
];
|
|
|
|
|
2019-04-26 11:54:07 +02:00
|
|
|
/**
|
|
|
|
* hints the metaData. This data will be excluded from the meta-data list in the export dialog.
|
|
|
|
* Order of this does not matter
|
|
|
|
*/
|
|
|
|
export const noMetaData: string[] = ['identifier', 'title', 'text', 'reason'];
|
|
|
|
|
2019-04-17 12:10:56 +02:00
|
|
|
/**
|
|
|
|
* Subset of {@link motionImportExportHeaderOrder} properties that are
|
|
|
|
* restricted to export only due to database or workflow limitations
|
|
|
|
*/
|
2019-05-21 13:00:31 +02:00
|
|
|
export const motionExportOnly: string[] = ['id', 'recommendation', 'state'];
|
2019-04-26 11:54:07 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* reorders the exported properties according to motionImportExportHeaderOrder
|
|
|
|
*
|
|
|
|
* @param propertyList A list of motion properties to be ordered
|
|
|
|
*/
|
|
|
|
export function sortMotionPropertyList(propertyList: string[]): string[] {
|
|
|
|
return motionImportExportHeaderOrder.filter(property => propertyList.includes(property));
|
|
|
|
}
|