Skip to content

Commit 4adf02f

Browse files
committed
Merge branch 'list-dict-message-tooltip' into 'develop-2.0'
Correct attribute message lookup; fix list and dict tooltips See merge request weblogic-cloud/weblogic-toolkit-ui!432
2 parents aab3d3a + 7f3ebb4 commit 4adf02f

File tree

3 files changed

+47
-15
lines changed

3 files changed

+47
-15
lines changed

webui/src/js/utils/modelEdit/message-helper.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,22 @@ function (ko, i18n, AliasHelper) {
328328
function hasAssignedAttributeMessage(attribute, suffix, aliasPath) {
329329
// look for attribute-specific message only
330330
const key = getAttributeKey(attribute.name);
331+
const lastFolder = aliasPath[aliasPath.length - 1];
331332
const folderPrefix = getFolderPrefix(aliasPath);
332-
const folderAttributeKey = `${folderPrefix}-a-${key}-${suffix}`;
333-
const attributeKey = `a-${key}-${suffix}`;
334-
return messageKeys.includes(folderAttributeKey) || messageKeys.includes(attributeKey);
333+
334+
const matchKeys = [
335+
`${folderPrefix}-a-${key}-${suffix}`, // specific to folder + attribute
336+
`f-any_${lastFolder}-a-${key}-${suffix}`, // specific to last folder + attribute
337+
`a-${key}-${suffix}`, // specific to attribute
338+
`${folderPrefix}-a-any-${suffix}` // specific to folder
339+
];
340+
341+
for (const matchKey of matchKeys) {
342+
if(messageKeys.includes(matchKey)) {
343+
return true;
344+
}
345+
}
346+
return false;
335347
}
336348

337349
function getReadableLabel(name) {

webui/src/js/views/modelEdit/dict-attribute-editor.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,28 @@
2222
<td><oj-bind-text value="[[row.data.name]]"></oj-bind-text></td>
2323
<td><oj-bind-text value="[[row.data.value]]"></oj-bind-text></td>
2424
<td>
25-
<oj-button display="icons" chroming="borderless" on-oj-action="[[deleteItem]]" disabled="[[disabled]]">
25+
<oj-c-button
26+
display="icons"
27+
label="[[deleteLabel]]"
28+
chroming="borderless"
29+
on-oj-action="[[deleteItem]]"
30+
disabled="[[disabled]]"
31+
>
2632
<span slot="endIcon" class="oj-ux-ico-trash"></span>
27-
<oj-bind-text value="[[deleteLabel]]"></oj-bind-text>
28-
</oj-button>
33+
</oj-c-button>
2934
</td>
3035
</tr>
3136
</template>
3237
<template slot="headerTemplate" data-oj-as="header">
33-
<oj-button display="icons" chroming="borderless" on-oj-action="[[addItem]]" disabled="[[disabled]]">
38+
<oj-c-button
39+
display="icons"
40+
label="[[addLabel]]"
41+
chroming="borderless"
42+
on-oj-action="[[addItem]]"
43+
disabled="[[disabled]]"
44+
>
3445
<span slot="endIcon" class="oj-ux-ico-plus"></span>
35-
<oj-bind-text value="[[addLabel]]"></oj-bind-text>
36-
</oj-button>
46+
</oj-c-button>
3747
</template>
3848
<template slot="noData">
3949
<div class="wkt-model-edit-table-no-data"><oj-bind-text value="[[noDataLabel]]"></oj-bind-text></div>

webui/src/js/views/modelEdit/list-attribute-editor.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,28 @@
1818
<tr data-bind="attr: {'data-uid': row.data.uid}">
1919
<td><oj-bind-text value="[[row.data.name]]"></oj-bind-text></td>
2020
<td>
21-
<oj-button display="icons" chroming="borderless" on-oj-action="[[deleteItem]]" disabled="[[disabled]]">
21+
<oj-c-button
22+
display="icons"
23+
label="[[deleteLabel]]"
24+
chroming="borderless"
25+
on-oj-action="[[deleteItem]]"
26+
disabled="[[disabled]]"
27+
>
2228
<span slot="endIcon" class="oj-ux-ico-trash"></span>
23-
<oj-bind-text value="[[deleteLabel]]"></oj-bind-text>
24-
</oj-button>
29+
</oj-c-button>
2530
</td>
2631
</tr>
2732
</template>
2833
<template slot="headerTemplate" data-oj-as="header">
29-
<oj-button display="icons" chroming="borderless" on-oj-action="[[addItem]]" disabled="[[disabled]]">
34+
<oj-c-button
35+
display="icons"
36+
label="[[addLabel]]"
37+
chroming="borderless"
38+
on-oj-action="[[addItem]]"
39+
disabled="[[disabled]]"
40+
>
3041
<span slot="endIcon" class="oj-ux-ico-plus"></span>
31-
<oj-bind-text value="[[addLabel]]"></oj-bind-text>
32-
</oj-button>
42+
</oj-c-button>
3343
</template>
3444
<template slot="noData">
3545
<div class="wkt-model-edit-table-no-data"><oj-bind-text value="[[noDataLabel]]"></oj-bind-text></div>

0 commit comments

Comments
 (0)