<commit_before>import { IController, IComponentOptions, module } from 'angular';

export interface IBaseOsOption {
  id: string;
  shortDescription?: string;
  detailedDescription: string;
  isImageFamily?: boolean;
}

export class BakeStageChooseOSController implements IController {

  public model: any;
  public baseOsOptions: IBaseOsOption[];

  public showRadioButtons = false;

  public $onInit(): void {
    this.showRadioButtons = this.baseOsOptions.length <= 2;
  }

  public getBaseOsDescription(baseOsOption: IBaseOsOption): String {
    return baseOsOption.id + (baseOsOption.shortDescription ? ' (' + baseOsOption.shortDescription + ')' : '');
  }

  public getBaseOsDetailedDescription(baseOsOption: IBaseOsOption): String {
    return baseOsOption.detailedDescription + (baseOsOption.isImageFamily ? ' (family)' : '');
  }
}

class BakeStageChooseOSComponent implements IComponentOptions {
  public bindings: any = {
    baseOsOptions: '<',
    model: '='
  };
  public controller: any = BakeStageChooseOSController;
  public templateUrl: string = require('./bakeStageChooseOs.component.html')
}

export const PIPELINE_BAKE_STAGE_CHOOSE_OS = 'spinnaker.core.pipeline.bake.chooseOS.component';
module(PIPELINE_BAKE_STAGE_CHOOSE_OS, [])
  .component('bakeStageChooseOs', new BakeStageChooseOSComponent());<commit_msg>fix(bake): Fix JavaScript error on bake stage load (#5027)<commit_after>import { IController, IComponentOptions, module } from 'angular';

export interface IBaseOsOption {
  id: string;
  shortDescription?: string;
  detailedDescription: string;
  isImageFamily?: boolean;
}

export class BakeStageChooseOSController implements IController {

  public model: any;
  public baseOsOptions: IBaseOsOption[];

  public showRadioButtons = false;

  public $onChanges(): void {
    this.showRadioButtons = this.baseOsOptions && this.baseOsOptions.length <= 2;
  }

  public getBaseOsDescription(baseOsOption: IBaseOsOption): String {
    return baseOsOption.id + (baseOsOption.shortDescription ? ' (' + baseOsOption.shortDescription + ')' : '');
  }

  public getBaseOsDetailedDescription(baseOsOption: IBaseOsOption): String {
    return baseOsOption.detailedDescription + (baseOsOption.isImageFamily ? ' (family)' : '');
  }
}

class BakeStageChooseOSComponent implements IComponentOptions {
  public bindings: any = {
    baseOsOptions: '<',
    model: '='
  };
  public controller: any = BakeStageChooseOSController;
  public templateUrl: string = require('./bakeStageChooseOs.component.html')
}

export const PIPELINE_BAKE_STAGE_CHOOSE_OS = 'spinnaker.core.pipeline.bake.chooseOS.component';
module(PIPELINE_BAKE_STAGE_CHOOSE_OS, [])
  .component('bakeStageChooseOs', new BakeStageChooseOSComponent());
{'fraction_non_alphanumeric': 0.10724743777452415, 'fraction_numerical': 0.0021961932650073207, 'mean_word_length': 5.633495145631068, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2501825', 'n_tokens_mistral': 840, 'n_tokens_neox': 810, 'n_words': 164}