diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 18:08:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 18:08:00 +0300 |
commit | 4d3677a52dab1bb5c707ad493dcab8c8bca3dd8b (patch) | |
tree | 5eb579a2e73050aade69edd5bf18ba3b29c86780 /app/assets | |
parent | 37b681b2477113b5008efb79356261e89c4ff82f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
6 files changed, 45 insertions, 28 deletions
diff --git a/app/assets/javascripts/google_tag_manager/index.js b/app/assets/javascripts/google_tag_manager/index.js index 0a1a7a74d21..a9ae9a5af82 100644 --- a/app/assets/javascripts/google_tag_manager/index.js +++ b/app/assets/javascripts/google_tag_manager/index.js @@ -129,6 +129,9 @@ export const trackSaasTrialGroup = () => { } const form = document.querySelector('.js-saas-trial-group'); + + if (!form) return; + form.addEventListener('submit', () => { pushEvent('saasTrialGroup'); }); diff --git a/app/assets/javascripts/search/sidebar/components/label_filter/index.vue b/app/assets/javascripts/search/sidebar/components/label_filter/index.vue index 74855482b5d..eb3556ac2cf 100644 --- a/app/assets/javascripts/search/sidebar/components/label_filter/index.vue +++ b/app/assets/javascripts/search/sidebar/components/label_filter/index.vue @@ -14,17 +14,11 @@ import { mapActions, mapState, mapGetters } from 'vuex'; import { uniq } from 'lodash'; import { rgbFromHex } from '@gitlab/ui/dist/utils/utils'; import { slugify } from '~/lib/utils/text_utility'; -import { s__, sprintf } from '~/locale'; +import { sprintf } from '~/locale'; import DropdownKeyboardNavigation from '~/vue_shared/components/dropdown_keyboard_navigation.vue'; -import { - SEARCH_INPUT_DESCRIBE_BY_NO_DROPDOWN, - SEARCH_INPUT_DESCRIBE_BY_WITH_DROPDOWN, - SEARCH_DESCRIBED_BY_DEFAULT, - SEARCH_DESCRIBED_BY_UPDATED, - SEARCH_RESULTS_LOADING, -} from '~/vue_shared/global_search/constants'; +import { I18N } from '~/vue_shared/global_search/constants'; import { HR_DEFAULT_CLASSES, ONLY_SHOW_MD } from '../../constants'; import LabelDropdownItems from './label_dropdown_items.vue'; @@ -60,16 +54,7 @@ export default { isFocused: false, }; }, - i18n: { - SEARCH_LABELS: s__('GlobalSearch|Search labels'), - DROPDOWN_HEADER: s__('GlobalSearch|Label(s)'), - AGGREGATIONS_ERROR_MESSAGE: s__('GlobalSearch|Fetching aggregations error.'), - SEARCH_DESCRIBED_BY_DEFAULT, - SEARCH_RESULTS_LOADING, - SEARCH_DESCRIBED_BY_UPDATED, - SEARCH_INPUT_DESCRIBE_BY_WITH_DROPDOWN, - SEARCH_INPUT_DESCRIBE_BY_NO_DROPDOWN, - }, + i18n: I18N, computed: { ...mapState(['useSidebarNavigation', 'searchLabelString', 'query', 'aggregations']), ...mapGetters([ @@ -260,7 +245,7 @@ export default { :default-index="defaultIndex" :enable-cycle="true" /> - <div v-if="!aggregations.error"> + <div v-if="!aggregations.error && filteredLabels.length > 0"> <gl-dropdown-section-header v-if="hasSelectedLabels || hasUnselectedLabels">{{ $options.i18n.DROPDOWN_HEADER }}</gl-dropdown-section-header> @@ -280,7 +265,13 @@ export default { </gl-form-checkbox-group> </gl-dropdown-form> </div> - <gl-alert v-else :dismissible="false" variant="danger"> + <span + v-if="!aggregations.error && filteredLabels.length === 0" + class="gl-px-3" + data-testid="no-labels-found-message" + >{{ $options.i18n.NO_LABELS_FOUND }}</span + > + <gl-alert v-if="aggregations.error" :dismissible="false" variant="danger"> {{ $options.i18n.AGGREGATIONS_ERROR_MESSAGE }} </gl-alert> <gl-loading-icon v-if="aggregations.fetching" size="lg" class="my-4" /> diff --git a/app/assets/javascripts/search/sidebar/components/label_filter/label_dropdown_items.vue b/app/assets/javascripts/search/sidebar/components/label_filter/label_dropdown_items.vue index 7a9e6a2e4fc..0b468a60cf0 100644 --- a/app/assets/javascripts/search/sidebar/components/label_filter/label_dropdown_items.vue +++ b/app/assets/javascripts/search/sidebar/components/label_filter/label_dropdown_items.vue @@ -26,15 +26,15 @@ export default { class="gl-px-5 gl-py-3 label-filter-menu-item" > <gl-form-checkbox - class="label-with-color-checkbox gl-display-inline-flex gl-h-5 gl-min-h-5" + class="label-with-color-checkbox gl-display-inline-flex gl-min-h-5" :value="label.key" > <span data-testid="label-color-indicator" - class="gl-rounded-base gl-w-5 gl-h-5 gl-display-inline-block gl-vertical-align-bottom gl-mr-3" + class="gl-rounded-base gl-min-w-5 gl-h-5 gl-display-inline-block gl-vertical-align-bottom gl-mr-3" :style="{ 'background-color': label.color }" ></span> - <span class="gl-reset-text-align gl-m-0 gl-p-0 label-title">{{ + <span class="gl-reset-text-align gl-m-0 gl-p-0 label-title gl-word-break-all">{{ label.title }}</span></gl-form-checkbox > diff --git a/app/assets/javascripts/sidebar/components/participants/participants.vue b/app/assets/javascripts/sidebar/components/participants/participants.vue index bbd3cda0ad3..bad73273409 100644 --- a/app/assets/javascripts/sidebar/components/participants/participants.vue +++ b/app/assets/javascripts/sidebar/components/participants/participants.vue @@ -1,6 +1,7 @@ <script> import { GlButton, GlIcon, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; import { __, n__, sprintf } from '~/locale'; +import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import UserAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue'; export default { @@ -81,6 +82,9 @@ export default { toggleMoreParticipants() { this.isShowingMoreParticipants = !this.isShowingMoreParticipants; }, + getParticipantId(participantId) { + return getIdFromGraphQLId(participantId); + }, onClickCollapsedIcon() { this.$emit('toggleSidebar'); }, @@ -118,13 +122,14 @@ export default { > <a :href="participant.web_url || participant.webUrl" - class="author-link gl-display-inline-block gl-rounded-full" + :data-user-id="getParticipantId(participant.id)" + :data-username="participant.username" + class="author-link js-user-link gl-display-inline-block gl-rounded-full" > <user-avatar-image :lazy="lazy" :img-src="participant.avatar_url || participant.avatarUrl" :size="24" - :tooltip-text="participant.name" :img-alt="participant.name" css-classes="gl-mr-0!" tooltip-placement="bottom" diff --git a/app/assets/javascripts/vue_shared/global_search/constants.js b/app/assets/javascripts/vue_shared/global_search/constants.js index 4211b9578a2..955ccae4efb 100644 --- a/app/assets/javascripts/vue_shared/global_search/constants.js +++ b/app/assets/javascripts/vue_shared/global_search/constants.js @@ -75,3 +75,23 @@ export const SEARCH_RESULTS_ORDER = [ HELP_CATEGORY, ]; export const DROPDOWN_ORDER = SEARCH_RESULTS_ORDER; + +export const SEARCH_LABELS = s__('GlobalSearch|Search labels'); + +export const DROPDOWN_HEADER = s__('GlobalSearch|Label(s)'); + +export const AGGREGATIONS_ERROR_MESSAGE = s__('GlobalSearch|Fetching aggregations error.'); + +export const NO_LABELS_FOUND = s__('GlobalSearch|No labels found'); + +export const I18N = { + SEARCH_DESCRIBED_BY_DEFAULT, + SEARCH_RESULTS_LOADING, + SEARCH_DESCRIBED_BY_UPDATED, + SEARCH_INPUT_DESCRIBE_BY_WITH_DROPDOWN, + SEARCH_INPUT_DESCRIBE_BY_NO_DROPDOWN, + SEARCH_LABELS, + DROPDOWN_HEADER, + AGGREGATIONS_ERROR_MESSAGE, + NO_LABELS_FOUND, +}; diff --git a/app/assets/stylesheets/page_bundles/search.scss b/app/assets/stylesheets/page_bundles/search.scss index d1d14cbcddd..a3a62b44e98 100644 --- a/app/assets/stylesheets/page_bundles/search.scss +++ b/app/assets/stylesheets/page_bundles/search.scss @@ -69,11 +69,9 @@ $language-filter-max-height: 20rem; } .label-with-color-checkbox { - max-height: $gl-spacing-scale-5; - .custom-control-label { + display: flex; margin-bottom: 0; - max-height: $gl-spacing-scale-5; .label-title { margin-left: -$gl-spacing-scale-2; |