mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
ed98d89771
no issue - Adds a table representation of data present in a CSV file that is about to be imported. Allows to navigate through data to see how exactly the file would be parsed on server
34 lines
790 B
JavaScript
34 lines
790 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class GhMembersImportTable extends Component {
|
|
@tracked dataPreviewIndex = 0;
|
|
|
|
get currentlyDisplayedData() {
|
|
if (this.args && this.args.importData) {
|
|
return this.args.importData[this.dataPreviewIndex];
|
|
}
|
|
|
|
return {};
|
|
}
|
|
|
|
@action
|
|
next() {
|
|
const nextValue = this.dataPreviewIndex + 1;
|
|
|
|
if (this.args.importData[nextValue]) {
|
|
this.dataPreviewIndex = nextValue;
|
|
}
|
|
}
|
|
|
|
@action
|
|
prev() {
|
|
const nextValue = this.dataPreviewIndex - 1;
|
|
|
|
if (this.args.importData[nextValue]) {
|
|
this.dataPreviewIndex = nextValue;
|
|
}
|
|
}
|
|
}
|