mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
e36b79c940
no issue - Adds UI to map imported csv fields to ones accepted by Ghost API - Includes automatic mapping detection for emails and stripe_customer_ids
30 lines
859 B
JavaScript
30 lines
859 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
const FIELD_MAPPINGS = [
|
|
{label: 'email', value: 'email'},
|
|
{label: 'name', value: 'name'},
|
|
{label: 'note', value: 'note'},
|
|
{label: 'subscribed_to_emails', value: 'subscribed_to_emails'},
|
|
{label: 'stripe_customer_id', value: 'stripe_customer_id'},
|
|
{label: 'complimentary_plan', value: 'complimentary_plan'},
|
|
{label: 'labels', value: 'labels'},
|
|
{label: 'created_at', value: 'created_at'}
|
|
];
|
|
|
|
export default class extends Component {
|
|
@tracked availableFields = FIELD_MAPPINGS;
|
|
|
|
get mapTo() {
|
|
return this.args.mapTo;
|
|
}
|
|
|
|
@action
|
|
updateMapping(newMapTo) {
|
|
if (this.args.updateMapping) {
|
|
this.args.updateMapping(this.args.mapFrom, newMapTo);
|
|
}
|
|
}
|
|
}
|