Fix linkification in message list

In Ic07b4f1833 linkification in the reply dialog was fixed by correcting
the way project configs are passed into the comment list, but had the
accidental effect of breaking comments lists in messages.

With this change, now both users of gr-comment-list provide the project
config in the same way.

Change-Id: I3537a05a737fd8030f920fc1028ffd1992617270
This commit is contained in:
Wyatt Allen
2017-11-15 15:08:02 -08:00
parent 11cc78742b
commit bd669e1b18
2 changed files with 4 additions and 5 deletions

View File

@@ -165,7 +165,7 @@ limitations under the License.
no-trailing-margin no-trailing-margin
class="message hideOnCollapsed" class="message hideOnCollapsed"
content="[[message.message]]" content="[[message.message]]"
config="[[_commentLinks]]"></gr-formatted-text> config="[[_projectConfig.commentlinks]]"></gr-formatted-text>
<div class="replyContainer" hidden$="[[!showReplyButton]]" hidden> <div class="replyContainer" hidden$="[[!showReplyButton]]" hidden>
<gr-button link small on-tap="_handleReplyTap">Reply</gr-button> <gr-button link small on-tap="_handleReplyTap">Reply</gr-button>
</div> </div>
@@ -174,7 +174,7 @@ limitations under the License.
change-num="[[changeNum]]" change-num="[[changeNum]]"
patch-num="[[message._revision_number]]" patch-num="[[message._revision_number]]"
project-name="[[projectName]]" project-name="[[projectName]]"
comment-links="[[_commentLinks]]"></gr-comment-list> project-config="[[_projectConfig]]"></gr-comment-list>
</div> </div>
</template> </template>
<template is="dom-if" if="[[_computeIsReviewerUpdate(message)]]"> <template is="dom-if" if="[[_computeIsReviewerUpdate(message)]]">

View File

@@ -79,11 +79,10 @@
type: String, type: String,
observer: '_projectNameChanged', observer: '_projectNameChanged',
}, },
_commentLinks: Object,
/** /**
* @type {{ commentlinks: Array }} * @type {{ commentlinks: Array }}
*/ */
projectConfig: Object, _projectConfig: Object,
// Computed property needed to trigger Polymer value observing. // Computed property needed to trigger Polymer value observing.
_expanded: { _expanded: {
type: Object, type: Object,
@@ -239,7 +238,7 @@
_projectNameChanged(name) { _projectNameChanged(name) {
this.$.restAPI.getProjectConfig(name).then(config => { this.$.restAPI.getProjectConfig(name).then(config => {
this._commentLinks = config.commentlinks; this._projectConfig = config;
}); });
}, },
}); });