Commit af261900 authored by Roman's avatar Roman

BRCD-1674 fix(Play) - improve 'addPlayToFieldTitle()' function by option to...

BRCD-1674 fix(Play) - improve 'addPlayToFieldTitle()' function by option to not pass play labes and use play Key
parent 7eb73286
......@@ -511,11 +511,11 @@ export const setFieldTitle = (field, entity, keyProperty = 'field_name') => {
return field.set('title', getFieldName(key, entityName, defaultLable));
};
export const addPlayToFieldTitle = (field, plays) => {
export const addPlayToFieldTitle = (field, plays = Immutable.Map()) => {
const fieldPlays = field.get('plays', Immutable.List());
if (!fieldPlays.isEmpty()) {
const fieldPlayLabels = fieldPlays.reduce(
(result, playName) => result.push(plays.get(playName, '')),
(result, playName) => result.push(plays.get(playName, playName)),
Immutable.List(),
).join(', ');
return field.set('title', `${field.get('title', '')} (${fieldPlayLabels})`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment