Skip to content

Commit

Permalink
Show batch transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Apr 14, 2024
1 parent ce13938 commit 11f9f6c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
5 changes: 0 additions & 5 deletions src/views/GrampsjsViewRevision.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,6 @@ export class GrampsjsViewRevision extends GrampsjsView {
this._fetchData()
}

connectedCallback() {
super.connectedCallback()
window.addEventListener('db:changed', () => this._fetchData())
}

update(changed) {
super.update(changed)
if (this.active && changed.has('transactionId')) {
Expand Down
55 changes: 30 additions & 25 deletions src/views/GrampsjsViewRevisions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
mdiImageMinus,
mdiMapMarkerMinus,
mdiFileDocumentMinus,
mdiTimelineQuestionOutline,
} from '@mdi/js'

import '../components/GrampsjsPagination.js'
Expand Down Expand Up @@ -76,15 +77,6 @@ const changeIcons = {
Media_2: mdiImageMinus,
}

const colors = {
10: '#4caf50',
11: 'var(--mdc-theme-secondary)',
12: '#bf360c',
0: 'rgba(0, 0, 0, 0.45)',
1: 'rgba(0, 0, 0, 0.45)',
2: 'rgba(0, 0, 0, 0.45)',
}

export class GrampsjsViewRevisions extends GrampsjsView {
static get styles() {
return [
Expand All @@ -97,6 +89,10 @@ export class GrampsjsViewRevisions extends GrampsjsView {
--md-list-item-trailing-supporting-text-color: rgba(0, 0, 0, 0.8);
}
md-list-item[type='text'] {
--md-list-item-label-text-color: rgba(0, 0, 0, 0.48);
}
svg[slot='end'] {
height: 22px;
width: 22px;
Expand Down Expand Up @@ -172,25 +168,34 @@ export class GrampsjsViewRevisions extends GrampsjsView {
}, {})

return html`<md-list-item
interactive
type="link"
href="/revision/${txn.id}"
?interactive="${!!txn.changes?.length}"
type="${txn.changes?.length ? 'link' : 'text'}"
href="${txn.changes?.length ? `/revision/${txn.id}` : ''}"
>
<div slot="headline">${this._(txn.description)}</div>
${renderIconSvg(mdiSourceCommit, '#777777', 0, 'start')}
${Object.keys(counts).map(key =>
changeIcons[key]
? html`
${renderIconSvg(
changeIcons[key],
colors[key.split('_')[1]],
0,
'end'
)}
<span slot="end" class="counter">${counts[key]}</span>
`
: ''
)}
${txn.changes?.length
? Object.keys(counts).map(key =>
changeIcons[key]
? html`
${
renderIconSvg(
changeIcons[key],
'rgba(0, 0, 0, 0.45)',
0,
'end'
)
// <span slot="end" class="counter">${counts[key]}</span>
} </span
> `
: ''
)
: renderIconSvg(
mdiTimelineQuestionOutline,
'rgba(0, 0, 0, 0.45)',
0,
'end'
)}
<div slot="supporting-text">
<span class="user">
${txn.connection?.user
Expand Down

0 comments on commit 11f9f6c

Please sign in to comment.