Commit ecb8a89b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '346436-add-placeholder-text-to-dropdown' into 'master'

Display empty text placeholder

See merge request gitlab-org/gitlab!75207
parents 1232abf2 bbf3f7fc
......@@ -30,6 +30,7 @@ export default {
description: s__(
'SecurityOrchestration|Select a project to store your security policies in. %{linkStart}More information.%{linkEnd}',
),
emptyPlaceholder: s__('SecurityOrchestration|Choose a project'),
},
components: {
GlButton,
......@@ -216,7 +217,7 @@ export default {
class="gl-w-full"
menu-class="gl-w-full! gl-max-w-full!"
:disabled="disableSecurityPolicyProject"
:text="selectedProjectName"
:text="selectedProjectName || $options.i18n.emptyPlaceholder"
>
<instance-project-selector
class="gl-w-full"
......
......@@ -99,6 +99,10 @@ describe('ScanNewPolicyModal Component', () => {
});
});
it('displays a placeholder when no project is selected', () => {
expect(findDropdown().props('text')).toBe('Choose a project');
});
it('does not display a warning', () => {
expect(findAlert().exists()).toBe(false);
});
......
......@@ -30953,6 +30953,9 @@ msgstr ""
msgid "SecurityOrchestration|An error occurred unassigning your security policy project"
msgstr ""
msgid "SecurityOrchestration|Choose a project"
msgstr ""
msgid "SecurityOrchestration|Description"
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