Context menu to each history entry (#171)

- added entry-menu
- added subsection in entry-menu with the location of the history entry and the action to remove an entry from history
- added uploadAll functionality
- show uploadAll Button in history only if the user is logged in
- added deleteNote api call

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2020-06-09 22:35:09 +02:00 committed by GitHub
parent 107a8eeaaf
commit 72a161ea16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 238 additions and 110 deletions

View file

@ -29,13 +29,13 @@ function locateEntries (entries: HistoryEntry[], location: HistoryEntryOrigin):
})
}
export function mergeEntryArrays<T extends HistoryEntry> (locatedLocalEntries: T[], locatedRemoteEntries: T[]): T[] {
const filteredLocalEntries = locatedLocalEntries.filter(localEntry => {
const entry = locatedRemoteEntries.find(remoteEntry => remoteEntry.id === localEntry.id)
export function mergeEntryArrays<T extends HistoryEntry> (localEntries: T[], remoteEntries: T[]): T[] {
const filteredLocalEntries = localEntries.filter(localEntry => {
const entry = remoteEntries.find(remoteEntry => remoteEntry.id === localEntry.id)
return !entry
})
return filteredLocalEntries.concat(locatedRemoteEntries)
return filteredLocalEntries.concat(remoteEntries)
}
function filterBySelectedTags (entries: LocatedHistoryEntry[], selectedTags: string[]): LocatedHistoryEntry[] {