Skip to content

Commit

Permalink
Hook in a button in UI to do semantic sort.
Browse files Browse the repository at this point in the history
Part of #688.
  • Loading branch information
jkomoros committed Apr 8, 2024
1 parent 24b8495 commit cfdd04f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/bulk-import-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ import { DialogElement } from './dialog-element.js';
import { ButtonSharedStyles } from './button-shared-styles.js';

import {
closeBulkImportDialog, commitBulkImport, processBulkImportContent
closeBulkImportDialog,
commitBulkImport,
processBulkImportContent,
semanticSortExport
} from '../actions/bulk-import.js';

import {
CHECK_CIRCLE_OUTLINE_ICON,
SHUFFLE_ICON
} from './my-icons.js';

import {
Expand Down Expand Up @@ -123,6 +127,12 @@ class BulkImportDialog extends connect(store)(DialogElement) {
private innerRenderExport() {
//TODO: render as selectable HTML
return html`<div>
<button
class='small'
@click=${this._handleSemanticSortClicked}
id='semantic-sort'
>${SHUFFLE_ICON}</button>
<label for='semantic-sort'>Semantic Sort</label>
<p>Copy this content to import it elsewhere:</p>
<div class='output'>
${unsafeHTML(this._exportContent)}
Expand Down Expand Up @@ -156,6 +166,10 @@ class BulkImportDialog extends connect(store)(DialogElement) {
store.dispatch(processBulkImportContent(pastedData, !checkbox.checked));
}

_handleSemanticSortClicked() {
store.dispatch(semanticSortExport());
}

_handleDoneClicked() {
store.dispatch(commitBulkImport());
}
Expand Down

0 comments on commit cfdd04f

Please sign in to comment.