Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ui_development_kit.js « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 028b047d9f5023406bd5cfafd33e9c803dea4266 (plain)
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
import $ from 'jquery';
import Api from './api';
import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown';

export default () => {
  initDeprecatedJQueryDropdown($('#js-project-dropdown'), {
    data: (term, callback) => {
      Api.projects(
        term,
        {
          order_by: 'last_activity_at',
        },
        (data) => {
          callback(data);
        },
      );
    },
    text: (project) => project.name_with_namespace || project.name,
    selectable: true,
    fieldName: 'author_id',
    filterable: true,
    search: {
      fields: ['name_with_namespace'],
    },
    id: (data) => data.id,
    isSelected: (data) => data.id === 2,
  });
};