Skip to content

Commit

Permalink
feat(displayName): Adding display name property for the bakery baseOS…
Browse files Browse the repository at this point in the history
… options (#7464)
  • Loading branch information
gal-yardeni authored and marchello2000 committed Sep 30, 2019
1 parent e0c57af commit 564af88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface IBaseImage {
shortDescription: string;
detailedDescription: string;
packageType: string;
displayName: string;
}

export interface IBaseOsOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { IController, IComponentOptions, module } from 'angular';
import { isEmpty } from 'lodash';

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

export class BakeStageChooseOSController implements IController {
Expand All @@ -19,9 +21,9 @@ export class BakeStageChooseOSController implements IController {
}

public getBaseOsDescription(baseOsOption: IBaseOsOption): string {
return baseOsOption.id + (baseOsOption.shortDescription ? ' (' + baseOsOption.shortDescription + ')' : '');
const baseOsName = isEmpty(baseOsOption.displayName) ? baseOsOption.id : baseOsOption.displayName;
return baseOsName + (baseOsOption.shortDescription ? ' (' + baseOsOption.shortDescription + ')' : '');
}

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

0 comments on commit 564af88

Please sign in to comment.