All files / app/assets/javascripts/import_entities/import_projects/store getters.js

100% Statements 17/17
100% Branches 2/2
100% Functions 8/8
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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    4x   32x   16x   31x   17x   24x 5x 1x     4x   4x          
import { isProjectImportable, isIncompatible, isImporting } from '../utils';
 
export const importingRepoCount = (state) => state.repositories.filter(isImporting).length;
 
export const isImportingAnyRepo = (state) => state.repositories.some(isImporting);
 
export const hasIncompatibleRepos = (state) => state.repositories.some(isIncompatible);
 
export const hasImportableRepos = (state) => state.repositories.some(isProjectImportable);
 
export const importAllCount = (state) => state.repositories.filter(isProjectImportable).length;
 
export const getImportTarget = (state) => (repoId) => {
  if (state.customImportTargets[repoId]) {
    return state.customImportTargets[repoId];
  }
 
  const repo = state.repositories.find((r) => r.importSource.id === repoId);
 
  return {
    newName: repo.importSource.sanitizedName,
    targetNamespace: state.defaultTargetNamespace,
  };
};