1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<script>
import { GlFilteredSearch } from '@gitlab/ui';
import { s__ } from '~/locale';
import { OPERATOR_IS_ONLY } from '~/vue_shared/components/filtered_search_bar/constants';
import JobStatusToken from './tokens/job_status_token.vue';
export default {
tokenTypes: {
status: 'status',
},
components: {
GlFilteredSearch,
},
computed: {
tokens() {
return [
{
type: this.$options.tokenTypes.status,
icon: 'status',
title: s__('Jobs|Status'),
unique: true,
token: JobStatusToken,
operators: OPERATOR_IS_ONLY,
},
];
},
},
methods: {
onSubmit(filters) {
this.$emit('filterJobsBySearch', filters);
},
},
};
</script>
<template>
<gl-filtered-search
:placeholder="s__('Jobs|Filter jobs')"
:available-tokens="tokens"
@submit="onSubmit"
/>
</template>
|