value={JSON.stringify(employee)}
фактически у вас там содержится строка (String). div className="form-group">
<Field component={"select"} className="form-control" name="employee" aria-describedby="employeeHelp">
<option />
{this.props.employees.map(employee => {
if (employee) {
return (
<option key={employee.id} value={JSON.stringify(employee)}>{employee.fullName}</option>
);
}
else return null;
})}
</Field>
<small className="form-text text-muted" id="employeeHelp">Сотрудник</small>
</div>
parser
в options. Скорее всего это должно сработать <option key={employee.id} value={JSON.stringify(employee)} parse={(val, name)=>JSON.parse(val)}>{employee.fullName}</option>
value={employee.id}
и поиск фактического значения в this.props.employees.find(e=>e.id === employee)
перед отправкой формы. MongoClient mongo = new MongoClient("localhost", 27017);
MongoDatabase db = mongo.getDatabase("testDb");
BasicDBObject command = new BasicDBObject();
command.put("createUser", "testUser");
command.put("pwd", "testPassword");
command.put("roles", new String[]{"readWrite"});
db.runCommand(command);
[guest@localhost ~]$ s='hello allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> hello'
[guest@localhost ~]$
[guest@localhost ~]$ src='allow="127\\\.\\d+\\\.\\d+\\\.\\d+|::1|0:0:0:0:0:0:0:1" />'
[guest@localhost ~]$ dst='allow="^.\\*$" />'
[guest@localhost ~]$
[guest@localhost ~]$ echo "$s"
hello allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> hello
[guest@localhost ~]$
[guest@localhost ~]$ echo "$src"
allow="127\\\.\\d+\\\.\\d+\\\.\\d+|::1|0:0:0:0:0:0:0:1" />
[guest@localhost ~]$
[guest@localhost ~]$ echo "$dst"
allow="^.\\*$" />
[guest@localhost ~]$
[guest@localhost ~]$ echo "$s" | sed "s%$src%$dst%g"
hello allow="^.\*$" /> hello
[guest@localhost ~]$
private void runCmdWithProgress(String... args) throws IOException {
Process proc = Runtime.getRuntime().exec(args);
InputStream inputStream = proc.getErrorStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String s = null;
while ((s = bufferedReader.readLine()) != null) {
Double progress = Double.parseDouble(s.split("%")[0]) / 100;
Platform.runLater(() -> tab_adb_progressbar.setProgress(progress));
}
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
new Thread(() -> {
try {
runCmdWithProgress(commands);
Platform.runLater(() -> showDialogInformation(positive);
} catch (IOException e) {
e.printStackTrace();
}
}).start();
Platform.runLater(() -> progress.setProgress( step / size ));