Skip to content

Commit 012fa3e

Browse files
authored
Merge pull request #120 from TinkoffCreditSystems/bugfix/119
[#119] fixed bug 119 with estimate WIP-limits by Customer Field of Multivalue field
2 parents 0bfb47c + a7d40a6 commit 012fa3e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/field-limits/BoardPage/index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ export default class FieldLimitsSettingsPage extends PageModification {
145145
return someSwimline.getAttribute('aria-label').indexOf('custom:') !== -1;
146146
}
147147

148+
getExtraFieldHasValue(exField, value) {
149+
let result = false;
150+
if (exField.childNodes instanceof NodeList) {
151+
exField.childNodes.forEach(el => {
152+
result = result || el.innerText.indexOf(value) > -1;
153+
});
154+
}
155+
return result;
156+
}
157+
148158
countAmountPersonalIssuesInColumn(column, stats, swimlaneId) {
149159
const { columnId } = column.dataset;
150160

@@ -157,11 +167,13 @@ export default class FieldLimitsSettingsPage extends PageModification {
157167
if (!stat.columns.includes(columnId)) return;
158168
if (swimlaneId && !stat.swimlanes.includes(swimlaneId)) return;
159169

170+
const fieldNameSt = this.normalizedExtraFields.byId[stat.fieldId].name;
171+
160172
for (const exField of extraFieldsForIssue) {
161173
const tooltipAttr = exField.getAttribute('data-tooltip');
162-
const expectedTooltipAttrValue = `${this.normalizedExtraFields.byId[stat.fieldId].name}: ${stat.fieldValue}`;
174+
const fieldName = tooltipAttr.split(':')[0];
163175

164-
if (tooltipAttr && tooltipAttr === expectedTooltipAttrValue) {
176+
if (fieldName === fieldNameSt && this.getExtraFieldHasValue(exField, stat.fieldValue)) {
165177
stats[fieldLimitKey].issues.push(issue);
166178
}
167179
}

0 commit comments

Comments
 (0)