Skip to content
Snippets Groups Projects
Unverified Commit e29c0ab8 authored by Michael Lunøe's avatar Michael Lunøe
Browse files

Merge branch...

Merge branch '417446-build-interim-solution-for-conflicting-settings-page-titles-in-the-pinned-section' into 'master' 

Rename ambiguosly named settings in pinned section

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130840



Merged-by: default avatarMichael Lunøe <michael.lunoe@gmail.com>
Approved-by: default avatarSascha Eggenberger <seggenberger@gitlab.com>
Approved-by: default avatarMichael Lunøe <michael.lunoe@gmail.com>
Approved-by: default avatarNataliia Radina <nradina@gitlab.com>
Co-authored-by: default avatarThomas Hutterer <thutterer@gitlab.com>
parents 805c5209 d851d07d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,6 +6,13 @@ import { SIDEBAR_PINS_EXPANDED_COOKIE, SIDEBAR_COOKIE_EXPIRATION } from '../cons
import MenuSection from './menu_section.vue';
import NavItem from './nav_item.vue';
 
const AMBIGUOUS_SETTINGS = {
ci_cd: s__('Navigation|CI/CD settings'),
merge_request_settings: s__('Navigation|Merge requests settings'),
monitor: s__('Navigation|Monitor settings'),
repository: s__('Navigation|Repository settings'),
};
export default {
i18n: {
pinned: s__('Navigation|Pinned'),
Loading
Loading
@@ -32,7 +39,7 @@ export default {
data() {
return {
expanded: getCookie(SIDEBAR_PINS_EXPANDED_COOKIE) !== 'false',
draggableItems: this.items,
draggableItems: this.renameSettings(this.items),
};
},
computed: {
Loading
Loading
@@ -58,7 +65,7 @@ export default {
});
},
items(newItems) {
this.draggableItems = newItems;
this.draggableItems = this.renameSettings(newItems);
},
},
methods: {
Loading
Loading
@@ -71,6 +78,12 @@ export default {
event.oldIndex < event.newIndex,
);
},
renameSettings(items) {
return items.map((i) => {
const title = AMBIGUOUS_SETTINGS[i.id] || i.title;
return { ...i, title };
});
},
},
};
</script>
Loading
Loading
Loading
Loading
@@ -30916,6 +30916,9 @@ msgstr ""
msgid "Navigation|Build"
msgstr ""
 
msgid "Navigation|CI/CD settings"
msgstr ""
msgid "Navigation|Code"
msgstr ""
 
Loading
Loading
@@ -30952,9 +30955,15 @@ msgstr ""
msgid "Navigation|Manage"
msgstr ""
 
msgid "Navigation|Merge requests settings"
msgstr ""
msgid "Navigation|Monitor"
msgstr ""
 
msgid "Navigation|Monitor settings"
msgstr ""
msgid "Navigation|No group matches found"
msgstr ""
 
Loading
Loading
@@ -30979,6 +30988,9 @@ msgstr ""
msgid "Navigation|Projects you visit often will appear here."
msgstr ""
 
msgid "Navigation|Repository settings"
msgstr ""
msgid "Navigation|Retrieving search results"
msgstr ""
 
Loading
Loading
@@ -87,4 +87,33 @@ describe('PinnedSection component', () => {
});
});
});
describe('ambiguous settings names', () => {
it('get renamed to be unambiguous', () => {
createWrapper({
items: [
{ title: 'CI/CD', id: 'ci_cd' },
{ title: 'Merge requests', id: 'merge_request_settings' },
{ title: 'Monitor', id: 'monitor' },
{ title: 'Repository', id: 'repository' },
{ title: 'Repository', id: 'code' },
{ title: 'Something else', id: 'not_a_setting' },
],
});
expect(
wrapper
.findComponent(MenuSection)
.props('item')
.items.map((i) => i.title),
).toEqual([
'CI/CD settings',
'Merge requests settings',
'Monitor settings',
'Repository settings',
'Repository',
'Something else',
]);
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment