Merge pull request #4072 from MaximilianKrambach/agendaexport_internalItem
simpler csv export option for agenda type
This commit is contained in:
commit
5718c6f326
@ -15,9 +15,9 @@ interface ContentObject {
|
||||
* Coming from "OpenSlidesConfigVariables" property "agenda_hide_internal_items_on_projector"
|
||||
*/
|
||||
export const itemVisibilityChoices = [
|
||||
{ key: 1, name: 'Public item' },
|
||||
{ key: 2, name: 'Internal item' },
|
||||
{ key: 3, name: 'Hidden item' }
|
||||
{ key: 1, name: 'Public item', csvName: '' },
|
||||
{ key: 2, name: 'Internal item', csvName: 'internal' },
|
||||
{ key: 3, name: 'Hidden item', csvName: 'hidden' }
|
||||
];
|
||||
|
||||
/**
|
||||
@ -73,6 +73,18 @@ export class Item extends ProjectableBaseModel {
|
||||
return type ? type.name : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a shortened string for CSV export
|
||||
* @returns empty string if it is a public item, 'internal' or 'hidden' otherwise
|
||||
*/
|
||||
public get verboseCsvType(): string {
|
||||
if (!this.type) {
|
||||
return '';
|
||||
}
|
||||
const type = itemVisibilityChoices.find(choice => choice.key === this.type);
|
||||
return type ? type.csvName : '';
|
||||
}
|
||||
|
||||
public getTitle(): string {
|
||||
return this.title;
|
||||
}
|
||||
|
@ -51,6 +51,13 @@ export class ViewItem extends BaseViewModel {
|
||||
return '';
|
||||
}
|
||||
|
||||
public get verboseCsvType() : string {
|
||||
if (this.item) {
|
||||
return this.item.verboseCsvType;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public constructor(item: Item, contentObject: AgendaBaseModel) {
|
||||
super();
|
||||
this._item = item;
|
||||
|
@ -33,7 +33,7 @@ export class AgendaCsvExportService {
|
||||
{ label: 'Text', map: viewItem => viewItem.contentObject ? viewItem.contentObject.getCSVExportText() : '' },
|
||||
{ label: 'Duration', property: 'duration' },
|
||||
{ label: 'Comment', property: 'comment' },
|
||||
{ label: 'Item type', property: 'verboseType' }
|
||||
{ label: 'Item type', property: 'verboseCsvType' }
|
||||
],
|
||||
this.translate.instant('Agenda') + '.csv'
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user