summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/feature_flags/store/gitlab_user_list/getters.js
blob: 164b09801207415c54c396bbcc22cc98b13ecd07 (plain)
1
2
3
4
5
6
7
8
9
10
11
import statuses from './status';

export const userListOptions = ({ userLists }) =>
  userLists.map(({ name, id }) => ({ value: id, text: name }));

export const hasUserLists = ({ userLists, status }) =>
  [statuses.START, statuses.LOADING].indexOf(status) > -1 || userLists.length > 0;

export const isLoading = ({ status }) => status === statuses.LOADING;

export const hasError = ({ status }) => status === statuses.ERROR;