Lower the frequency of the respectful tips
Replace the icon with `Not helpful` text for dismiss
Change-Id: I0ad3472eeeb65fc545819e53ec58a9c23098ca30
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js
index 6f1eaa8..252f409 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.js
@@ -60,11 +60,12 @@
* All candidates tips to show, will pick randomly.
*/
const RESPECTFUL_REVIEW_TIPS= [
- 'DO: Assume competence.',
- 'DO: Provide rationale or context.',
- 'DO: Consider how comments may be interpreted.',
- 'DON’T: Criticize the person.',
- 'DON’T: Use harsh language.',
+ 'Assume competence.',
+ 'Provide rationale or context.',
+ 'Consider how comments may be interpreted.',
+ 'Avoid harsh language.',
+ 'Make your comments specific and actionable.',
+ 'When disagreeing, explain the advantage of your approach.',
];
/**
@@ -294,8 +295,8 @@
'respectful-tip-dismissed',
{tip: this._respectfulReviewTip}
);
- // add a 3 day delay to the tip cache
- this.$.storage.setRespectfulTipVisibility(/* delayDays= */ 3);
+ // add a 14-day delay to the tip cache
+ this.$.storage.setRespectfulTipVisibility(/* delayDays= */ 14);
}
_onRespectfulReadMoreClick() {
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js
index 4a0f388..6c9ebee 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_html.js
@@ -282,7 +282,7 @@
<a tabindex="-1" on-click="_onRespectfulReadMoreClick" href="https://testing.googleblog.com/2019/11/code-health-respectful-reviews-useful.html" target="_blank">
Read more
</a>
- <iron-icon class="close pointer" on-click="_dismissRespectfulTip" icon="gr-icons:close"></iron-icon>
+ <a tabindex="-1" class="close pointer" on-click="_dismissRespectfulTip">Not helpful</a>
</div>
</div>
</template>
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html
index 756e6fd..33f19c5 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.html
@@ -1161,7 +1161,7 @@
});
});
- test('add 3 day delays once dismissed', done => {
+ test('add 14-day delays once dismissed', done => {
// fake stub for storage
const respectfulGetStub = sinon.stub();
const respectfulSetStub = sinon.stub();
@@ -1185,7 +1185,7 @@
MockInteractions.tap(element.shadowRoot
.querySelector('.respectfulReviewTip .close'));
flushAsynchronousOperations();
- assert.isTrue(respectfulSetStub.lastCall.args[0] === 3);
+ assert.isTrue(respectfulSetStub.lastCall.args[0] === 14);
done();
});
});
diff --git a/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js b/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js
index 1597439..8f5c486 100644
--- a/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js
+++ b/polygerrit-ui/app/elements/shared/gr-storage/gr-storage.js
@@ -26,8 +26,8 @@
const CLEANUP_THROTTLE_INTERVAL = DURATION_DAY;
const CLEANUP_PREFIXES_MAX_AGE_MAP = {
- // respectfultip has a 3 day expiration
- 'respectfultip:': 3 * DURATION_DAY,
+ // respectfultip has a 14-day expiration
+ 'respectfultip:': 14 * DURATION_DAY,
'draft:': DURATION_DAY,
'editablecontent:': DURATION_DAY,
};