summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/import_projects/store/getters.js
blob: f03474a8404ff50967cbef8c80f534bf2c4be483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export const namespaceSelectOptions = state => {
  const serializedNamespaces = state.namespaces.map(({ fullPath }) => ({
    id: fullPath,
    text: fullPath,
  }));

  return [
    { text: 'Groups', children: serializedNamespaces },
    {
      text: 'Users',
      children: [{ id: state.defaultTargetNamespace, text: state.defaultTargetNamespace }],
    },
  ];
};

export const isImportingAnyRepo = state => state.reposBeingImported.length > 0;

export const hasProviderRepos = state => state.providerRepos.length > 0;

export const hasImportedProjects = state => state.importedProjects.length > 0;