mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 19:00:12 +01:00
add custom field "stringtemplate"
This commit is contained in:
parent
769bb7a55d
commit
b8dc7ff18e
8 changed files with 104 additions and 2 deletions
|
|
@ -21,6 +21,23 @@ BlazeComponent.extendComponent({
|
|||
}).format(customFieldTrueValue);
|
||||
},
|
||||
|
||||
formattedStringtemplateCustomFieldValue(definition) {
|
||||
const customField = this.data()
|
||||
.customFieldsWD()
|
||||
.find(f => f._id === definition._id);
|
||||
|
||||
if(customField && customField.trueValue) {
|
||||
lines = customField.trueValue.replace(/\r\n|\n\r|\n|\r/g, '\n').split('\n');
|
||||
lines = lines.map(line =>
|
||||
definition.settings.stringtemplateFormat.replace(/%\{value\}/gi, line)
|
||||
);
|
||||
|
||||
return lines.join(' ');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue