function createTemplateList (templates, clusterId = null) {
  function testCluster (template) {
    const templateCluster = template.get('clusterId')
    return templateCluster === null || (clusterId && templateCluster === clusterId)
  }

  const templateList =
    templates
      .toList()
      .filter(template =>
        // TODO: template.get('canUserUseTemplate') &&
        testCluster(template)
      )
      .map(template => ({
        id: template.get('id'),
        value: templateNameRenderer(template),
      }))
      .sort((a, b) => localeCompare(a.value, b.value))
      .toJS()

  return templateList
}
/**
 * Return a normalized and sorted list of Templates ready for use in a __SelectBox__ from
 * the Map of provided templates cross referenced to the given cluster.
 */
Return a normalized and sorted list of Templates ready for use in a __SelectBox__ from
the Map of provided templates cross referenced to the given cluster.
Return a normalized and sorted list of Templates ready for use in a __SelectBox__ from the Map of provided templates cross referenced to the given cluster .
function createTemplateList (templates, clusterId = null) {
  function testCluster (template) {
    const templateCluster = template.get('clusterId')
    return templateCluster === null || (clusterId && templateCluster === clusterId)
  }
  const templateList =
    templates
      .toList()
      .filter(template =>
        testCluster(template)
      )
      .map(template => ({
        id: template.get('id'),
        value: templateNameRenderer(template),
      }))
      .sort((a, b) => localeCompare(a.value, b.value))
      .toJS()
  return templateList
}
function createTemplateList ( templates , clusterId = null ) { function testCluster ( template ) { const templateCluster = template . get ( 'clusterId' ) return templateCluster === null || ( clusterId && templateCluster === clusterId ) } const templateList = templates . toList ( ) . filter ( template => testCluster ( template ) ) . map ( template => ( { id : template . get ( 'id' ) , value : templateNameRenderer ( template ) , } ) ) . sort ( ( a , b ) => localeCompare ( a . value , b . value ) ) . toJS ( ) return templateList }
Return a normalized and sorted list of Templates ready for use in a __SelectBox__ from
 the Map of provided templates cross referenced to the given cluster.
Return a normalized and sorted list of Templates ready for use in a __SelectBox__ from the Map of provided templates cross referenced to the given cluster .
// TODO: template.get('canUserUseTemplate') &&