This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

feat(paging): replace glossary list with paging (#1199) (#1196)

* fix(glossary): update list after delete glossary entry

https://zanata.atlassian.net/browse/ZNTA-1138

* Paging for glossary

* feat(glossary): replace infinite scroll with paging

https://zanata.atlassian.net/browse/ZNTA-1136
  • Loading branch information...
aeng committed Jun 15, 2016
1 parent 503986f commit c418b92dffc6538c713c3cbeaf5a96f35113ba56
Showing with 44 additions and 39 deletions.
  1. +44 −39 frontend/src/main/web/src/containers/Glossary/Entry.js
@@ -8,7 +8,8 @@ import {
Icon,
LoaderText,
TableCell,
TableRow
TableRow,
Row
} from '../../components'
import EntryModal from './EntryModal'
import DeleteEntryModal from './DeleteEntryModal'
@@ -147,44 +148,48 @@ class Entry extends Component {
}
</TableCell>
<TableCell size='2'>
<ButtonLink atomic={{m: 'Mend(rq)'}}
onClick={() => this.setShowingEntryModal(true)}>
<Icon name='info'/>
</ButtonLink>
<EntryModal entry={entry}
show={this.state.showEntryModal}
isSaving={isSaving}
selectedTransLocale={selectedTransLocale}
canUpdate={displayUpdateButton}
handleEntryModalDisplay={(display) =>
this.setShowingEntryModal(display)}
handleResetTerm={(entryId) => handleResetTerm(entryId)}
handleTermFieldUpdate={(field, e) =>
handleTermFieldUpdate(field, e)}
handleUpdateTerm={(entry) =>
handleUpdateTerm(entry, false)}
/>
{updateButton}
<div className='Op(0) row--selected_Op(1) editable:h_Op(1) Trs(eo)'>
{displayUpdateButton && !isSaving ? (
<ButtonLink
onClick={() => handleResetTerm(entry.id)}>
Cancel
</ButtonLink>
) : ''
}
{!transSelected && permission.canDeleteEntry && !isSaving &&
!displayUpdateButton && (
<DeleteEntryModal entry={entry}
isDeleting={isDeleting}
show={this.state.showDeleteModal}
handleDeleteEntryDisplay={(display) =>
this.setShowingDeleteEntryModal(display)}
handleDeleteEntry={handleDeleteTerm} />)
}
</div>
{termsLoading
? loadingDiv
: (<Row>
<ButtonLink atomic={{m: 'Mend(rq)'}}
disabled={isDeleting}
onClick={() => this.setShowingEntryModal(true)}>
<Icon name='info' />
</ButtonLink>
<EntryModal entry={entry}
show={this.state.showEntryModal}
isSaving={isSaving}
selectedTransLocale={selectedTransLocale}
canUpdate={displayUpdateButton}
handleEntryModalDisplay={(display) =>
this.setShowingEntryModal(display)}
handleResetTerm={(entryId) => handleResetTerm(entryId)}
handleTermFieldUpdate={(field, e) =>
handleTermFieldUpdate(field, e)}
handleUpdateTerm={(entry) =>
handleUpdateTerm(entry, false)}/>
{updateButton}
<div className='Op(0) row--selected_Op(1) editable:h_Op(1) Trs(eo)'>
{displayUpdateButton && !isSaving ? (
<ButtonLink
onClick={() => handleResetTerm(entry.id)}>
Cancel
</ButtonLink>
) : ''
}
{!transSelected && permission.canDeleteEntry && !isSaving &&
!displayUpdateButton && (
<DeleteEntryModal entry={entry}
isDeleting={isDeleting}
show={this.state.showDeleteModal}
handleDeleteEntryDisplay={(display) =>
this.setShowingDeleteEntryModal(display)}
handleDeleteEntry={handleDeleteTerm} />)
}
</div>
</Row>)
}
</TableCell>
</TableRow>
)

0 comments on commit c418b92

Please sign in to comment.