Skip to content

Commit 552e85a

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent b0d6a7f commit 552e85a

File tree

40 files changed

+506
-314
lines changed

40 files changed

+506
-314
lines changed

.gitlab/CODEOWNERS

+22-20
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
459459
/doc/administration/operations/gitlab_sshd.md @aqualls
460460
/doc/administration/operations/moving_repositories.md @eread
461461
/doc/administration/package_information/ @axil
462-
/doc/administration/packages/ @dianalogan
462+
/doc/administration/packages/ @marcel.amirault
463463
/doc/administration/pages/ @ashrafkhamis
464464
/doc/administration/polling.md @axil
465465
/doc/administration/postgresql/ @aqualls
@@ -505,10 +505,10 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
505505
/doc/api/bulk_imports.md @eread
506506
/doc/api/cluster_agents.md @phillipwells
507507
/doc/api/commits.md @aqualls
508-
/doc/api/container_registry.md @dianalogan
508+
/doc/api/container_registry.md @marcel.amirault
509509
/doc/api/custom_attributes.md @msedlakjakubowski
510510
/doc/api/dependencies.md @rdickenson
511-
/doc/api/dependency_proxy.md @dianalogan
511+
/doc/api/dependency_proxy.md @marcel.amirault
512512
/doc/api/deploy_keys.md @rdickenson
513513
/doc/api/deploy_tokens.md @rdickenson
514514
/doc/api/deployments.md @rdickenson
@@ -587,8 +587,8 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
587587
/doc/api/notification_settings.md @msedlakjakubowski
588588
/doc/api/oauth2.md @jglassman1
589589
/doc/api/openapi/ @ashrafkhamis
590-
/doc/api/packages.md @dianalogan
591-
/doc/api/packages/ @dianalogan
590+
/doc/api/packages.md @marcel.amirault
591+
/doc/api/packages/ @marcel.amirault
592592
/doc/api/pages.md @ashrafkhamis
593593
/doc/api/pages_domains.md @ashrafkhamis
594594
/doc/api/personal_access_tokens.md @eread
@@ -648,7 +648,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
648648
/doc/api/usage_data.md @dianalogan
649649
/doc/api/users.md @jglassman1
650650
/doc/api/version.md @phillipwells
651-
/doc/api/visual_review_discussions.md @marcel.amirault
651+
/doc/api/visual_review_discussions.md @drcatherinepope
652652
/doc/api/vulnerabilities.md @dianalogan
653653
/doc/api/vulnerability_exports.md @dianalogan
654654
/doc/api/vulnerability_findings.md @dianalogan
@@ -665,30 +665,33 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
665665
/doc/ci/environments/ @rdickenson
666666
/doc/ci/examples/authenticating-with-hashicorp-vault/ @marcel.amirault
667667
/doc/ci/examples/deployment/ @rdickenson
668-
/doc/ci/examples/end_to_end_testing_webdriverio/ @marcel.amirault
669-
/doc/ci/examples/semantic-release.md @dianalogan
668+
/doc/ci/examples/semantic-release.md @marcel.amirault
670669
/doc/ci/interactive_web_terminal/ @fneill
671-
/doc/ci/jobs/job_control.md @marcel.amirault
670+
/doc/ci/introduction/ @marcel.amirault
671+
/doc/ci/jobs/ @marcel.amirault
672672
/doc/ci/large_repositories/ @fneill
673673
/doc/ci/lint.md @marcel.amirault
674674
/doc/ci/migration/ @marcel.amirault
675675
/doc/ci/pipeline_editor/ @marcel.amirault
676676
/doc/ci/pipelines/downstream_pipelines.md @marcel.amirault
677677
/doc/ci/pipelines/index.md @marcel.amirault
678678
/doc/ci/pipelines/job_artifacts.md @marcel.amirault
679+
/doc/ci/pipelines/pipeline_architectures.md @marcel.amirault
679680
/doc/ci/pipelines/pipeline_artifacts.md @marcel.amirault
680681
/doc/ci/quick_start/ @marcel.amirault
681682
/doc/ci/resource_groups/ @rdickenson
682-
/doc/ci/review_apps/ @marcel.amirault
683683
/doc/ci/runners/ @fneill
684684
/doc/ci/secrets/ @marcel.amirault
685685
/doc/ci/secure_files/ @marcel.amirault
686686
/doc/ci/services/ @fneill
687+
/doc/ci/ssh_keys/ @marcel.amirault
687688
/doc/ci/test_cases/ @msedlakjakubowski
688-
/doc/ci/testing/ @marcel.amirault
689689
/doc/ci/testing/code_quality.md @rdickenson
690+
/doc/ci/triggers/ @marcel.amirault
691+
/doc/ci/troubleshooting.md @marcel.amirault
690692
/doc/ci/variables/ @marcel.amirault
691693
/doc/ci/yaml/ @marcel.amirault
694+
/doc/ci/yaml/artifacts_reports.md @drcatherinepope
692695
/doc/development/application_limits.md @axil
693696
/doc/development/audit_event_guide/ @eread
694697
/doc/development/auto_devops.md @phillipwells
@@ -719,7 +722,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
719722
/doc/development/fe_guide/dark_mode.md @sselhorn
720723
/doc/development/fe_guide/graphql.md @sselhorn
721724
/doc/development/fe_guide/merge_request_widget_extensions.md @aqualls
722-
/doc/development/fe_guide/source_editor.md @ashrafkhamis
725+
/doc/development/fe_guide/source_editor.md @aqualls
723726
/doc/development/fe_guide/view_component.md @rdickenson
724727
/doc/development/feature_categorization/ @sselhorn
725728
/doc/development/feature_development.md @sselhorn
@@ -737,10 +740,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
737740
/doc/development/image_scaling.md @lciutacu
738741
/doc/development/import_export.md @eread
739742
/doc/development/index.md @sselhorn
740-
/doc/development/integrations/codesandbox.md @sselhorn
741-
/doc/development/integrations/index.md @ashrafkhamis
742-
/doc/development/integrations/jenkins.md @ashrafkhamis
743-
/doc/development/integrations/jira_connect.md @ashrafkhamis
743+
/doc/development/integrations/ @ashrafkhamis
744744
/doc/development/integrations/secure.md @rdickenson
745745
/doc/development/integrations/secure_partner_integration.md @rdickenson
746746
/doc/development/internal_api/ @aqualls
@@ -752,8 +752,10 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
752752
/doc/development/logging.md @msedlakjakubowski
753753
/doc/development/maintenance_mode.md @axil
754754
/doc/development/merge_request_concepts/ @aqualls
755+
/doc/development/migration_style_guide.md @aqualls
756+
/doc/development/navigation_sidebar.md @rdickenson
755757
/doc/development/omnibus.md @axil
756-
/doc/development/packages/ @dianalogan
758+
/doc/development/packages/ @marcel.amirault
757759
/doc/development/pages/ @ashrafkhamis
758760
/doc/development/permissions.md @jglassman1
759761
/doc/development/policies.md @jglassman1
@@ -856,7 +858,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
856858
/doc/user/admin_area/settings/incident_management_rate_limits.md @msedlakjakubowski
857859
/doc/user/admin_area/settings/index.md @aqualls
858860
/doc/user/admin_area/settings/instance_template_repository.md @aqualls
859-
/doc/user/admin_area/settings/package_registry_rate_limits.md @dianalogan
861+
/doc/user/admin_area/settings/package_registry_rate_limits.md @marcel.amirault
860862
/doc/user/admin_area/settings/project_integration_management.md @ashrafkhamis
861863
/doc/user/admin_area/settings/push_event_activities_limit.md @aqualls
862864
/doc/user/admin_area/settings/rate_limit_on_issues_creation.md @msedlakjakubowski
@@ -900,7 +902,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
900902
/doc/user/group/iterations/ @msedlakjakubowski
901903
/doc/user/group/planning_hierarchy/ @msedlakjakubowski
902904
/doc/user/group/reporting/ @phillipwells
903-
/doc/user/group/repositories_analytics/ @marcel.amirault
905+
/doc/user/group/repositories_analytics/ @drcatherinepope
904906
/doc/user/group/roadmap/ @msedlakjakubowski
905907
/doc/user/group/saml_sso/ @jglassman1
906908
/doc/user/group/settings/ @jglassman1
@@ -910,7 +912,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab
910912
/doc/user/namespace/ @lciutacu
911913
/doc/user/okrs.md @msedlakjakubowski
912914
/doc/user/operations_dashboard/ @rdickenson
913-
/doc/user/packages/ @dianalogan
915+
/doc/user/packages/ @marcel.amirault
914916
/doc/user/permissions.md @jglassman1
915917
/doc/user/product_analytics/ @lciutacu
916918
/doc/user/profile/ @jglassman1
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
<script>
2-
import { GlTokenSelector } from '@gitlab/ui';
2+
import {
3+
GlDropdown,
4+
GlDropdownDivider,
5+
GlDropdownItem,
6+
GlIcon,
7+
GlLoadingIcon,
8+
GlSearchBoxByType,
9+
} from '@gitlab/ui';
310
import { debounce } from 'lodash';
411
import { createAlert } from '~/flash';
512
import axios from '~/lib/utils/axios_utils';
6-
import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants';
713
import { __, sprintf } from '~/locale';
814
915
export default {
1016
components: {
11-
GlTokenSelector,
17+
GlDropdown,
18+
GlDropdownDivider,
19+
GlDropdownItem,
20+
GlSearchBoxByType,
21+
GlIcon,
22+
GlLoadingIcon,
1223
},
1324
inject: ['environmentsEndpoint'],
14-
props: {
15-
selected: {
16-
type: Array,
17-
required: true,
18-
},
19-
},
2025
data() {
2126
return {
2227
environmentSearch: '',
@@ -27,54 +32,24 @@ export default {
2732
translations: {
2833
addEnvironmentsLabel: __('Add environment'),
2934
noResultsLabel: __('No matching results'),
30-
loadingResultsLabel: __('Loading...'),
31-
allEnvironments: __('All environments'),
3235
},
3336
computed: {
3437
createEnvironmentLabel() {
3538
return sprintf(__('Create %{environment}'), { environment: this.environmentSearch });
3639
},
37-
selectedEnvironmentNames() {
38-
return this.selected.map(({ name }) => name);
39-
},
40-
dropdownItems() {
41-
return this.results.filter(({ name }) => !this.isSelected(name));
42-
},
43-
hasNoSearchResults() {
44-
return !this.dropdownItems.length;
45-
},
46-
searchItemAlreadySelected() {
47-
return this.isSelected(this.environmentSearch);
48-
},
49-
},
50-
created() {
51-
this.debouncedHandleSearch = debounce(this.handleSearch, DEFAULT_DEBOUNCE_AND_THROTTLE_MS);
52-
},
53-
destroyed() {
54-
this.debouncedHandleSearch.cancel();
5540
},
5641
methods: {
57-
isSelected(name) {
58-
return this.selectedEnvironmentNames.includes(name);
59-
},
60-
addEnvironment({ name }) {
61-
this.$emit('add', name);
62-
this.environmentSearch = '';
63-
},
64-
removeEnvironment({ name }) {
65-
this.$emit('remove', name);
42+
addEnvironment(newEnvironment) {
43+
this.$emit('add', newEnvironment);
6644
this.environmentSearch = '';
45+
this.results = [];
6746
},
68-
handleSearch(query = '') {
69-
this.environmentSearch = query;
70-
this.fetchEnvironments();
71-
},
72-
async fetchEnvironments() {
47+
fetchEnvironments: debounce(function debouncedFetchEnvironments() {
7348
this.isLoading = true;
74-
await axios
49+
axios
7550
.get(this.environmentsEndpoint, { params: { query: this.environmentSearch } })
76-
.then(({ data = [] }) => {
77-
this.results = data.map((text, index) => ({ id: index, name: text }));
51+
.then(({ data }) => {
52+
this.results = data || [];
7853
})
7954
.catch(() => {
8055
createAlert({
@@ -84,28 +59,44 @@ export default {
8459
.finally(() => {
8560
this.isLoading = false;
8661
});
62+
}, 250),
63+
setFocus() {
64+
this.$refs.searchBox.focusInput();
8765
},
8866
},
8967
};
9068
</script>
9169
<template>
92-
<gl-token-selector
93-
data-testid="new-environment-selector"
94-
:selected-tokens="selected"
95-
:label-text="$options.translations.addEnvironmentsLabel"
96-
:dropdown-items="dropdownItems"
97-
:loading="isLoading"
98-
:hide-dropdown-with-no-items="searchItemAlreadySelected && hasNoSearchResults"
99-
:allow-user-defined-tokens="!searchItemAlreadySelected"
100-
@focus.once="fetchEnvironments"
101-
@text-input="debouncedHandleSearch"
102-
@token-add="addEnvironment"
103-
@token-remove="removeEnvironment"
104-
>
105-
<template #user-defined-token-content>
106-
{{ createEnvironmentLabel }}
70+
<gl-dropdown class="js-new-environments-dropdown" @shown="setFocus">
71+
<template #button-content>
72+
<span class="d-md-none mr-1">
73+
{{ $options.translations.addEnvironmentsLabel }}
74+
</span>
75+
<gl-icon class="d-none d-md-inline-flex gl-mr-1" name="plus" />
76+
</template>
77+
<gl-search-box-by-type
78+
ref="searchBox"
79+
v-model.trim="environmentSearch"
80+
@focus="fetchEnvironments"
81+
@keyup="fetchEnvironments"
82+
/>
83+
<gl-loading-icon v-if="isLoading" size="sm" />
84+
<gl-dropdown-item
85+
v-for="environment in results"
86+
v-else-if="results.length"
87+
:key="environment"
88+
@click="addEnvironment(environment)"
89+
>
90+
{{ environment }}
91+
</gl-dropdown-item>
92+
<template v-else-if="environmentSearch.length">
93+
<span ref="noResults" class="text-secondary gl-p-3">
94+
{{ $options.translations.noMatchingResults }}
95+
</span>
96+
<gl-dropdown-divider />
97+
<gl-dropdown-item @click="addEnvironment(environmentSearch)">
98+
{{ createEnvironmentLabel }}
99+
</gl-dropdown-item>
107100
</template>
108-
<template #no-results-content>{{ $options.translations.noResultsLabel }}</template>
109-
<template #loading-content>{{ $options.translations.loadingResultsLabel }}</template>
110-
</gl-token-selector>
101+
</gl-dropdown>
111102
</template>

0 commit comments

Comments
 (0)