waltz-ng/client/common/grid-utils.js
/**
 * Creates a column def to render an entity link
 *
 * eg: usage: mkEntityLinkGridCell('Source', 'source', 'none')
 *
 * @param columnHeading  column display name
 * @param entityRefField  field name in grid data that stores the entity ref for which the link needs to be rendered
 * @param showIcon  whether to display the icon or not
 * @returns {{field: *, displayName: *, cellTemplate: string}}
 */


@param columnHeading  column display name
@param entityRefField  field name in grid data that stores the entity ref for which the link needs to be rendered
@param showIcon  whether to display the icon or not
@returns {{field: *, displayName: *, cellTemplate: string}}
@param columnHeading column display name @param entityRefField field name in grid data that stores the entity ref for which the link needs to be rendered @param showIcon whether to display the icon or not @returns {{ field : * displayName : * cellTemplate : string }}
function mkEnumGridCell(columnHeading,
                               entityRefField,
                               enumType,
                               showIcon = false,
                               showPopover = false) {
    return {
        field: entityRefField,
        displayName: columnHeading,
        cellTemplate: `
            <div class="ui-grid-cell-contents">
                <waltz-enum-value type="'${enumType}'"
                                  show-icon="${showIcon}"
                                  show-popover="${showPopover}"
                                  key="COL_FIELD">
                </waltz-enum-value>
            </div>`
    };
}
function mkEnumGridCell ( columnHeading , entityRefField , enumType , showIcon = false , showPopover = false ) { return { field : entityRefField , displayName : columnHeading , cellTemplate : ` ${ enumType } ${ showIcon } ${ showPopover } ` } ; }
Creates a column def to render an entity link
 eg: usage: mkEntityLinkGridCell('Source', 'source', 'none')
Creates a column def to render an entity link eg : usage : mkEntityLinkGridCell ( ' Source ' ' source ' ' none ' )