Commit a7804336 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '323950-improve-approvers-text' into 'master'

Improve approvers text

See merge request gitlab-org/gitlab!62657
parents 244e87d1 47478e05
...@@ -134,7 +134,11 @@ export default { ...@@ -134,7 +134,11 @@ export default {
<div ref="indicator" class="text-muted">{{ indicatorText(rule) }}</div> <div ref="indicator" class="text-muted">{{ indicatorText(rule) }}</div>
</td> </td>
<td class="js-members" :class="settings.allowMultiRule ? 'd-none d-sm-table-cell' : null"> <td class="js-members" :class="settings.allowMultiRule ? 'd-none d-sm-table-cell' : null">
<user-avatar-list :items="rule.approvers" :img-size="24" /> <user-avatar-list
:items="rule.approvers"
:img-size="24"
:empty-text="__('Approvers from private group(s) not shown')"
/>
</td> </td>
<td class="js-approvals-required"> <td class="js-approvals-required">
<rule-input :rule="rule" /> <rule-input :rule="rule" />
......
...@@ -33,7 +33,7 @@ describe('EE Approvals MRRules', () => { ...@@ -33,7 +33,7 @@ describe('EE Approvals MRRules', () => {
const findHeaders = () => wrapper.findAll('thead th').wrappers.map((x) => x.text()); const findHeaders = () => wrapper.findAll('thead th').wrappers.map((x) => x.text());
const findRuleName = () => wrapper.find('.js-name'); const findRuleName = () => wrapper.find('.js-name');
const findRuleIndicator = () => wrapper.find({ ref: 'indicator' }); const findRuleIndicator = () => wrapper.find({ ref: 'indicator' });
const findRuleMembers = () => wrapper.find('td.js-members').find(UserAvatarList).props('items'); const findAvatarList = () => wrapper.find(UserAvatarList);
const findRuleControls = () => wrapper.find('td.js-controls').find(RuleControls); const findRuleControls = () => wrapper.find('td.js-controls').find(RuleControls);
const callTargetBranchHandler = (MutationObserverSpy) => { const callTargetBranchHandler = (MutationObserverSpy) => {
const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0]; const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0];
...@@ -176,6 +176,13 @@ describe('EE Approvals MRRules', () => { ...@@ -176,6 +176,13 @@ describe('EE Approvals MRRules', () => {
expect(findHeaders()).toEqual([HEADERS.members, '', HEADERS.approvalsRequired, '']); expect(findHeaders()).toEqual([HEADERS.members, '', HEADERS.approvalsRequired, '']);
}); });
it('shows message if no approvers are visible', () => {
store.modules.approvals.state.rules = [createMRRule()];
factory();
expect(findAvatarList().props('emptyText')).toBe('Approvers from private group(s) not shown');
});
it('renders headers when there is a single named rule', () => { it('renders headers when there is a single named rule', () => {
store.modules.approvals.state.rules = [createMRRule()]; store.modules.approvals.state.rules = [createMRRule()];
factory(); factory();
...@@ -197,7 +204,7 @@ describe('EE Approvals MRRules', () => { ...@@ -197,7 +204,7 @@ describe('EE Approvals MRRules', () => {
}); });
it('shows members', () => { it('shows members', () => {
expect(findRuleMembers()).toEqual(expected.approvers); expect(findAvatarList().props('items')).toEqual(expected.approvers);
}); });
}); });
......
...@@ -4184,6 +4184,9 @@ msgstr "" ...@@ -4184,6 +4184,9 @@ msgstr ""
msgid "Approvers" msgid "Approvers"
msgstr "" msgstr ""
msgid "Approvers from private group(s) not shown"
msgstr ""
msgid "Apr" msgid "Apr"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment