Feature/export single draft (#835)
* Export single draft * Update changelog
This commit is contained in:
parent
ec2ecab751
commit
6e7cf0380b
@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
- Added support to export a single future activity (draft) as an `.ics` file
|
||||
|
||||
## 1.137.0 - 15.04.2022
|
||||
|
||||
### Added
|
||||
|
||||
- Added support to export future activities (drafts) as `.ics` files
|
||||
- Added support to export future activities (drafts) as an `.ics` file
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -194,16 +194,17 @@
|
||||
<ion-icon name="ellipsis-vertical"></ion-icon>
|
||||
</button>
|
||||
<mat-menu #accountMenu="matMenu" xPosition="before">
|
||||
<button i18n mat-menu-item (click)="onUpdateAccount(element)">
|
||||
Edit
|
||||
<button mat-menu-item (click)="onUpdateAccount(element)">
|
||||
<ion-icon class="mr-2" name="create-outline"></ion-icon>
|
||||
<span i18n>Edit</span>
|
||||
</button>
|
||||
<button
|
||||
i18n
|
||||
mat-menu-item
|
||||
[disabled]="element.isDefault || element.Order?.length > 0"
|
||||
(click)="onDeleteAccount(element.id)"
|
||||
>
|
||||
Delete
|
||||
<ion-icon class="mr-2" name="trash-outline"></ion-icon>
|
||||
<span i18n>Delete</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
</td>
|
||||
|
@ -68,12 +68,12 @@
|
||||
</button>
|
||||
<mat-menu #accountMenu="matMenu" xPosition="before">
|
||||
<button
|
||||
i18n
|
||||
mat-menu-item
|
||||
[disabled]="userItem.id === user?.id"
|
||||
(click)="onDeleteUser(userItem.id)"
|
||||
>
|
||||
Delete
|
||||
<ion-icon class="mr-2" name="trash-outline"></ion-icon>
|
||||
<span i18n>Delete</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
</td>
|
||||
|
@ -178,10 +178,10 @@ export class TransactionsPageComponent implements OnDestroy, OnInit {
|
||||
content: this.icsService.transformActivitiesToIcsContent(
|
||||
data.activities
|
||||
),
|
||||
fileName: `ghostfolio-drafts-${format(
|
||||
parseISO(data.meta.date),
|
||||
'yyyyMMddHHmm'
|
||||
)}.ics`,
|
||||
contentType: 'text/calendar',
|
||||
fileName: `ghostfolio-draft${
|
||||
data.activities.length > 1 ? 's' : ''
|
||||
}-${format(parseISO(data.meta.date), 'yyyyMMddHHmm')}.ics`,
|
||||
format: 'string'
|
||||
});
|
||||
});
|
||||
|
@ -9,6 +9,7 @@ import { format, parseISO } from 'date-fns';
|
||||
})
|
||||
export class IcsService {
|
||||
private readonly ICS_DATE_FORMAT = 'yyyyMMdd';
|
||||
private readonly ICS_LINE_BREAK = '\r\n';
|
||||
|
||||
public constructor() {}
|
||||
|
||||
@ -30,7 +31,7 @@ export class IcsService {
|
||||
});
|
||||
const footer = ['END:VCALENDAR'];
|
||||
|
||||
return [...header, ...events, ...footer].join('\n');
|
||||
return [...header, ...events, ...footer].join(this.ICS_LINE_BREAK);
|
||||
}
|
||||
|
||||
private getEvent({
|
||||
@ -54,6 +55,6 @@ export class IcsService {
|
||||
`DTEND;VALUE=DATE:${format(date, this.ICS_DATE_FORMAT)}`,
|
||||
`SUMMARY:${capitalize(type)} ${symbol}`,
|
||||
'END:VEVENT'
|
||||
].join('\n');
|
||||
].join(this.ICS_LINE_BREAK);
|
||||
}
|
||||
}
|
||||
|
@ -387,14 +387,25 @@
|
||||
<ion-icon name="ellipsis-vertical"></ion-icon>
|
||||
</button>
|
||||
<mat-menu #activityMenu="matMenu" xPosition="before">
|
||||
<button i18n mat-menu-item (click)="onUpdateActivity(element)">
|
||||
Edit
|
||||
<button mat-menu-item (click)="onUpdateActivity(element)">
|
||||
<ion-icon class="mr-2" name="create-outline"></ion-icon>
|
||||
<span i18n>Edit</span>
|
||||
</button>
|
||||
<button i18n mat-menu-item (click)="onCloneActivity(element)">
|
||||
Clone
|
||||
<button mat-menu-item (click)="onCloneActivity(element)">
|
||||
<ion-icon class="mr-2" name="copy-outline"></ion-icon>
|
||||
<span i18n>Clone</span>
|
||||
</button>
|
||||
<button i18n mat-menu-item (click)="onDeleteActivity(element.id)">
|
||||
Delete
|
||||
<button
|
||||
mat-menu-item
|
||||
[disabled]="!element.isDraft"
|
||||
(click)="onExportDraft(element.id)"
|
||||
>
|
||||
<ion-icon class="mr-2" name="calendar-clear-outline"></ion-icon>
|
||||
<span i18n>Export Draft as ICS</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="onDeleteActivity(element.id)">
|
||||
<ion-icon class="mr-2" name="trash-outline"></ion-icon>
|
||||
<span i18n>Delete</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
</td>
|
||||
|
@ -200,6 +200,10 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public onExportDraft(aActivityId: string) {
|
||||
this.exportDrafts.emit([aActivityId]);
|
||||
}
|
||||
|
||||
public onExportDrafts() {
|
||||
this.exportDrafts.emit(
|
||||
this.dataSource.filteredData
|
||||
|
Loading…
x
Reference in New Issue
Block a user