2020-07-03 07:54:21 +03:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import {action} from '@ember/object';
|
|
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
|
|
|
|
const FIELD_MAPPINGS = [
|
2020-07-08 11:18:56 +03:00
|
|
|
{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'}
|
2020-07-03 07:54:21 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|