|
|
@ -1,52 +1,52 @@
|
|
|
|
// SPDX-FileCopyrightText: © 2017 EteSync Authors
|
|
|
|
// SPDX-FileCopyrightText: © 2017 EteSync Authors
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
|
|
|
|
import * as React from 'react';
|
|
|
|
import * as React from "react";
|
|
|
|
import IconButton from '@material-ui/core/IconButton';
|
|
|
|
import IconButton from "@material-ui/core/IconButton";
|
|
|
|
import Button from '@material-ui/core/Button';
|
|
|
|
import Button from "@material-ui/core/Button";
|
|
|
|
import TextField from '@material-ui/core/TextField';
|
|
|
|
import TextField from "@material-ui/core/TextField";
|
|
|
|
import Select from '@material-ui/core/Select';
|
|
|
|
import Select from "@material-ui/core/Select";
|
|
|
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
|
|
import MenuItem from "@material-ui/core/MenuItem";
|
|
|
|
import FormControl from '@material-ui/core/FormControl';
|
|
|
|
import FormControl from "@material-ui/core/FormControl";
|
|
|
|
import InputLabel from '@material-ui/core/InputLabel';
|
|
|
|
import InputLabel from "@material-ui/core/InputLabel";
|
|
|
|
import * as colors from '@material-ui/core/colors';
|
|
|
|
import * as colors from "@material-ui/core/colors";
|
|
|
|
|
|
|
|
|
|
|
|
import IconDelete from '@material-ui/icons/Delete';
|
|
|
|
import IconDelete from "@material-ui/icons/Delete";
|
|
|
|
import IconAdd from '@material-ui/icons/Add';
|
|
|
|
import IconAdd from "@material-ui/icons/Add";
|
|
|
|
import IconClear from '@material-ui/icons/Clear';
|
|
|
|
import IconClear from "@material-ui/icons/Clear";
|
|
|
|
import IconCancel from '@material-ui/icons/Clear';
|
|
|
|
import IconCancel from "@material-ui/icons/Clear";
|
|
|
|
import IconSave from '@material-ui/icons/Save';
|
|
|
|
import IconSave from "@material-ui/icons/Save";
|
|
|
|
|
|
|
|
|
|
|
|
import ConfirmationDialog from '../widgets/ConfirmationDialog';
|
|
|
|
import ConfirmationDialog from "../widgets/ConfirmationDialog";
|
|
|
|
|
|
|
|
|
|
|
|
import * as uuid from 'uuid';
|
|
|
|
import * as uuid from "uuid";
|
|
|
|
import * as ICAL from 'ical.js';
|
|
|
|
import * as ICAL from "ical.js";
|
|
|
|
|
|
|
|
|
|
|
|
import * as EteSync from 'etesync';
|
|
|
|
import * as EteSync from "etesync";
|
|
|
|
|
|
|
|
|
|
|
|
import { ContactType } from '../pim-types';
|
|
|
|
import { ContactType } from "../pim-types";
|
|
|
|
|
|
|
|
|
|
|
|
import { History } from 'history';
|
|
|
|
import { History } from "history";
|
|
|
|
|
|
|
|
|
|
|
|
const telTypes = [
|
|
|
|
const telTypes = [
|
|
|
|
{ type: 'Home' },
|
|
|
|
{ type: "Home" },
|
|
|
|
{ type: 'Work' },
|
|
|
|
{ type: "Work" },
|
|
|
|
{ type: 'Cell' },
|
|
|
|
{ type: "Cell" },
|
|
|
|
{ type: 'Other' },
|
|
|
|
{ type: "Other" },
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const emailTypes = telTypes;
|
|
|
|
const emailTypes = telTypes;
|
|
|
|
|
|
|
|
|
|
|
|
const addressTypes = [
|
|
|
|
const addressTypes = [
|
|
|
|
{ type: 'Home' },
|
|
|
|
{ type: "Home" },
|
|
|
|
{ type: 'Work' },
|
|
|
|
{ type: "Work" },
|
|
|
|
{ type: 'Other' },
|
|
|
|
{ type: "Other" },
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const imppTypes = [
|
|
|
|
const imppTypes = [
|
|
|
|
{ type: 'Jabber' },
|
|
|
|
{ type: "Jabber" },
|
|
|
|
{ type: 'Hangouts' },
|
|
|
|
{ type: "Hangouts" },
|
|
|
|
{ type: 'Other' },
|
|
|
|
{ type: "Other" },
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const TypeSelector = (props: any) => {
|
|
|
|
const TypeSelector = (props: any) => {
|
|
|
@ -70,8 +70,8 @@ class ValueType {
|
|
|
|
public value: string;
|
|
|
|
public value: string;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(type?: string, value?: string) {
|
|
|
|
constructor(type?: string, value?: string) {
|
|
|
|
this.type = type ? type : 'home';
|
|
|
|
this.type = type ? type : "home";
|
|
|
|
this.value = value ? value : '';
|
|
|
|
this.value = value ? value : "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -150,22 +150,22 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
constructor(props: any) {
|
|
|
|
constructor(props: any) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
uid: '',
|
|
|
|
uid: "",
|
|
|
|
fn: '',
|
|
|
|
fn: "",
|
|
|
|
lastName: '',
|
|
|
|
lastName: "",
|
|
|
|
firstName: '',
|
|
|
|
firstName: "",
|
|
|
|
middleName: '',
|
|
|
|
middleName: "",
|
|
|
|
namePrefix: '',
|
|
|
|
namePrefix: "",
|
|
|
|
nameSuffix: '',
|
|
|
|
nameSuffix: "",
|
|
|
|
phone: [new ValueType()],
|
|
|
|
phone: [new ValueType()],
|
|
|
|
email: [new ValueType()],
|
|
|
|
email: [new ValueType()],
|
|
|
|
address: [new ValueType()],
|
|
|
|
address: [new ValueType()],
|
|
|
|
impp: [new ValueType('jabber')],
|
|
|
|
impp: [new ValueType("jabber")],
|
|
|
|
org: '',
|
|
|
|
org: "",
|
|
|
|
note: '',
|
|
|
|
note: "",
|
|
|
|
title: '',
|
|
|
|
title: "",
|
|
|
|
|
|
|
|
|
|
|
|
journalUid: '',
|
|
|
|
journalUid: "",
|
|
|
|
showDeleteDialog: false,
|
|
|
|
showDeleteDialog: false,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -173,7 +173,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
const contact = this.props.item;
|
|
|
|
const contact = this.props.item;
|
|
|
|
|
|
|
|
|
|
|
|
this.state.uid = contact.uid;
|
|
|
|
this.state.uid = contact.uid;
|
|
|
|
this.state.fn = contact.fn ? contact.fn : '';
|
|
|
|
this.state.fn = contact.fn ? contact.fn : "";
|
|
|
|
if (contact.n) {
|
|
|
|
if (contact.n) {
|
|
|
|
this.state.lastName = contact.n[0];
|
|
|
|
this.state.lastName = contact.n[0];
|
|
|
|
this.state.firstName = contact.n[1];
|
|
|
|
this.state.firstName = contact.n[1];
|
|
|
@ -181,18 +181,18 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
this.state.namePrefix = contact.n[3];
|
|
|
|
this.state.namePrefix = contact.n[3];
|
|
|
|
this.state.nameSuffix = contact.n[4];
|
|
|
|
this.state.nameSuffix = contact.n[4];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let name = this.state.fn.trim().split(',');
|
|
|
|
let name = this.state.fn.trim().split(",");
|
|
|
|
if (name.length > 2 && name[0] !== '' && name[name.length - 1] !== '') {
|
|
|
|
if (name.length > 2 && name[0] !== "" && name[name.length - 1] !== "") {
|
|
|
|
this.state.nameSuffix = name.pop() || '';
|
|
|
|
this.state.nameSuffix = name.pop() || "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
name = name.join(',').split(' ');
|
|
|
|
name = name.join(",").split(" ");
|
|
|
|
if (name.length === 1) {
|
|
|
|
if (name.length === 1) {
|
|
|
|
this.state.firstName = name[0];
|
|
|
|
this.state.firstName = name[0];
|
|
|
|
} else if (name.length === 2) {
|
|
|
|
} else if (name.length === 2) {
|
|
|
|
this.state.firstName = name[0];
|
|
|
|
this.state.firstName = name[0];
|
|
|
|
this.state.lastName = name[1];
|
|
|
|
this.state.lastName = name[1];
|
|
|
|
} else if (name.length > 2) {
|
|
|
|
} else if (name.length > 2) {
|
|
|
|
this.state.firstName = name.slice(0, name.length - 2).join(' ');
|
|
|
|
this.state.firstName = name.slice(0, name.length - 2).join(" ");
|
|
|
|
this.state.middleName = name[name.length - 2];
|
|
|
|
this.state.middleName = name[name.length - 2];
|
|
|
|
this.state.lastName = name[name.length - 1];
|
|
|
|
this.state.lastName = name[name.length - 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -208,19 +208,19 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
))
|
|
|
|
))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
this.state.phone = propToValueType(contact.comp, 'tel');
|
|
|
|
this.state.phone = propToValueType(contact.comp, "tel");
|
|
|
|
this.state.email = propToValueType(contact.comp, 'email');
|
|
|
|
this.state.email = propToValueType(contact.comp, "email");
|
|
|
|
this.state.address = propToValueType(contact.comp, 'adr');
|
|
|
|
this.state.address = propToValueType(contact.comp, "adr");
|
|
|
|
this.state.impp = propToValueType(contact.comp, 'impp');
|
|
|
|
this.state.impp = propToValueType(contact.comp, "impp");
|
|
|
|
|
|
|
|
|
|
|
|
const propToStringType = (comp: ICAL.Component, propName: string) => {
|
|
|
|
const propToStringType = (comp: ICAL.Component, propName: string) => {
|
|
|
|
const val = comp.getFirstPropertyValue(propName);
|
|
|
|
const val = comp.getFirstPropertyValue(propName);
|
|
|
|
return val ? val : '';
|
|
|
|
return val ? val : "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this.state.org = propToStringType(contact.comp, 'org');
|
|
|
|
this.state.org = propToStringType(contact.comp, "org");
|
|
|
|
this.state.title = propToStringType(contact.comp, 'title');
|
|
|
|
this.state.title = propToStringType(contact.comp, "title");
|
|
|
|
this.state.note = propToStringType(contact.comp, 'note');
|
|
|
|
this.state.note = propToStringType(contact.comp, "note");
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.state.uid = uuid.v4();
|
|
|
|
this.state.uid = uuid.v4();
|
|
|
@ -241,7 +241,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public addValueType(name: string, _type?: string) {
|
|
|
|
public addValueType(name: string, _type?: string) {
|
|
|
|
const type = _type ? _type : 'home';
|
|
|
|
const type = _type ? _type : "home";
|
|
|
|
this.setState((prevState) => {
|
|
|
|
this.setState((prevState) => {
|
|
|
|
const newArray = prevState[name].slice(0);
|
|
|
|
const newArray = prevState[name].slice(0);
|
|
|
|
newArray.push(new ValueType(type));
|
|
|
|
newArray.push(new ValueType(type));
|
|
|
@ -293,14 +293,14 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
const contact = (this.props.item) ?
|
|
|
|
const contact = (this.props.item) ?
|
|
|
|
this.props.item.clone()
|
|
|
|
this.props.item.clone()
|
|
|
|
:
|
|
|
|
:
|
|
|
|
new ContactType(new ICAL.Component(['vcard', [], []]))
|
|
|
|
new ContactType(new ICAL.Component(["vcard", [], []]))
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
const comp = contact.comp;
|
|
|
|
const comp = contact.comp;
|
|
|
|
comp.updatePropertyWithValue('prodid', '-//iCal.js EteSync Web');
|
|
|
|
comp.updatePropertyWithValue("prodid", "-//iCal.js EteSync Web");
|
|
|
|
comp.updatePropertyWithValue('version', '4.0');
|
|
|
|
comp.updatePropertyWithValue("version", "4.0");
|
|
|
|
comp.updatePropertyWithValue('uid', this.state.uid);
|
|
|
|
comp.updatePropertyWithValue("uid", this.state.uid);
|
|
|
|
comp.updatePropertyWithValue('rev', ICAL.Time.now());
|
|
|
|
comp.updatePropertyWithValue("rev", ICAL.Time.now());
|
|
|
|
|
|
|
|
|
|
|
|
const lastName = this.state.lastName.trim();
|
|
|
|
const lastName = this.state.lastName.trim();
|
|
|
|
const firstName = this.state.firstName.trim();
|
|
|
|
const firstName = this.state.firstName.trim();
|
|
|
@ -310,13 +310,13 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
|
|
|
|
|
|
|
|
let fn = `${namePrefix} ${firstName} ${middleName} ${lastName}`.trim();
|
|
|
|
let fn = `${namePrefix} ${firstName} ${middleName} ${lastName}`.trim();
|
|
|
|
|
|
|
|
|
|
|
|
if (fn === '') {
|
|
|
|
if (fn === "") {
|
|
|
|
fn = nameSuffix;
|
|
|
|
fn = nameSuffix;
|
|
|
|
} else if (nameSuffix !== '') {
|
|
|
|
} else if (nameSuffix !== "") {
|
|
|
|
fn = `${fn}, ${nameSuffix}`;
|
|
|
|
fn = `${fn}, ${nameSuffix}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
comp.updatePropertyWithValue('fn', fn);
|
|
|
|
comp.updatePropertyWithValue("fn", fn);
|
|
|
|
|
|
|
|
|
|
|
|
const name = [lastName,
|
|
|
|
const name = [lastName,
|
|
|
|
firstName,
|
|
|
|
firstName,
|
|
|
@ -325,39 +325,39 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
nameSuffix,
|
|
|
|
nameSuffix,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
comp.updatePropertyWithValue('n', name);
|
|
|
|
comp.updatePropertyWithValue("n", name);
|
|
|
|
|
|
|
|
|
|
|
|
function setProperties(name: string, source: ValueType[]) {
|
|
|
|
function setProperties(name: string, source: ValueType[]) {
|
|
|
|
comp.removeAllProperties(name);
|
|
|
|
comp.removeAllProperties(name);
|
|
|
|
source.forEach((x) => {
|
|
|
|
source.forEach((x) => {
|
|
|
|
if (x.value === '') {
|
|
|
|
if (x.value === "") {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const prop = new ICAL.Property(name, comp);
|
|
|
|
const prop = new ICAL.Property(name, comp);
|
|
|
|
prop.setParameter('type', x.type);
|
|
|
|
prop.setParameter("type", x.type);
|
|
|
|
prop.setValue(x.value);
|
|
|
|
prop.setValue(x.value);
|
|
|
|
comp.addProperty(prop);
|
|
|
|
comp.addProperty(prop);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setProperties('tel', this.state.phone);
|
|
|
|
setProperties("tel", this.state.phone);
|
|
|
|
setProperties('email', this.state.email);
|
|
|
|
setProperties("email", this.state.email);
|
|
|
|
setProperties('adr', this.state.address);
|
|
|
|
setProperties("adr", this.state.address);
|
|
|
|
setProperties('impp', this.state.impp.map((x) => (
|
|
|
|
setProperties("impp", this.state.impp.map((x) => (
|
|
|
|
{ type: x.type, value: x.type + ':' + x.value }
|
|
|
|
{ type: x.type, value: x.type + ":" + x.value }
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
|
|
|
|
|
|
|
|
function setProperty(name: string, value: string) {
|
|
|
|
function setProperty(name: string, value: string) {
|
|
|
|
comp.removeAllProperties(name);
|
|
|
|
comp.removeAllProperties(name);
|
|
|
|
if (value !== '') {
|
|
|
|
if (value !== "") {
|
|
|
|
comp.updatePropertyWithValue(name, value);
|
|
|
|
comp.updatePropertyWithValue(name, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setProperty('org', this.state.org);
|
|
|
|
setProperty("org", this.state.org);
|
|
|
|
setProperty('title', this.state.title);
|
|
|
|
setProperty("title", this.state.title);
|
|
|
|
setProperty('note', this.state.note);
|
|
|
|
setProperty("note", this.state.note);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.props.onSave(contact, this.state.journalUid, this.props.item)
|
|
|
|
this.props.onSave(contact, this.state.journalUid, this.props.item)
|
|
|
@ -377,20 +377,20 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fullWidth: {
|
|
|
|
fullWidth: {
|
|
|
|
width: '100%',
|
|
|
|
width: "100%",
|
|
|
|
boxSizing: 'border-box' as any,
|
|
|
|
boxSizing: "border-box" as any,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
submit: {
|
|
|
|
submit: {
|
|
|
|
marginTop: 40,
|
|
|
|
marginTop: 40,
|
|
|
|
marginBottom: 20,
|
|
|
|
marginBottom: 20,
|
|
|
|
textAlign: 'right' as any,
|
|
|
|
textAlign: "right" as any,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
|
|
|
<React.Fragment>
|
|
|
|
<h2>
|
|
|
|
<h2>
|
|
|
|
{this.props.item ? 'Edit Contact' : 'New Contact'}
|
|
|
|
{this.props.item ? "Edit Contact" : "New Contact"}
|
|
|
|
</h2>
|
|
|
|
</h2>
|
|
|
|
<form style={styles.form} onSubmit={this.onSubmit}>
|
|
|
|
<form style={styles.form} onSubmit={this.onSubmit}>
|
|
|
|
<FormControl disabled={this.props.item !== undefined} style={styles.fullWidth}>
|
|
|
|
<FormControl disabled={this.props.item !== undefined} style={styles.fullWidth}>
|
|
|
@ -411,7 +411,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<TextField
|
|
|
|
<TextField
|
|
|
|
name="namePrefix"
|
|
|
|
name="namePrefix"
|
|
|
|
placeholder="Prefix"
|
|
|
|
placeholder="Prefix"
|
|
|
|
style={{ marginTop: '2rem', ...styles.fullWidth }}
|
|
|
|
style={{ marginTop: "2rem", ...styles.fullWidth }}
|
|
|
|
value={this.state.namePrefix}
|
|
|
|
value={this.state.namePrefix}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -419,7 +419,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<TextField
|
|
|
|
<TextField
|
|
|
|
name="firstName"
|
|
|
|
name="firstName"
|
|
|
|
placeholder="First name"
|
|
|
|
placeholder="First name"
|
|
|
|
style={{ marginTop: '2rem', ...styles.fullWidth }}
|
|
|
|
style={{ marginTop: "2rem", ...styles.fullWidth }}
|
|
|
|
value={this.state.firstName}
|
|
|
|
value={this.state.firstName}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -427,7 +427,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<TextField
|
|
|
|
<TextField
|
|
|
|
name="middleName"
|
|
|
|
name="middleName"
|
|
|
|
placeholder="Middle name"
|
|
|
|
placeholder="Middle name"
|
|
|
|
style={{ marginTop: '2rem', ...styles.fullWidth }}
|
|
|
|
style={{ marginTop: "2rem", ...styles.fullWidth }}
|
|
|
|
value={this.state.middleName}
|
|
|
|
value={this.state.middleName}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -435,7 +435,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<TextField
|
|
|
|
<TextField
|
|
|
|
name="lastName"
|
|
|
|
name="lastName"
|
|
|
|
placeholder="Last name"
|
|
|
|
placeholder="Last name"
|
|
|
|
style={{ marginTop: '2rem', ...styles.fullWidth }}
|
|
|
|
style={{ marginTop: "2rem", ...styles.fullWidth }}
|
|
|
|
value={this.state.lastName}
|
|
|
|
value={this.state.lastName}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -443,7 +443,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<TextField
|
|
|
|
<TextField
|
|
|
|
name="nameSuffix"
|
|
|
|
name="nameSuffix"
|
|
|
|
placeholder="Suffix"
|
|
|
|
placeholder="Suffix"
|
|
|
|
style={{ marginTop: '2rem', ...styles.fullWidth }}
|
|
|
|
style={{ marginTop: "2rem", ...styles.fullWidth }}
|
|
|
|
value={this.state.nameSuffix}
|
|
|
|
value={this.state.nameSuffix}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
onChange={this.handleInputChange}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -451,7 +451,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
Phone numbers
|
|
|
|
Phone numbers
|
|
|
|
<IconButton
|
|
|
|
<IconButton
|
|
|
|
onClick={() => this.addValueType('phone')}
|
|
|
|
onClick={() => this.addValueType("phone")}
|
|
|
|
title="Add phone number"
|
|
|
|
title="Add phone number"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<IconAdd />
|
|
|
|
<IconAdd />
|
|
|
@ -474,7 +474,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
Emails
|
|
|
|
Emails
|
|
|
|
<IconButton
|
|
|
|
<IconButton
|
|
|
|
onClick={() => this.addValueType('email')}
|
|
|
|
onClick={() => this.addValueType("email")}
|
|
|
|
title="Add email address"
|
|
|
|
title="Add email address"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<IconAdd />
|
|
|
|
<IconAdd />
|
|
|
@ -497,7 +497,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
IMPP
|
|
|
|
IMPP
|
|
|
|
<IconButton
|
|
|
|
<IconButton
|
|
|
|
onClick={() => this.addValueType('impp', 'jabber')}
|
|
|
|
onClick={() => this.addValueType("impp", "jabber")}
|
|
|
|
title="Add impp address"
|
|
|
|
title="Add impp address"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<IconAdd />
|
|
|
|
<IconAdd />
|
|
|
@ -520,7 +520,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
Addresses
|
|
|
|
Addresses
|
|
|
|
<IconButton
|
|
|
|
<IconButton
|
|
|
|
onClick={() => this.addValueType('address')}
|
|
|
|
onClick={() => this.addValueType("address")}
|
|
|
|
title="Add address"
|
|
|
|
title="Add address"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<IconAdd />
|
|
|
|
<IconAdd />
|
|
|
@ -578,7 +578,7 @@ class ContactEdit extends React.PureComponent<PropsType> {
|
|
|
|
{this.props.item &&
|
|
|
|
{this.props.item &&
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
variant="contained"
|
|
|
|
variant="contained"
|
|
|
|
style={{ marginLeft: 15, backgroundColor: colors.red[500], color: 'white' }}
|
|
|
|
style={{ marginLeft: 15, backgroundColor: colors.red[500], color: "white" }}
|
|
|
|
onClick={this.onDeleteRequest}
|
|
|
|
onClick={this.onDeleteRequest}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<IconDelete style={{ marginRight: 8 }} />
|
|
|
|
<IconDelete style={{ marginRight: 8 }} />
|
|
|
|