summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/access_tokens/components/constants.js
blob: 84e50bc099f5f0aa65d48f4c685da668f774aed5 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { __, s__ } from '~/locale';

export const EVENT_ERROR = 'ajax:error';
export const EVENT_SUCCESS = 'ajax:success';
export const FORM_SELECTOR = '#js-new-access-token-form';

export const INITIAL_PAGE = 1;
export const PAGE_SIZE = 100;

export const FIELDS = [
  {
    key: 'name',
    label: __('Token name'),
    sortable: true,
    tdClass: `gl-text-black-normal`,
    thClass: `gl-text-black-normal`,
  },
  {
    formatter(scopes) {
      return scopes?.length ? scopes.join(', ') : __('no scopes selected');
    },
    key: 'scopes',
    label: __('Scopes'),
    sortable: true,
    tdClass: `gl-text-black-normal`,
    thClass: `gl-text-black-normal`,
  },
  {
    key: 'createdAt',
    label: s__('AccessTokens|Created'),
    sortable: true,
    tdClass: `gl-text-black-normal`,
    thClass: `gl-text-black-normal`,
  },
  {
    key: 'lastUsedAt',
    label: __('Last Used'),
    sortable: true,
    tdClass: `gl-text-black-normal`,
    thClass: `gl-text-black-normal`,
  },
  {
    key: 'expiresAt',
    label: __('Expires'),
    sortable: true,
    tdClass: `gl-text-black-normal`,
    thClass: `gl-text-black-normal`,
  },
  {
    key: 'role',
    label: __('Role'),
    tdClass: `gl-text-black-normal`,
    thClass: `gl-text-black-normal`,
    sortable: true,
  },
  {
    key: 'action',
    label: __('Action'),
    thClass: `gl-text-black-normal`,
  },
];