Skip to content
Snippets Groups Projects

Move search bar to top nav to test usage changes

Merged Tomas Bulva requested to merge 480341-move-search-bar-to-top-nav-to-test-usage-changes into master
1 unresolved thread
Compare and Show latest version
1 file
+ 61
52
Compare changes
  • Side-by-side
  • Inline
<script>
import { GlModalDirective, GlTooltipDirective, GlIcon } from '@gitlab/ui';
import { __, s__, sprintf } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { InternalEvents } from '~/tracking';
import SearchModal from './global_search.vue';
import { SEARCH_MODAL_ID } from '../constants';
const trackingMixin = InternalEvents.mixin();
console.log('test');
export default {
SEARCH_MODAL_ID,
components: {
GlIcon,
SearchModal,
},
i18n: {
searchBtnText: __('Search or go to…'),
searchKbdHelp: sprintf(
s__('GlobalSearch|Type %{kbdOpen}/%{kbdClose} to search'),
{ kbdOpen: '<kbd>', kbdClose: '</kbd>' },
false,
),
},
directives: {
GlTooltip: GlTooltipDirective,
GlModal: GlModalDirective,
},
mixins: [glFeatureFlagsMixin(), trackingMixin],
data() {
return {
searchTooltip: this.$options.i18n.searchKbdHelp,
};
},
methods: {
hideSearchTooltip() {
this.searchTooltip = '';
},
showSearchTooltip() {
this.searchTooltip = this.$options.i18n.searchKbdHelp;
},
created() {
console.log(this.$refs);
},
};
// v-if="glFeatures.searchButtonTopRight"
</script>
// import { GlModalDirective, GlTooltipDirective, GlIcon } from '@gitlab/ui';
// import { __, s__, sprintf } from '~/locale';
// import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
// import { InternalEvents } from '~/tracking';
// import SearchModal from './global_search.vue';
// import { SEARCH_MODAL_ID } from '../constants';
<template>
<div>
<button
id="super-sidebar-search"
v-gl-tooltip.bottom.html="searchTooltip"
v-gl-modal="$options.SEARCH_MODAL_ID"
class="user-bar-button gl-block gl-w-full gl-rounded-base gl-border-none gl-bg-gray-10 gl-py-3 gl-leading-1 gl-text-gray-900"
data-testid="super-sidebar-search-button"
@click="trackEvent('click_search_button_to_activate_command_palette')"
>
// const trackingMixin = InternalEvents.mixin();
// export default {
// SEARCH_MODAL_ID,
// components: {
// GlIcon,
// SearchModal,
// },
// i18n: {
// searchBtnText: __('Search or go to…'),
// searchKbdHelp: sprintf(
// s__('GlobalSearch|Type %{kbdOpen}/%{kbdClose} to search'),
// { kbdOpen: '<kbd>', kbdClose: '</kbd>' },
// false,
// ),
// },
// directives: {
// GlTooltip: GlTooltipDirective,
// GlModal: GlModalDirective,
// },
// mixins: [glFeatureFlagsMixin(), trackingMixin],
// data() {
// return {
// searchTooltip: this.$options.i18n.searchKbdHelp,
// };
// },
// methods: {
// hideSearchTooltip() {
// this.searchTooltip = '';
// },
// showSearchTooltip() {
// this.searchTooltip = this.$options.i18n.searchKbdHelp;
// },
// },
// };
// // v-if="glFeatures.searchButtonTopRight"
//
{
/* <button
id="super-sidebar-search"
v-gl-tooltip.bottom.html="searchTooltip"
v-gl-modal="$options.SEARCH_MODAL_ID"
class="user-bar-button gl-block gl-w-full gl-rounded-base gl-border-none gl-bg-gray-10 gl-py-3 gl-leading-1 gl-text-gray-900"
data-testid="super-sidebar-search-button"
@click="trackEvent('click_search_button_to_activate_command_palette')"
>
<gl-icon name="search" />
{{ $options.i18n.searchBtnText }}
</button>
<search-modal @shown="hideSearchTooltip" @hidden="showSearchTooltip" />
</div>
<search-modal @shown="hideSearchTooltip" @hidden="showSearchTooltip" /> */
}
</script>
<template>
<div ref="test-modal">sdfasdfsd</div>
</template>
Loading